Game Spawn
http://pastebin.com/v0efaweN
Can someone help me modify this so that AIs will start with a different unit?
I have already defined startunitai in sidedata.
SideData
http://pastebin.com/JRBF1SCY
Make AIs have different start units
Moderator: Moderators
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Make AIs have different start units
http://pastebin.com/jbhhzWDm
http://tylerneylon.com/a/learn-lua/
Its never too late to learn lua. Coding-Analphabetism can be cured!
http://tylerneylon.com/a/learn-lua/
Its never too late to learn lua. Coding-Analphabetism can be cured!
Re: Make AIs have different start units
Avoid doing that in game spawn. Use a new gadget
Re: Make AIs have different start units
Smoth volunteers to write a gadget for you forb - always said the guy was a big spender when it came to time.
Bravo, smoth, bravo, da capo!
Nothing more admirable then giving everything you got for the comunity.
Bravo, smoth, bravo, da capo!
Nothing more admirable then giving everything you got for the comunity.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Make AIs have different start units
Why?smoth wrote:Avoid doing that in game spawn. Use a new gadget
@picasso, thanks

Re: Make AIs have different start units
Because you may want to built it into something more later.
Because games spawn is for start units, why complicate a simple gadget?
If it errors nothing spawns
Seperation of concerns
Because games spawn is for start units, why complicate a simple gadget?
If it errors nothing spawns
Seperation of concerns
Re: Make AIs have different start units
But this is the part that concerns itself with various GameStart Activitys..
What you could do is add a GameMode.lua that creates startConditions depending in which GameMode evo is started, but any more architecture would be overkill.
What you could do is add a GameMode.lua that creates startConditions depending in which GameMode evo is started, but any more architecture would be overkill.
Re: Make AIs have different start units
S44 CRAIG does this since years, too lazy to find full link so https://github.com/spring1944/spring1944
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Make AIs have different start units
Unfortunately, this does not work. The AI unit never spawns, no matter how I have tried to make it happen. Help would be appreciated.PicassoCT wrote:http://pastebin.com/jbhhzWDm
Imo a separate gadget doesn't make sense at all. Game spawn is already a gadget, so why wouldn't you want all of your game start spawning stuff to happen there?
Edit: Found the issue, it wasn't reading from sidedata correctly.
Re: Make AIs have different start units
[code]
local Gaia = Spring.GetGaiaTeamID
local ai = select(4, Spring.GetTeamInfo(teamID))+
cheatAItype = Spring.GetModOptions().cheatingai
if ai == true and team ~= Gaia and type ~= "feature" then
local heading = math.random(3)
local builder1 = Spring.CreateUnit("euf_constructor_ai", x, y, z, heading, teamID)
if cheatAItype == "1" then
local zero = Spring.CreateUnit("euf_techcenter_shield_ai", x,y,z+150, heading, teamID)
end
else
local heading = math.random(3)
local builder1 = Spring.CreateUnit("euf_constructor", x, y, z, heading, teamID)
end
[/code]
This is how we did it for the cursed - it also includes a mod option to boost the starting conditions of AI teams.
local Gaia = Spring.GetGaiaTeamID
local ai = select(4, Spring.GetTeamInfo(teamID))+
cheatAItype = Spring.GetModOptions().cheatingai
if ai == true and team ~= Gaia and type ~= "feature" then
local heading = math.random(3)
local builder1 = Spring.CreateUnit("euf_constructor_ai", x, y, z, heading, teamID)
if cheatAItype == "1" then
local zero = Spring.CreateUnit("euf_techcenter_shield_ai", x,y,z+150, heading, teamID)
end
else
local heading = math.random(3)
local builder1 = Spring.CreateUnit("euf_constructor", x, y, z, heading, teamID)
end
[/code]
This is how we did it for the cursed - it also includes a mod option to boost the starting conditions of AI teams.