[Changed] Neutral units?
Moderator: Moderators
[Changed] Neutral units?
My mod requires that the player captures neutral feature around the map, and that the features become part of the player's team, adopt the teamcolor, and "activate" as units. Is this possible?
Last edited by Sheekel on 23 Nov 2007, 06:21, edited 2 times in total.
Re: [Changed] Neutral units?
I have a King of the Doomsday game option in Fibre now (not released). There's a neutral unit that, when captured and supplied with enough energy, can fire devastating laser beams.Sheekel wrote:My mod requires that the player captures neutral feature around the map, and that the features become part of the player's team, adopt the teamcolor, and "activate" as units. Is this possible?
It's probably better to use a neutral unit (assign to Gaia team and SetUnitNeutral()) than a feature.
- HildemarDasce
- Posts: 74
- Joined: 13 Nov 2005, 12:06
Uhm, no, it's not capture the flag, what you are refering to is "steal the bacon" or "Extreme Murder Ball"... unless you mean the capture the flag where the opponents can't move their own flag... in which case you'd need an additional way to only allow the flag to be captured by the correct team.
No Sheekel is actually probably talking about his Spring Wars game where you will need to capture resource generation units and bases to win and there will be neutral copies on the map to start with.
No Sheekel is actually probably talking about his Spring Wars game where you will need to capture resource generation units and bases to win and there will be neutral copies on the map to start with.
Re: [Changed] Neutral units?
I've been trying to get Units to spawn as truly neutral, and anything on non-Gaia teams fires on them, and vice-versa.
Um... wtf? I thought Gaia was, by definition, supposed to be neutral, unless specified otherwise. At any rate, how do I change everything that's been assigned to Spring.GetGaiaTeamID to Spring.SetUnitNeutral??? I mean, if I'm Creating a unit like this:
Spring.CreateUnit("GaiaUnit", x,y,z, 0, Spring.GetGaiaTeamID())
... is it just a param, and where does it go? Or what?
I have 90% of a working randomizer for the vast majority of maps, including some nifty animated stuff (my whole using Units instead of Features thing is almost done), but this part is being a royal pain- I need some things to be hostile to all players, and some to be true neutral, so that players can capture them and use them without having to fight them first...
Um... wtf? I thought Gaia was, by definition, supposed to be neutral, unless specified otherwise. At any rate, how do I change everything that's been assigned to Spring.GetGaiaTeamID to Spring.SetUnitNeutral??? I mean, if I'm Creating a unit like this:
Spring.CreateUnit("GaiaUnit", x,y,z, 0, Spring.GetGaiaTeamID())
... is it just a param, and where does it go? Or what?
I have 90% of a working randomizer for the vast majority of maps, including some nifty animated stuff (my whole using Units instead of Features thing is almost done), but this part is being a royal pain- I need some things to be hostile to all players, and some to be true neutral, so that players can capture them and use them without having to fight them first...
Re: [Changed] Neutral units?
Gaia is neutral as in "it's neither us nor them, so shoot it anyway" by default; it's changeable (Fibre does this I believe), but I don't know how 

Re: [Changed] Neutral units?
<checks Fibre>
Ah, it's in Charge.lua. And it is per-unit. Thank goodness. Now I just need to figure out how to apply it and I'm all set.
Ah, it's in Charge.lua. And it is per-unit. Thank goodness. Now I just need to figure out how to apply it and I'm all set.
Re: [Changed] Neutral units?
Hmm. Still stuck on making things neutral. The main code, for placing everything, works just fine. I can make everything neutral, at this point, but I'm still stuck on making things selectively neutral.
Here's the code I'm currently using... any ideas where things are going wrong? gaia_fusion is obviously returning 0 every time...
Here's the code I'm currently using... any ideas where things are going wrong? gaia_fusion is obviously returning 0 every time...
Code: Select all
if (gadgetHandler:IsSyncedCode()) then
--------------------------------------------------------------------------------
-- SYNCED
--------------------------------------------------------------------------------
gaia_fusion = UnitDefNames.GaiaFusion.id
function gadget:GameFrame(f)
if((f - 8) % 16 < 0.1) then
for _,u in ipairs(Spring.GetTeamUnits(Spring.GetGaiaTeamID())) do
if (Spring.GetUnitDefID(u) == gaia_fusion) then
Spring.SetUnitNeutral(u, true)
end
end
end
end
end
Re: [Changed] Neutral units?
changelog.txt wrote: - UnitDef names are always lower case now.
Re: [Changed] Neutral units?
Just in LUA? Or do I have to do that in my FBIs, too?
[edit]
Ok, just in LUA. And now the whole thing works. Muahaha, maps, at least in PURE, will never be the same
Soooo... now all I've gotta do is figure out how to set this up to read from a config list, and maybe even set up placement from those lists output from the "scenario builder" <gasp, pant> so that we have a complete tool for mappers, scenario designers, et al. worth releasing under GPL... <pores over list stuff>
[edit]
Ok, just in LUA. And now the whole thing works. Muahaha, maps, at least in PURE, will never be the same

Soooo... now all I've gotta do is figure out how to set this up to read from a config list, and maybe even set up placement from those lists output from the "scenario builder" <gasp, pant> so that we have a complete tool for mappers, scenario designers, et al. worth releasing under GPL... <pores over list stuff>
Last edited by Argh on 03 Jan 2008, 02:28, edited 1 time in total.
Re: [Changed] Neutral units?
only in lua
Re: [Changed] Neutral units?
Huh. Apparently "neutral" units will still attempt to attack players, even if players don't want to attack them!
I guess I can send a value to COB, halting all aim functions on something that's "neutral", but that just seems like a bug to me- first the default of "neutral" being "shoot at me", then "neutral" being "shoot at everybody who is not me"...
I guess I can send a value to COB, halting all aim functions on something that's "neutral", but that just seems like a bug to me- first the default of "neutral" being "shoot at me", then "neutral" being "shoot at everybody who is not me"...
Re: [Changed] Neutral units?
Double huh. AIs crash Spring when loaded onto a map with Neutral units 
