In progress for 0.3.0

Post Reply
kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

In progress for 0.3.0

Post by kovarex »

To avoid repetition this is the info for the next planned version.
Feel free to suggest important stuff that is missing, or any other comments.

Ready:
  • LuaInventory::remove function
  • Merged on ununitdied and onplayerdied to onentitydied (so all entities with health emit this event when dying)
  • The migration script runs before control lua and can be used to reload scripts from the original scenario, this will be extra useful after the script interface changes in 0.3.0
  • Divided the player and it's character, methods connected with just player and not his character are accessible from the LuaPlayer class (game.player), methods like print, setgoaldescription etc.. Character is accessible as entity (game.player.character) and contains the rest of the methods. This allows having player without character or character without player.
  • Dynamic furnace energy source in json (so it can be electric)
  • Started to use the name of the recipe in json definition of recipe, this allows different recipes for the same product.
In progress:
  • Way to manupulate custom gui elements (Just buttons now) in the script, these emit events that can be used in the script.
Planned:
  • Every mod will have its own directory in the mods directory, all it's data (json definitions, control.lua additions) will be in this directory.
  • English fallback for translations
  • Allow to have separate translation files into more files (so mods can entity names translations in it's directory)
Planned someday:
  • LuaEntity, entity that has drawing function/update and all behaviour defined as lua, this would be slower than native entities, but would add a lot of possibilities.

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: In progress for 0.3.0

Post by SilverWarior »

I think that exposing some low level entity functions like MoveTo, AttackTarget, etc. could come quite in handy as they would consequentially alow moders to actually go and develop AI for various entities.
So you could have aliens patroling near their base and not just standing still. You could have alians capable of rebuilding their bases. Posibilities are almost endles.

Since we are talking about posibility for AI it would be also nice if you could join several entities together into a group so that they actually acts like a group. For instance if one member of the group gets you in sight whole group atacks you at the same time.

And since I mentioned entities it would be nice to have option to actually change entity owner. Owner of the entity defines who can interact with this entity. So having multiplayer in mind I would suggest something like this:
1. Entity is owned by specific player: Only specific player can interact with entity (perosnal chests)
2. Entity is owned by an aliance: All the members of the aliance can interact with it so cooperative play is posible.
3. Entity is not owned by anybody (neutral): Everyone can interact with this entity (ruins)
4. Entity is owned by enemy: Only enemies can interact with this entity (enemy structures)

drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: In progress for 0.3.0

Post by drs9999 »

Sounds awesome!!!
kovarex wrote:The migration script runs before control lua and can be used to reload scripts from the original scenario, this will be extra useful after the script interface changes in 0.3.0
What does that mean exactly?
kovarex wrote:Way to manupulate custom gui elements (Just buttons now) in the script, these emit events that can be used in the script.
Would it be too much work to implement slider as well? they can create an event that returns their value when changed or the gui is closed.
kovarex wrote:LuaEntity, entity that has drawing function/update and all behaviour defined as lua, this would be slower than native entities, but would add a lot of possibilities.
So something that will make this possible?

Code: Select all

If (creeperinsight) then alarm-bell.update.animation("alarm.pgn) else  alarm-bell.update.animation("noalarm.pgn) 
SilverWarior wrote:I think that exposing some low level entity functions like MoveTo, AttackTarget, etc. could come quite in handy as they would consequentially alow moders to actually go and develop AI for various entities.
I think this is possible (in some way) right now. Have a look at the CC-Mod.
SilverWarior wrote:Since we are talking about posibility for AI it would be also nice if you could join several entities together into a group so that they actually acts like a group. For instance if one member of the group gets you in sight whole group atacks you at the same time.
Also this should be possible right now.

Code: Select all

Pseudo-code
Place all group.entities into a table
Create a for loop that runs trough each entity
Foreach group.entities do
    if (canseeplayer) then
       foreach group.entities do
           group.entities.attack(player)
       end
   end
end
SilverWarior wrote:And since I mentioned entities it would be nice to have option to actually change entity owner. Owner of the entity defines who can interact with this entity. So having multiplayer in mind I would suggest something like this
This sounds useful. But I would say that this is ( theoretical) possible right know,too.

Also I want to ask for a complete list of functions / methods that are currenctly available. It dont have to be a list that explain then function or method (like on the wiki), just a plain list. It would be very useful to see what is really doable at the moment.

User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: In progress for 0.3.0

Post by rk84 »

I'm gonna love "onentitydied".
Method ideas:
  • tilename getmaptile(position). One use would be together with createentity to check proper placement of entity... I just noticed canplaceentity, but still knowing the tile type could have it uses.
  • setmaptile(tilename, position). Terraforming, pollution, mined terrain... even bridges perhaps?
  • setforce(forcename). This could be helpfull, but I think I can live with entity switching for now.
  • getorientation() We need it for blueprints.
Event ideas:
  • ontouch Called by area trigger -entity and mayby it could be connected to units also and/or player? Parameters touched and toucher?
Entity request:
I would really really like boxcar with big container to go with locomotive. I can't wait it anymore so I will propably do some workaround :lol:

@below yes. banner is switched to enemy turret that look like banner.
Last edited by rk84 on Thu Mar 14, 2013 5:38 pm, edited 4 times in total.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: In progress for 0.3.0

Post by ficolas »

nope, how the cc mod works is that when the player places a banner, it automatically changes the force, and the banners are turrets, so your soldiers track them.
(Im not totally sure)

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: In progress for 0.3.0

Post by SilverWarior »

drs9999 wrote:What does that mean exactly?
I think he is talking about special scripts which are used to alow you to load savegames and levels from previous versions of Factorio.
drs9999 wrote:
SilverWarior wrote:Since we are talking about posibility for AI it would be also nice if you could join several entities together into a group so that they actually acts like a group. For instance if one member of the group gets you in sight whole group atacks you at the same time.
Also this should be possible right now.

Code: Select all

Pseudo-code
Place all group.entities into a table
Create a for loop that runs trough each entity
Foreach group.entities do
    if (canseeplayer) then
       foreach group.entities do
           group.entities.attack(player)
       end
   end
end
Your example has one problem and that is that if several units has player in sight you would be executing nested for lop, which is used to isue command to all group entities, multiple times. So if you have bunch of aliens from one group near the player you can realy hurt game performance with that.

What I had in mind is creating another class for group which holds some aditional data like current group orders etc. So if group has no orders or only orders to move you go and check if player is in sight of one of group members. If it is you seet group orders to attack the player. So this means that you won't be rechecking if the player is in sight every time.
Another advantage of implementing groups like this is the posibility to save aditional relative positions for each group member which would in the end provide you with the ability to introduce formations.

drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: In progress for 0.3.0

Post by drs9999 »

Yes your absolutly right this can not work.
But i still believe that something what you want is possible with the given possibilities

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: In progress for 0.3.0

Post by ficolas »

I think that something that would be usefull is more electricity support for modding.

Post Reply

Return to “Implemented mod requests”