I want to make a map where the terrain deform when you build units on certain place.
When I use \LuaGaia\Gadgets\*.lua like I've been told I should, UnitCreated is not called. I have to use \LuaRules\Gadgets\*.lua like I've been told I should NOT.
LuaGaia cannot see units
Moderator: Moderators
Re: LuaGaia cannot see units
It can work. See World Builder maps.
Re: LuaGaia cannot see units
Merely renaming the folder from LuaGaia to LuaRules suddenly made the UnitCreated function be called, so I know it's not because I borked my code, and I know they are handled differently.
WorldBuilder is part of Pure, that is 500 mb heavy and does not work on my computer. Can you just explain what's the trick?
WorldBuilder is part of Pure, that is 500 mb heavy and does not work on my computer. Can you just explain what's the trick?
Re: LuaGaia cannot see units
It's 200MB, get the latest version.
Long story short, you need to include a draw.lua and main.lua.
Long story short, you need to include a draw.lua and main.lua.
Re: LuaGaia cannot see units
I included a draw.lua and a main.lua.
Maybe should I stress that the GameFrame function is called both from /LuaGaia/ and from /LuaRules/, it's the UnitCreated function that is called only in /LuaRules/
Maybe should I stress that the GameFrame function is called both from /LuaGaia/ and from /LuaRules/, it's the UnitCreated function that is called only in /LuaRules/
Re: LuaGaia cannot see units
In the LuaGaia folder? And you're just talking about the event callin, right?
Why do you want that to be map-specific, btw? Can't you do it with a Gadget and a config on the map side?
Why do you want that to be map-specific, btw? Can't you do it with a Gadget and a config on the map side?
Re: LuaGaia cannot see units
Here's the map. When the folder is named LuaRules, the map detects structures being built on the crosses. When the folder is named LuaGaia, the map does not detect structures being built.
Re: LuaGaia cannot see units
Do not have a main.lua and draw.lua if you're using the LuaRules folder. You just broke any mod that has code run in its main.lua, notably CA.
Re: LuaGaia cannot see units
I knew I was doing it wrong....
Now help me doing it right (with a /LuaGaia/ folder).
Edit:
From #lua
<Tobi> LuaGaia seems to be set up to control / see the gaia team only
<Tobi> so it doesn't get events for non-gaia units being created
<Tobi> ah and it also sets teamsLocked to true, not sure when exactly that's used but it sound like in current version the only way around it is to use LuaRules
<zwzsg> Is this considered a bug that will be fixed, or a feature that will stay?
<Tobi> I don't really see why LuaGaia should be limited so much
So apparently /LuaGaia/ is not "The Lua of the map" but "The lua of the Gaia faction".
Devs and mappers need to have a discussion about why where those limits were put into place, what's the advised way to create a map that reacts to player units, etc...
Now help me doing it right (with a /LuaGaia/ folder).
Edit:
OK, removed those two files from Palladium, lurker. But I apparently still have to use /LuaRules/ in order to react to player's units.lurker wrote:Do not have a main.lua and draw.lua if you're using the LuaRules folder. You just broke any mod that has code run in its main.lua, notably CA.
I had a look in PURE_RC6_BAREBONES.zip's maps. The only call-in you use is GameStart() (and maybe GetInfo()). None of them use UnitCreated, or even any call-in related to player's units. Which is why they are not subject to the problem I have. So maybe it's my fault for not precising from the start that indeed call-ins such as Initialize, GameStart, GameFrame work fine when in /LuaGaia/ and that it is only call-ins such as UnitCreated that are ignored, but having seen World Builder maps didn't help.Argh wrote:It can work. See World Builder maps.
From #lua
<Tobi> LuaGaia seems to be set up to control / see the gaia team only
<Tobi> so it doesn't get events for non-gaia units being created
<Tobi> ah and it also sets teamsLocked to true, not sure when exactly that's used but it sound like in current version the only way around it is to use LuaRules
<zwzsg> Is this considered a bug that will be fixed, or a feature that will stay?
<Tobi> I don't really see why LuaGaia should be limited so much
So apparently /LuaGaia/ is not "The Lua of the map" but "The lua of the Gaia faction".
Devs and mappers need to have a discussion about why where those limits were put into place, what's the advised way to create a map that reacts to player units, etc...
Re: LuaGaia cannot see units
Just modified LuaGaia so it can see everything, but still only control the gaia team.
(Seems like a good compromise, keeping the original intent (map not messing with the game too much) while still allowing the map to react to game events.)
(Seems like a good compromise, keeping the original intent (map not messing with the game too much) while still allowing the map to react to game events.)
Re: LuaGaia cannot see units
That would still not allow stuff like maps with teleporters...