OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Serial Killer on 29 Jan 2005, 16:41:24

Title: Stopping vehicle, etc.
Post by: Serial Killer on 29 Jan 2005, 16:41:24
- Is it possible to make an empty vehicle and stop it? I mean, that vehicle wont move anywhere..

- Can I somehow remove the weapons from a helicopter?

- Stupid question.. What is stronghold? ;D
Title: Re:Stopping vehicle, etc.
Post by: macguba on 29 Jan 2005, 16:50:24
1.   Yes, setFuel 0.    Depending on the vehicle, it is sometimes possible to use the damage slider to put the vehicle into a state where it is possible to get in, but the vehicle won't move.   Experiment.


2.   Dunno, try removeWeapon.   You can certainly take away the ammo with the slider or removeMagazines commands.


3.   A stronghold is a fort, castle, defended base or fortified position..... anything like that really, it's a very general term.    It can even be a large area:  "The last stronghold of the Resistance was the mountains in the north of Nogova."
Title: Re:Stopping vehicle, etc.
Post by: Serial Killer on 29 Jan 2005, 16:58:39
1.   Yes, setFuel 0.    Depending on the vehicle, it is sometimes possible to use the damage slider to put the vehicle into a state where it is possible to get in, but the vehicle won't move.   Experiment.

That vehicle is a ship and it moves, because the vehicle will explode with 3 laser quided bomb. I think that fuel setting 0 will not help me..
Title: Re:Stopping vehicle, etc.
Post by: macguba on 29 Jan 2005, 17:06:11
You want it to stay still when it blows up?      Use a script with a fast setPos loop.   Something like:-

#loop
ship1 setPos getPos ship1
~0.001
? endLoop : exit
goto "loop"

Not guaranteed.  Call the script just before the explosion.   Set the variable endLoop to true to make the loop end, just after the explosion.
Title: Re:Stopping vehicle, etc.
Post by: Serial Killer on 29 Jan 2005, 17:51:51
Hmm.. I still need some script or something, what removes the weapons from a helicopter. Can anyone help me?
Title: Re:Stopping vehicle, etc.
Post by: h- on 30 Jan 2005, 00:36:31
You can use removeAllWeapons (vehicle  this) in the choppers init field, but that only takes away all the ammo...

The actual weapons can't be removed...
Title: Re:Stopping vehicle, etc.
Post by: CopyrightPhilly on 30 Jan 2005, 10:10:02
ok here you go...

to stop the ship moving,
make the below into an sqs file.
Code: [Select]
_ship=_this select 0
_pos=getpos _ship
#loop
_ship setpos _pos
~0.01
goto "loop"
exit
useage:
in the ships init:
[this] exec "whateverunamedthefile.sqs"


remove all weapons from the chopper:
in the choppers init try:
Code: [Select]
removeallweapons this
Title: Re:Stopping vehicle, etc.
Post by: Serial Killer on 30 Jan 2005, 12:53:33
I made a script, what tells, how to remove the weapons from OH-58 ;)

Code: [Select]
this removeMagazines "ZuniLauncherOH";
this removeWeapon "ZuniLauncherOH";
this removeMagazines "LaserDesignatorOH";
this removeWeapon "LaserDesignatorOH"

One more question.. Can I remove Get In OH-58 gunner, Manual fire, etc. actions from OH-58 helicopter?
Title: Re:Stopping vehicle, etc.
Post by: bored_onion on 30 Jan 2005, 15:01:51
i may have made this up but i think there is a command called allowgetin

check the comref
Title: Re:Stopping vehicle, etc.
Post by: Mr.Peanut on 02 Feb 2005, 17:58:23
You could use a "getin" type eventhandler that ejects the player when he gets in gunners seat.


Heli's On Init:
Code: [Select]
this AddEventHandler ["GETIN",{If ((_this Select  1) == "GUNNER") Then {(_this Select 2) Action ["EJECT", _this Select 0]}}]
I don't know if this will work for a player changing from Driver to Gunner position.
Not 100% positive that syntax is correct...
Title: Re:Stopping vehicle, etc.
Post by: Serial Killer on 02 Feb 2005, 18:12:58
I removed allready the guns!! >:(

Code: [Select]
this removeMagazines "ZuniLauncherOH";
this removeWeapon "ZuniLauncherOH";
this removeMagazines "LaserDesignatorOH";
this removeWeapon "LaserDesignatorOH"