Home   Help Search Login Register  

Author Topic: a small script  (Read 1549 times)

0 Members and 1 Guest are viewing this topic.

Offline 456820

  • Contributing Member
  • **
Re:a small script
« Reply #15 on: 12 Jun 2005, 17:18:24 »
thanks alot it works with no errors but the set pos leaves it on the ground how do i setpos getpos set1 and still have the black hawk at the height it was at before the set pos ? then ill be donr perfect

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:a small script
« Reply #16 on: 12 Jun 2005, 17:32:42 »
Code: [Select]
_preheight = getpos uh60 select 2
uh60p setpos [getpos set1 select 0, getpos set1 select 1, _preheight]

Offline 456820

  • Contributing Member
  • **
Re:a small script
« Reply #17 on: 12 Jun 2005, 17:40:55 »
wouldnt that run in with

Code: [Select]
_height = getpos uh60 select 2
becuase its both select 2
i tried this anyway

Code: [Select]
#check2
_preheight = getpos uh60 select 2
_height = getpos uh60 select 2

? _height >=60 : uh60p setpos [getpos set1 select 0, getpos set1 select 1, _preheight]; uh60p action ["eject",uh60]
? _height <=30 : uh60 setpos getpos set1; goto "finish"
~1

and it didnt work the chopper stayed on the ground

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:a small script
« Reply #18 on: 12 Jun 2005, 17:57:11 »
at the moment, the script stays in #check anyways...

i'm not sure what it is you want this script to do.

Quote
i want it to check the height of the chopper and when it is around 30metres i want to setpos it to a game logic called set1

and you want it at the same height as it was before it was setpos'd.

Code: [Select]
#check2

_height = getpos uh60 select 2
? _height <=30 : uh60 setpos [getpos set1 select 0, getpos set1 select 1, _height] ; goto "finish"

~1
goto "check2"

will do that. what the ejecting is all about isn't clear...

Offline 456820

  • Contributing Member
  • **
Re:a small script
« Reply #19 on: 12 Jun 2005, 18:00:41 »
okay thanks ill try that and ill explain about the script
it basiccaly shows a shilkas gunners optics and fires at a black hawk then when the black hawks dammage is around 0.85 it stops firing the black hawk loses its fuel comes crashing down to earth and when the uh60' around 65m the pilot ejects then when the black hawk is around 30 metres it goes to the end of the script and just does a few things to make all other units attack and so on hope thats clear enough
anyway thanks ill have a go with that

Offline 456820

  • Contributing Member
  • **
Re:a small script
« Reply #20 on: 12 Jun 2005, 18:05:31 »
aha perfect works great. thanks alot but do you know how you have things like
if you call a m2machine gun 'M2' for instance you can use M2g to talk about the gunner what is it for a pilot becuase uh60p doesnt seem to work so he doesnt eject and just crahes

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:a small script
« Reply #21 on: 12 Jun 2005, 18:18:08 »
call him 'uh60d' - pilots are drivers ;)

Offline 456820

  • Contributing Member
  • **
Re:a small script
« Reply #22 on: 12 Jun 2005, 19:06:13 »
okay ive changed it slightly because the action eject wasnt working so i thought i would cam create a parachute an move the pilot in it to give the illusion that he bailed out but now the script just shows the chopper on the ground.
here are the scripts
script1 wich is what ive been working on

Code: [Select]
titlecut ["", "black in", 3]

shilka switchcamera "gunner"
shilka setpos getpos maybe_2
shilka dotarget uh60
shilka dofire uh60

#check
? (getdammage uh60 >= 0.80) : uh60 setfuel 0; goto "done"; shilka dofire objnull; shilka dotarget objnull
~0.01
goto "check"
#done
[] exec "camloop.sqs"

#check2
_height = getpos uh60 select 2

? _height <=80 : uh60 setpos [getpos set1 select 0, getpos set1 select 1, _height]; parachute = "parachuteWest" camCreate [0,0,80]; uh60d moveindriver parachute
? _height <=5: uh60 setpos [getpos set1 select 0, getpos set1 select 1, _height]; goto "finish"
uh60d setdammage 0
~0.01

goto "check2"

#finish
uh60 setpos getpos set1
uh60p setdamage 0
uh60 setdammage 0.99
;uh60p setpos getpos set_1
trig1 setpos getpos uh60d

[] exec "obj3.sqs"

player setcaptive false
titlecut ["", "white out", 1]
player switchcamera "INTERNAL"

shilkascript = true
~1
obj5 = true
titlecut ["", "black in", 1]
~1
player switchcamera "INTERNAL"
exit

script 2 wich is a cam follow script

Code: [Select]
_camera = "camera" camcreate [0,0,0]
titlecut [" ", "black in", 0.75]

#loop
_camera cameraeffect ["internal", "back"]
_camera camsettarget uh60
_camera camsetrelpos [2,10,1.5]
_camera camcommit 0
~0
? obj5 : goto "rest"
goto "loop"

#rest
_camera camsettarget uh60p
_camera camcommit 2
~2
titlecut [" ","BLACK OUT",0.75]
~0.75
_camera cameraeffect ["terminate", "back"]
camdestroy _camera
player switchcamera "internal"
titlecut [" ","BLACK in",0.75]
exit

if you can see any mistakes in either of these 2 scripts please can you either tell me or correct them