Home   Help Search Login Register  

Author Topic: attaching vehicles, adding proximity  (Read 1583 times)

0 Members and 1 Guest are viewing this topic.

Offline Major Draper

  • Members
  • *
  • Whoooooaaa!!!! to much in formation for me brain
attaching vehicles, adding proximity
« on: 31 May 2005, 15:31:20 »
Im am adapting the attaching vehicles script, in editors depot, to be activated by a guy on the ground by activating it in an action, so far it works. the only problem is that i can be any where and hit the action and it attaches on the chopper.

How can i make it not attach if the chopper is not hovering above it?

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:attaching vehicles, adding proximity
« Reply #1 on: 31 May 2005, 16:09:59 »
hmmm... this is only a hunch, but try a trigger, doesn't have to have any size, but set it to repeating. in the 'condition' field put

Code: [Select]
not (player distance chopper_name <5)
and in the 'on activation' field put

Code: [Select]
player removeaction action_name
that assumes you've added the action using

Code: [Select]
action_name = player addaction ["This is an action","action_script.sqs"]


alternatively, at the top of your vehicle attach script, put

Code: [Select]
?not (player distance chopper_name <5):hint "The chopper isn't close enough";exit

like i say, just a hunch ;)
« Last Edit: 31 May 2005, 16:12:22 by bedges »

Offline Major Draper

  • Members
  • *
  • Whoooooaaa!!!! to much in formation for me brain
Re:attaching vehicles, adding proximity
« Reply #2 on: 01 Jun 2005, 00:01:46 »
Going off sugestion 4 i added this, this is what the add action leads to to activate script

?not ("M113a" distance aCarrier <5):hint "The chopper isn't close enough";exit

[aCarrier,M113a] exec "attachvech/1.sqs"

exit

then goes to attach vech

_carrier   = _this select 0
_cargo      = _this select 1

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 - 5]
_cargo setDir (getDir _carrier)

~.01

? (!endCargoSession) : goto "nochmal"

exit

i changed the player to the name of the vech, since thats what i want to have a certain distance from each other.

However in that line i get an error...    "aCarrier <|#| 5):hint"

What im trying to do is not have he person in the chopper load it but a man on the ground hits the action to attach it to the vehicle (Multiplayer, srry probably should have put it in there).
« Last Edit: 01 Jun 2005, 00:03:26 by Major Draper »

Offline Major Draper

  • Members
  • *
  • Whoooooaaa!!!! to much in formation for me brain
Re:attaching vehicles, adding proximity
« Reply #3 on: 02 Jun 2005, 00:10:46 »
Ok i think i figured a way to do it but i need to know how to get a script to switch in this...

1?not ("M113a" distance aCarrier <5):hint "The chopper isn't close enough";

2[aCarrier,M113a] exec "attachvech/1.sqs"

exit

If the chopper is withen 5 meters away then it goes to the number 2 wher the script works but if its not true then it goes to exit and not the execution

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:attaching vehicles, adding proximity
« Reply #4 on: 02 Jun 2005, 00:15:44 »
Try this one:

?!("M113a" distance aCarrier <5): goto "exit"

[aCarrier,M113a] exec "attachvech/1.sqs"
exit

#exit
hint "The chopper isn't close enough"
exit

Edit: Are you allowed to have a '/' in the script name?
Or should it be a '\'?


Planck
« Last Edit: 02 Jun 2005, 00:17:56 by Planck »
I know a little about a lot, and a lot about a little.

Offline Major Draper

  • Members
  • *
  • Whoooooaaa!!!! to much in formation for me brain
Re:attaching vehicles, adding proximity
« Reply #5 on: 02 Jun 2005, 00:28:04 »
woot never mind i did it, case closed.... i guess i can do this stuff