Home   Help Search Login Register  

Author Topic: Scripting  (Read 607 times)

0 Members and 1 Guest are viewing this topic.

Dubieman

  • Guest
Scripting
« on: 05 Feb 2004, 00:07:01 »
Ok i want this script to create a grenade under or at the car position when it reaches 20 speed to disable it and not kill it, the script here is not working really. I named the car "vehicle" and the guy "unit".

Code: [Select]
; a small carbomb script
_unit = _this select 0
_vehicle = _this select 1


#update

? (_unit in _vehicle) && (speed _vehicle >20) : "goto blowup"

~2
goto "update"

#blowup

~5

_vehicle = "grenade" camcreate getpos _vehicle
exit

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Scripting
« Reply #1 on: 05 Feb 2004, 00:28:21 »
Quote
not working really

So what's the problem?

You've got _vehicle twice I see.   If the grenade is too powerful try camcreating it a few metres underground.
Plenty of reviewed ArmA missions for you to play

Kaliyuga

  • Guest
Re:Scripting
« Reply #2 on: 05 Feb 2004, 00:30:45 »
_vehicle = "grenade" camcreate getpos _vehicle

yeah that looks like the problem to me as well....   you've already defined _vehicle as the car and now you're trying to define the grenade as _vehicle as well...  :P

_bomb = "grenade" camcreate getpos _vehicle

:toocool:

Dubieman

  • Guest
Re:Scripting
« Reply #3 on: 05 Feb 2004, 00:44:10 »
Ahh yeah I kindof had a brain freeze there.... >:(
Just trying to get more scripting practice...

By not working I meant it is not working at all nothing blows up, but should work now. :)

Unnamed

  • Guest
Re:Scripting
« Reply #4 on: 05 Feb 2004, 00:49:29 »
Another possible problem would be:

Code: [Select]
? (_unit in _vehicle) && (speed _vehicle >20) : "goto blowup"
It should be:

Code: [Select]
? (_unit in (Crew _vehicle)) && (speed _vehicle >20) : "goto blowup"
« Last Edit: 05 Feb 2004, 00:49:53 by Unnamed »

Offline Skumball

  • Members
  • *
Re:Scripting
« Reply #5 on: 06 Feb 2004, 14:43:48 »
Here you go:

; a small carbomb script
_unit = _this select 0
_vehicle = _this select 1

#update
? (_unit in _vehicle) && ((speed _vehicle) > 20) : goto "blowup"
~2
goto "update"

#blowup
~5
"grenade" camcreate (getpos _vehicle)

exit
« Last Edit: 06 Feb 2004, 15:00:40 by Skumball »