Who is responsible for spawning initial units?

Who is responsible for spawning initial units?

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Locked
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Who is responsible for spawning initial units?

Post by slogic »

I faced interesting situation. Spawned commander stuck in a feature and never moved. Is it an engine bug? Or Lua related?
Attachments
screen024.jpg
(140.57 KiB) Downloaded 1 time
Last edited by slogic on 30 Jan 2010, 23:03, edited 1 time in total.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Who is responsible for spawning inital units?

Post 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)
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Who is responsible for spawning initial units?

Post by Jools »

AllowStartPosition is not documented. How do we use it?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Who is responsible for spawning initial units?

Post 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)
Locked

Return to “Help & Bugs”