Home   Help Search Login Register  

Author Topic: SOLVED: Help, Selective Vehicle Respawn/Adding Sound to Arty Firing..  (Read 1287 times)

0 Members and 1 Guest are viewing this topic.

Offline benxcore

  • Members
  • *
Hey, I posted on BI forums, but to no avail I've not recieved a response. This site from what I've read is more scripting wise.

And yes, I've searched, here and BI forums and I'm unable to find exactly what I'm looking for. So Here goes.

I'm using Several Scripts in a Small Scale Co-op Capture the Island Mission. I had several neat scripts running that many of you awesome scripters made, nbs spawning, McMurrays Artillery, and Vehicle Respawner by Doolittle.

Respawn Vehicles = Questioned
Artillery
NBS Spawning & Triggering ObjComp when only 5 Units Left = Solved [finally found what I was looking for]

I however want to customize all these scripts to make my mission function as well, how I want it.

I'll start with the vehicle spawn.

Code: [Select]
;By Doolittle
_vlogic = []
_vtime = []
_count = count vehicles
_delay = 30

_i = 0
#load
_v = vehicles select _i
_vl = "Logic" createVehicle getPos _v
_vl setDir getDir _v
_vlogic = _vlogic + [_vl]
_vtime = _vtime + [0]
_i = _i + 1
?_i < _count : goto "load"

#init
_i = 0
~3
#alive
_v = vehicles select _i
_vl = _vlogic select _i
?alive _v and _vl distance _v < 100 : goto "continue"
?alive _v and count crew _v != 0 : _vtime set [_i, 0]; goto "continue"
_vt = _vtime select _i
?_vt != 0 and _vt < _time : goto "notalive"
?_vt == 0 : _vtime set [_i, _time + _delay]
#continue
_i = _i + 1
?_i < _count : goto "alive"
goto "init"

#notalive
_vtype = typeOf _v
deleteVehicle _v
~1
_v = _vtype createVehicle getPos _vl
_v setDir getDir _vl
vehicles set [_i, _v]
_vtime set [_i, 0]

publicObject = _v
publicVariable "publicObject"
goto "continue"
What I want to know how to do, is to make my Vehicle Respawn only if It has been damaged beyond flying capabilities, because if it is still in the field in service, I don't want my teammates to hop out of the vehicle, only to be left on the main island with no transportation.

The script I just posted respawns about 1 minute after its blown up, and if its still serviced and abandonded, it'll disapear and respawn in about 20 seconds.

I also want to have the ability to call in artillery missions, via triggers I've set around random static RT. I'm using McMurrays script, and I have 2 Radio Operators, both can call in an operation via trigger when they are a RT. However. To avoid making the mission cake, and just having people call in Fire Mission after Fire Mission. I want to allow 1 Fire Mission Per Operator Every 30 Minutes. What would I have to do to aquire this effect?
« Last Edit: 23 Jun 2007, 04:09:56 by benxcore »

Offline Trapper

  • Honoured Contributor
  • ***
  • I'm a llama!
Try to replace this line
Code: [Select]
?alive _v and count crew _v != 0 : _vtime set [_i, 0]; goto "continue"with
Code: [Select]
?(alive _v) and (canmove _v) and (fuel _v > 0.1) : _vtime set [_i, 0]; goto "continue"
My intention is to check if the vehicle is able to move and has more than 10% fuel left before it'll be moved back to base. However I don't know how aircrafts and canmove work together. And I'm still rusty in scripting.
EDIT: One problem will be that the respawn timer is already activated when someone continues his ride below 10% fuel...
« Last Edit: 21 Jun 2007, 13:14:35 by Trapper »

Offline benxcore

  • Members
  • *
So if I'm flying along with >.1 fuel, I'll be either tranported back to base, or left floating into the ground? I'm not hot with scripting, at all thats why I asked for your guys's help. Is there a health command like health_V  where you could detect fuel and armor, or perhaps fuel, health, and the canmove. I'm not sure how the canmove function would work.
« Last Edit: 21 Jun 2007, 18:14:42 by benxcore »

Offline Cheetah

  • Former Staff
  • ****
canMove
fuel
damage

Does this help?
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline benxcore

  • Members
  • *
@Trapper&Cheetah.
I've got it. I'm using an older style script. From what I've figured out. I've managed to scrounge around for another 2 hours tonight and find an updated one with a better readme, so I'm able to understand.

I still have a questions about setting limits on calling scripts.

Thanks for the help!
« Last Edit: 22 Jun 2007, 10:11:50 by benxcore »