but its an enormous advancemecha wrote: ...Please do not think that this is complete by any means. I am posting this as a draft so that the more experienced coders out there can help me with the issues I have described above

VonGratz
Moderator: Moderators
Code: Select all
isfeature=0
Code: Select all
--pseudocode:
local gate = units.load(armgate,float3,team,something)
local gateisalive=1
--during update function call (once a second)
if unit1 == NULL then
gateisalive = 0
Code: Select all
if(!gameSetup->aiDlls[a].empty()){
if (gu->myPlayerNum == gs->Team (a)->leader)
globalAI->CreateGlobalAI(a,gameSetup->aiDlls[a].c_str()); }
.health = 0?mecha wrote:I have code sending units from each of the gates but cannot figure out how to test if the gate is dead. I assume a pointer to a unit loses its reference when it dies so this should work right?
Code: Select all
class_<CUnit, bases<CWorldObject>, CObject_pointer<CUnit> >("Unit")
.enum_("constants")
[
value("GIVEN", CUnit::ChangeGiven),
value("CAPTURED", CUnit::ChangeCaptured)
]
.def_readonly("id", &CUnit::id)
.def_readonly("health", &CUnit::health)
.property("transporter", &UnitGetTransporter)
.def_readonly("definition", &CUnit::unitDef)
.def("__tostring", &UnitToString)
.def_readonly("team", &CUnit::team)
.def("GiveCommand", &UnitGiveCommand)
.def("ChangeTeam", &CUnit::ChangeTeam)
.def("IsValid", &UnitPointerIsValid),
This code does what you want:I have code sending units from each of the gates but cannot figure out how to test if the gate is dead. I assume a pointer to a unit loses its reference when it dies so this should work right?
Code: Select all
self.zeus = units.Load("ARMZEUS", float3(400, 80, 300), 0, false)
if( self.zeus.IsValid(self.zeus) ) then
print( "zeus alive" )
else
print( "zeus dead" )
end
Is the same thing available for units?hughperkins wrote:Modified Spring to be able to dump features.
There is a missionbuilder.lua that goes with this. If you type ".savefeatures" you get output like:
--- cut here ---
features.Load("GeoVent", float3(1172.0, 48.8, 756.0), 1, false)
features.Load("GeoVent", float3(3044.0, 101.3, 644.0), 1, false)
features.Load("GeoVent", float3(2276.0, 39.6, 1796.0), 1, false)
features.Load("GeoVent", float3(2052.0, 54.5, 1828.0), 1, false)
features.Load("GeoVent", float3(1348.0, 42.3, 3108.0), 1, false)
features.Load("GeoVent", float3(3172.0, 59.1, 3316.0), 1, false)
--- cut here ---
(This is for SmallDivide)
Windows Spring build and this missionbuilder available on request.
Note that there's not actually any functionality for creating features yetbut that shouldnt be too hard to add.
Yes, this is available in base missionbuilder in spring release.Is the same thing available for units?