Page 1 of 1

Who is responsible for spawning initial units?

Posted: 30 Jan 2010, 12:01
by slogic
I faced interesting situation. Spawned commander stuck in a feature and never moved. Is it an engine bug? Or Lua related?

Re: Who is responsible for spawning inital units?

Posted: 30 Jan 2010, 12:16
by Tobi
Game bug. (Although engine spawns commander atm.)

It's easy for game to include some code to remove features in a small range around start position, or to use AllowStartPosition LuaRules call-in to block positions on top of features... (or AI could be made to reclaim the feature in such case)

Re: Who is responsible for spawning initial units?

Posted: 08 Mar 2012, 18:37
by Jools
AllowStartPosition is not documented. How do we use it?

Re: Who is responsible for spawning initial units?

Posted: 08 Mar 2012, 19:04
by knorke
old thread is old.

from LuaRules.cpp:
bool CLuaRules::AllowStartPosition(int playerID, const float3& pos)

so its
gadget:AllowStartPosition(playerID, x,y,z)
return true -> player is allowed to place
return false -> denied!

(didnt test, add to wiki if it works)