Home   Help Search Login Register  

Author Topic: Harrier respawn/rearm problem  (Read 2707 times)

0 Members and 1 Guest are viewing this topic.

Offline IGWedge

  • Members
  • *
  • Internal Coordinator @ www.ic-arma.com
    • International Conflict Armed Assault
Harrier respawn/rearm problem
« on: 03 Mar 2007, 09:04:19 »
Hi

Just wondering if anybody can help me out.

I am using a script for rearming and refuelling some harriers and it works perfectly. Jet moves into allocated area rearms refuels and then is able to fly away.

The only problem is when the jet is killed or respawns it wont work any more.I am using Karrillions VR script. Is there something i need to do in order to give the jet the same name when it respawns so that it triggers the trigger repeatedly. I hope this explains.

Any help would be great

Thanks Guys

Wedge

Offline FreeBird

  • Members
  • *
Re: Harrier respawn/rearm problem
« Reply #1 on: 03 Mar 2007, 21:21:58 »
Ello,

Have not tried it,but take a look at setVehicleId command.

Also converting OFP scripts is not always the best solution as there are many new commands for ArmA.

Especially respawnVehicle command,it makes it possible to give a different respawntime for every vehicle.

Call [This,Birth,School,Work,Death]execVM "Storyofmylife.sqf"
(_this select 1)ObjStatus "DONE";(_this select 2)ObjStatus "DONE";(_this select 3)ObjStatus "ACTIVE";(_this select 4)ObjStatus "HIDDEN";
if not((_this select 0) IsKindOf "Human")ExitWith{PlayMusic"Goodbye Cruel World"}

Offline norrin

  • Tutorial Writer
  • **
Re: Harrier respawn/rearm problem
« Reply #2 on: 04 Mar 2007, 09:26:02 »
Hi wedge,

Let me preface this by saying that most of what I'm about to describe was done in ver 1.02 but m8 I've had a fair bit of experience with the sort of thing you are talking about. 

I found KaRRiLLioN's script worked perfectly with playable AI units but I ran into some problems when I used it with vehicles crewed by non-playable AI - essentially any units that died inside the vehicle would still be counted as crew and the vehicle wouldn't respawn. So the first thing I did was to rewrite his script - you can find a copy of my revised vrs_AI.sqf script here.

The next problem is that KaRRs, my variation and the respawnVehicle cmd (as far as I can remember) all spawn an empty uncrewed vehicle which is great for playable units but not so good for scripted AI.

I also played around with the setVehicleId but didn't find it much help as the vehicle respawns uncrewed regardless of whether you rename the vehicle or not.  So I ended up writing some quite complex scripts that once the vehicle respawned it would be recrewed with non-playable AI and then move through a series of waypoints which you can find here

So to cut a long story short we should be able to set up the sort of thing you're talking about but its going to take a bit of mucking around.


Offline FreeBird

  • Members
  • *
Re: Harrier respawn/rearm problem
« Reply #3 on: 04 Mar 2007, 11:57:09 »
Another one to test:setVehicleVarName

Sets the name of the variable which contains a reference to this object. It is necessary in MP to change the variable content after a respawn.
Call [This,Birth,School,Work,Death]execVM "Storyofmylife.sqf"
(_this select 1)ObjStatus "DONE";(_this select 2)ObjStatus "DONE";(_this select 3)ObjStatus "ACTIVE";(_this select 4)ObjStatus "HIDDEN";
if not((_this select 0) IsKindOf "Human")ExitWith{PlayMusic"Goodbye Cruel World"}

Offline IGWedge

  • Members
  • *
  • Internal Coordinator @ www.ic-arma.com
    • International Conflict Armed Assault
Re: Harrier respawn/rearm problem
« Reply #4 on: 04 Mar 2007, 18:11:35 »
Actually guys ..... lol

This wasnt what i was talking about..... so i will explain it in a different way.

Bearing in mind this will be for a large CTI like mission......
My goal was to set up a system where a Human players who play as pilots experianced a more realistic style of gameplay. IE only pilots can fly...this was no problem.
Next i wanted to set up a system where it would be more in the interests of the Human pilot to land the Jet without crashing. Once this was acheived the pilot would taxi to rearm/refuel point.

The mission starts with jets stripped of ammo and only minimal fuel. they then have to taxi to fuel and get armed up.

The script im using runs like this :-

Jet enters trigger
jet setfuel 0 (the reason i done this was to stop people speeding through the trigger without having to stop)
Jet reloads
Jet fixes any damage
jet refuels
jet is now ready to fly and can once again move.

This works beautifully. Now this is where the problem starts.....

If the human player crashes the jet Karrillions VRS kicks in and the jet respawns. But it respawns with full fuel and ammo (Problem no1)

Now for the major problem... once the vehicle has respawned it no longer activates the rearm/refuel trigger. I presume this is because it respawns as a fresh vehicle and does not bear the same name as the original Jet.  Is it possible to assign this name to the jet everytime it spawns??

I hope this has made it more clear

Thanks

Wedge

Offline norrin

  • Tutorial Writer
  • **
Re: Harrier respawn/rearm problem
« Reply #5 on: 04 Mar 2007, 21:51:17 »
Ok wedge now I understand :)

The first thing is you'll need to add a couple of lines to KaRRiLLioN's code after the create vehicle line using the setFuel and removeMagazines commands.  For the second part you can use the nearestObject cmd and a generic name for the harrier such as "AV8B" or maybe even "plane" in your rearm script and then it will rearm any harrier.  Let me know if you have any probs and if you  like I can bash something out tonight, shouldn't take long.

Offline IGWedge

  • Members
  • *
  • Internal Coordinator @ www.ic-arma.com
    • International Conflict Armed Assault
Re: Harrier respawn/rearm problem
« Reply #6 on: 05 Mar 2007, 09:43:17 »
awesome mate  thankyou


Offline norrin

  • Tutorial Writer
  • **
Re: Harrier respawn/rearm problem
« Reply #7 on: 05 Mar 2007, 11:38:03 »
Wedge you can download a zip file with an example mission and everything you need from here

Just unzip it into you're my Documents/ArmA/MPMissions directory.

I've written it so that the harrier spawns low on fuel and without bombs.  Just pull up alongside the tent in front of you and after 5 seconds your plane should refuel and reload with an accompanying message.

Try parking the Hummer next to the tent but you'll find that the reload trigger is only activated by the harrier.

You'll also find when the aircraft respawns that its low on fuel and has no bombs so just park it next to the tent again and it will reload.

I've deliberately set the respawn time for both players and aircraft low so that you don't have to wait long for testing.  You could also lengthen the time it takes to reload and refuel by making the "timeout" longer in the trigger.

It also seems to take a few seconds for the option to board the respawned harrier to appear, don't worry though just keep trying and after 20 sec or so it'll let you get in as the pilot. 
« Last Edit: 05 Mar 2007, 13:10:05 by norrin »