Home   Help Search Login Register  

Author Topic: Attaching satchel to vehicle  (Read 759 times)

0 Members and 1 Guest are viewing this topic.

McFinnish

  • Guest
Attaching satchel to vehicle
« on: 31 Jul 2003, 10:25:25 »
What is the script to attach satchel to car in the start and make it blow in 45 seconds.  ;D   I'm making a mission where this car drives to russian holded Lipany, Nogova and kill as many of soldiers it can. 8)  :P

Skanderborgvej

  • Guest
Re:Attaching satchel to vehicle
« Reply #1 on: 31 Jul 2003, 13:28:43 »
There are some nice 'exploding vehicle' scripts in the ED.
(Feel free to find them  ;D)

GRTZ  ;) Vlaamse Leeuw

Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
Re:Attaching satchel to vehicle
« Reply #2 on: 01 Aug 2003, 01:47:40 »
OK you gotta love me for this i just finished it for you i hope its what you wont i have attached missions file to let you have a go and see how it works i simplified it for you alot form my finished version I'm working on for the Stargate mod OK hear goes

Attach bomb scripts x 3

First script

"Attach.sqs"
Code: [Select]
; scripted by wizzywig
_target = target
_pos = getpos _target
_x = _pos select 0
_y = _pos select 1
_z = _pos select 2

Bomb1="bomb" CamCreate [_x -1, _y +1, _z -1]
player removemagazine "pipebomb"
player addaction ["Timer 45 seconds","Timer.sqs"]
player addaction ["Detonate bomb","detonate.sqs"]
_target removeaction 0
Exit

Second script

"Timer.sqs"
Code: [Select]
; scripted by wizzywig
titletext["Timer set", "PLAIN DOWN"]
~0.5
titletext["45", "PLAIN DOWN"]
~1
titletext["44", "PLAIN DOWN"]
~1
titletext["43", "PLAIN DOWN"]
~1
titletext["42", "PLAIN DOWN"]
~1
titletext["41", "PLAIN DOWN"]
~1
titletext["40", "PLAIN DOWN"]
~1
titletext["39", "PLAIN DOWN"]
~1
titletext["38", "PLAIN DOWN"]
~1
titletext["37", "PLAIN DOWN"]
~1
titletext["36", "PLAIN DOWN"]
~1
titletext["35", "PLAIN DOWN"]
~1
titletext["34", "PLAIN DOWN"]
~1
titletext["33", "PLAIN DOWN"]
~1
titletext["32", "PLAIN DOWN"]
~1
titletext["31", "PLAIN DOWN"]
~1
titletext["30", "PLAIN DOWN"]
~1
titletext["29", "PLAIN DOWN"]
~1
titletext["28", "PLAIN DOWN"]
~1
titletext["27", "PLAIN DOWN"]
~1
titletext["26", "PLAIN DOWN"]
~1
titletext["25", "PLAIN DOWN"]
~1
titletext["24", "PLAIN DOWN"]
~1
titletext["23", "PLAIN DOWN"]
~1
titletext["22", "PLAIN DOWN"]
~1
titletext["21", "PLAIN DOWN"]
~1
titletext["20", "PLAIN DOWN"]
~1
titletext["19", "PLAIN DOWN"]
~1
titletext["18", "PLAIN DOWN"]
~1
titletext["17", "PLAIN DOWN"]
~1
titletext["16", "PLAIN DOWN"]
~1
titletext["15", "PLAIN DOWN"]
~1
titletext["14", "PLAIN DOWN"]
~1
titletext["13", "PLAIN DOWN"]
~1
titletext["12", "PLAIN DOWN"]
~1
titletext["11", "PLAIN DOWN"]
~1
titletext["10", "PLAIN DOWN"]
~1
titletext["9", "PLAIN DOWN"]
~1
titletext["8", "PLAIN DOWN"]
~1
titletext["7", "PLAIN DOWN"]
~1
titletext["6", "PLAIN DOWN"]
~1
titletext["5", "PLAIN DOWN"]
~1
titletext["4", "PLAIN DOWN"]
~1
titletext["3", "PLAIN DOWN"]
~1
titletext["2", "PLAIN DOWN"]
~1
titletext["1", "PLAIN DOWN"]

this exec "detonate.sqs"

Thread script

"detonate.sqs"
Code: [Select]
; scripted by wizzywig
_target = target
bomb1 setpos [(getpos _target select 0),(getpos _target select 1),-0.1]
~0.001
bomb1 setdammage 1
player removeaction 0
player removeaction 1
player removeaction 2
player removeaction 3
player removeaction 4

exit

now all you do is name your target:
unit/car/chopper/any thing target and in insert in the

init.sqs
Code: [Select]
target addaction [""Attach bomb"",""Attach.sqs""]
any enjoy
remember if you improve this please post or pm me with improvements so i can add them to new script thank you


wizzywig
« Last Edit: 01 Aug 2003, 01:50:19 by wizzywig »

deaddog

  • Guest
Re:Attaching satchel to vehicle
« Reply #3 on: 01 Aug 2003, 06:28:03 »
I think you need to learn the joy of looping  :)

You're entire timer script can be replaced with this:

_t=45

#loop
titletext[format ["%1",_t],"PLAIN DOWN"]
~1
_t=_t-1
?_t>0:goto "loop"

[] exec "detonate.sqs"

exit

McFinnish

  • Guest
Re:Attaching satchel to vehicle
« Reply #4 on: 01 Aug 2003, 09:11:34 »
Thanks everyone. ;D D**N this is a great place. Somebody just writing those kind of text's for somebody he doesen't know. AND yes, I LOVE YOU Wiggywig!!!  :D

Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
Re:Attaching satchel to vehicle
« Reply #5 on: 01 Aug 2003, 12:37:44 »
thanks for the timer i was trying to get that working but for got so i just used one of my old scripts

Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
Re:Attaching satchel to vehicle
« Reply #6 on: 01 Aug 2003, 12:40:26 »
ill keeep you posted if i improve the script i wont it to detect the unit/car that the attach script is execed on how do i

Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
Re:Attaching satchel to vehicle
« Reply #7 on: 01 Aug 2003, 13:39:16 »
ok i updated the script

Timer.sqs
Code: [Select]
_t=45

#loop
titletext[format ["%1",_t],"PLAIN DOWN"]
~1
_t=_t-1
?_t>0:goto "loop"

[] exec "detonate.sqs"
titletext["","PLAIN DOWN"]
exit

now i need to know how to get the cam creat to detect the hight of the unit and place bomb at that hight how do i do that??

Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
Re:Attaching satchel to vehicle
« Reply #8 on: 01 Aug 2003, 13:57:04 »
fixed
detonate.sqs

Code: [Select]
; scripted by wizzywig
_target = target
_pos = getpos _target
_x = _pos select 0
_y = _pos select 1
_z = _pos select 2

_carrier   = target
_cargo      = bomb1

endCargoSession = false
goto debug

#nochmal

_x = (getPos _carrier) select 0
_y = (getPos _carrier) select 1
_z = (getPos _carrier) select 2

_cargo setPos [_x, _y, _z - 0.1]
_cargo setDir (getDir _carrier)
~.01
? (!endCargoSession) : goto "detonate"

#detonate
?(!Alive _target ):goto "exit"
~0.001
bomb1 setdammage 1
player removeaction 0
player removeaction 1
player removeaction 2
player removeaction 3
player removeaction 4

exit


dont know why i didn't think of this before

Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
Re:Attaching satchel to vehicle
« Reply #9 on: 01 Aug 2003, 14:00:23 »
simple demo

Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
Re:Attaching satchel to vehicle
« Reply #10 on: 01 Aug 2003, 14:17:14 »
one problem with script and i hope you guys can help

OK with the timer how do i stop it counting after the target is dead with detonate

Offline WizzyWig

  • Members
  • *
  • Mod Maker
    • Oblivion Promotions
Re:Attaching satchel to vehicle
« Reply #11 on: 01 Aug 2003, 20:36:34 »
updated!!!