Jump to content
Sign in to follow this  
Ravendark

Airfield / pad /strip DOCKING states?

Recommended Posts

I was thinking (someday)on adding a helipad to my mod's NOD'ish side....instead of having the aircraft deploy landing gear like i plan for my GDI'sh side iwanted to have the NODlike helipad deploy docking clamps when the aircraft lands.

I was wondering if i could use any of the dock modelconditions for that.

 

like

 

<xs:enumeration value="DOCKING" />
  <xs:enumeration value="DOCKING_BEGINNING" />
<xs:enumeration value="DOCKING_ACTIVE" />
 <xs:enumeration value="DOCKING_ENDING" />
 

 

Would that work for the current parkingspace logic in the game or does that only work for refinery and PAC ?

 

Second part: (maybe more obvious)

 

RA3.....uses basicly the same code for their airbases...but when th aircraft fly off th doors closes again...if i simulate the door closing mechanics with docking clambs retracting on liftoff and extending on landing...that could work.

 

Is that done through seting

 

KeepsParkingSpaceWhenAirborne="false"
 

in jetai?

 

It would be nice to have a idea on how i could get this to work/look before i start modeling.

 

 

Share this post


Link to post

Have you tried the General2 mod made by our team? You can download a beta test version from moddb, and you can find the APA fighter and airfield already make your thought come true.

 

I can't tell you too much, but it's just like ZH, no matter the w3x model or the function code.

Share this post


Link to post

im guessing they just use the still existing parkingspace code and use the door_open/close coding to mimic the hanger doors opening and closing?

iirc the red alert 3 coding was identical to that...they justed used the Jetai's parkingspace behaviro to open close the doors.

Share this post


Link to post

RA3.....uses basically the same code for their airbases...but when the aircraft fly off the doors closes again...if I simulate the door closing mechanics with docking clamps retracting on lift-off and extending on landing...that could work.

 

Is that done through setting

 

KeepsParkingSpaceWhenAirborne="false"
 

in jetai?

 

It would be nice to have a idea on how i could get this to work/look before I start modelling.

You can test the 'KeepsParkingSpaceWhenAirborne' really quickly using existing airfields.

 

I believe it works like you would expect, but the issue is that once the aircraft has taken off it will free up a slot in that particular airfields aircraft count (I do not know if this matters).

Share this post


Link to post

ye it works like expected.

 

I wouldnt mind that little downside because i had this idea of having the aircraft be buildable like they were in tiberium dawn...they fly in from ofscreen and land near the helipad..or on it if empty.

 

Things to achieve would be:

 

Remove build queue/button from helipad onto radar/com center but give aircraft game dependancy of a helipad before you can build them from the comcenter. So you will need comcenter and a minimum of 1 helipad before you can build aircraft. (i dont want each individual helipad to be able to have a buildqueue.specialy if you can spam aircraft after they lift off from their parkingspace this way.)

 

the trivky part(maybe):

thinking outloud here...

 

Build a dummy object from the comcenter...have that dummy object trigger a reinforcement specialpower like the shadowteam drop/fly in...try to get the CREATE_AT_EDGE_NEAR_SECONDARY_TARGET to work and use that to have the real aircraft fly towards the helipads.

Thinking amongst the lines of Oncreate for the dummy..do specialpower..trigger the aircraft reinforcemment ocl..near helipad objects?

 

that could simulate a old school like orca build queue effect?

 

And if i ever get my fuel thing system to work...you could build extra aicraft in a pinch but you have to keep their fuel/ammo in account or loose them when they go bingo fuel without extra helipads

Share this post


Link to post

If you don't want a random Heli pad give them a SP which gives them a status which says "I'm Primary!". Then when you build the aircraft just spawn a dummy as you said. Use LUA to message a Helipad, let it check back in with the dummy containing a message if it's available (and primary if you want that), If so message back to spawn the real aircraft and immediately after delete the dummy (in the same function where it sends the spawn message so it doesn't spawn multiple).

Share this post


Link to post

If you don't want a random Heli pad give them a SP which gives them a status which says "I'm Primary!". Then when you build the aircraft just spawn a dummy as you said. Use LUA to message a Helipad, let it check back in with the dummy containing a message if it's available (and primary if you want that), If so message back to spawn the real aircraft and immediately after delete the dummy (in the same function where it sends the spawn message so it doesn't spawn multiple).

*In his best Jim Raynor expression* :

Darlin'....you're a beautifull mind but you might have to offer a little help to simple folk like me.

 

Maybe the easier part first:

How would you trigger the helipad to spawn a aircraft?

Through the SpawnBehavior module?...would you trigger this through a upgrade? Or can you trigger the module with a ActivatemoduleSpecialpower(this prob only works for SP modules)?

 

Having 2 objects communicate through Lua.....

Are you refering to the ObjectBroadcastEventToUnits to achieve that?

Share this post


Link to post

okay basically like this:

<Events>
  <!-- ... -->
  <ScriptedEvent Name="CanBuildAircraft" />
  <ScriptedEvent Name="YesWeCan" />
</Events>
<EventList Name="DummyFunctions">
  <EventHandler EventName="OnCreated" ScriptFunctionName="OnDummyCreated" DebugSingleStep="false" />
  <EventHAndler EventName="YesWeCan" ScriptFunctionName=OnDummyYesWeCanEventReceived" DebugSingleStep="false" />
</EventList>

<EventList Name="AirfieldFunctions">
  <EventHandler EventName="CanBuildAircraft" ScriptFunctionName="OnAirfieldCanBuildAircraftEventReceived" DebugSingleStep="false" />
</EventList>
function OnDummyCreated(self)
  ObjectBroadcastEventToAllies(self, "CanBuildAircraft", 99999)
end

function OnAirfieldCanBuildAircraftEventReceived(self, other)
  ObjectDispatchEvent(self, other, "YesWeCan")
-- Probably either
-- ObjectDispatchEvent(self, message, other)
-- or
-- ObjectDispatchEvent(self, other, message)
  end
end

function OnDummyYesWeCanEventReceived(self, other)
  ObjectDoSpecialPower(other, "SpawnMyAircraftSpecialPower")
  ExecuteAction("NAMED_DELETE", self)
end
Just let SpawnMyAircraftSpecialPower be used in a OCLSpecialPower in the airfield.

 

If it doesn't work on the ObjectDispatchEvent step just use ObjectBroadcastEventToAllies again.

Edited by Lauren

Share this post


Link to post

Verry apreciated.

 

a question tho:

 

Atm i have it set up using using a simple <GameDependancy>Helipad</GameDependancy>

The result is: i can start producing aircraft from my comcenter if a helipad (still using the old airbase model with 4 slots) is build. I can build n number of craft it doesnt care if parking spots are taken or not. I dont mind that much tbh..works more or less rather well. Altho you have to either manually move the spanwd craft onto the helipads or have them empty their ammo and they will auto return to producer then...the RTB button is greyed out from the start before the aircraft didnt spawn on the parking spaces...aftr manualy or on empty return..they auto asing them selfs to that helipad/airbase and the return to producer/specialpower buttons work normaly.

 

With your method if i understand this right:

its more or less a 2way handshake...

1. dummy says: are you there helipad?

----------->

2. Helipad says yes i am dummy.

<-----------

and the dummy spawns the real aircraft then suicides to clean up.

 

this mimics the dependancy...but...if there are no helipads..does the dummy still get build(deduct funds)?

i would asume it does. where normal dependancy would prevent building the aicraft by greying it out?

 

quick thought:

 

Maybe create a extra dummy that spawns with the helipad..that dummy is actually the dependancy to build...the dummy lives while the helipad = doors_closed....but if the modelcondtion changes to doors_open the helipad broadcasts(in a verry small radius so it only hits its own dummy) a named_delete command to the dummy..the dummy dies and comcenter looses its dependancy to build aircraft. if modelcondition changes to doors_closed...the airfield spawns one ofthose depend dummies again(best way to spawn? do specialpower +ocl?), and the comcenter can build again. if the helipad gets destroyed it fires a deadweapon that kills the depend dummy also in a small radius to not effect other helipad dummies.

 

And instead of doing the handshake between comcenter and dummy, you do the handshake between comcenter and depend dummy. that would/should grey out the build button when all helipads are taken (doors_open)?

Share this post


Link to post

You can always use something like

if ObjectTestModelCondition(self, "MY_MODEL_CONDITION") then
  ObjectDispatchEvent(self, other, "YesWeCan")
end
or
if ObjectTestObjectStatus(self, "MY_OBJECT_STATUS") then
  ObjectDispatchEvent(self, other, "YesWeCan")
end
And no, the handshake is done after the build. Usual build rules apply.

Maybe add a timeout via LifetimeUpdate and trigger a refund or spawn.

 

Your dummy idea can also work.

 

Also as GameDependency also works with ModelCondition and ObjectStatus you can give the airfields an AttributeModifierAura update in which it radiates an AttributeModifier which gives the comm centers a specific condition/status.

Edited by Lauren

Share this post


Link to post

The aura idea might be interesting to try out..prob one of the simpler things to do even.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×