Home   Help Search Login Register  

Author Topic: Addaction Question again, sorry!  (Read 468 times)

0 Members and 1 Guest are viewing this topic.

fragsta

  • Guest
Addaction Question again, sorry!
« on: 07 May 2003, 23:09:10 »
I have a script in progress which has 2 men in it. The first man (player) starts with the action that he can throw the second man. Then, the other man will fly 20 feet in the air and then drop. But I have a problem with the line that executes the second index, #Throw. The problem is I don't know how to set out an addaction inside a script. If anyone knows what I mean, here is the script for you to figure out. Any suggestions?

Code: [Select]
; A script for a man to throw another man 20 feet in the air

; Get the unit that will be affected
_Unit = _this select 0
; Get the other unit that will be affected
_Unit2 = _this select 1
goto "addaction"

; Main loop
#addaction
_Unit addaction ["Throw", goto "Throw"]

#Throw
_Unit2 setpos [getpos this select 0, getpos this select 1,20]

exit

Thanx in advance!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Addaction Question again, sorry!
« Reply #1 on: 08 May 2003, 00:10:51 »
The problem is that the script that adds the action cannot be the one that is called when the action is used.   Therefore you need to have two scripts.

The first one sets everything up and adds the action to the player's action menu.

The second one is called when the action is used and does the actual throwing.


Plenty of reviewed ArmA missions for you to play

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:Addaction Question again, sorry!
« Reply #2 on: 08 May 2003, 01:00:25 »
Ya can add it to the INIT field of a character (or in a WP/Trigger) :thumbsup:


Like this :

jump = this addAction ["jump", "jump.sqs"]


 ;) Then just make a scroll named "jump.sqs" and throw it into the mission folder  :-*

PS:

 :o Remember to remove the action when used:

UnitName RemoveAction jump  8)


fragsta

  • Guest
Re:Addaction Question again, sorry!
« Reply #3 on: 08 May 2003, 08:27:52 »
Ok, I got that problem sorted, and now I have 2 scripts, throw1.sqs(the one you saw earlier) and throw.sqs. In the int field of the player, I put

Code: [Select]
[mutie1, victim1] exec "throw1.sqs"
But when I press the action that says "Throw" it throws me in the air, although I am mutie1.

Throw1.sqs:

Code: [Select]
; A script for a man to throw another man 20 feet in the air

; Get the unit that will be affected
_Unit = _this select 0
; Get the other unit that will be affected
_Unit2 = _this select 1
goto "addaction"

; Main loop
#addaction
_Unit addaction ["Throw","throw.sqs"]

exit

Throw.sqs:

Code: [Select]
_Unit = _this select 0
_Unit2 = _this select 1
goto "Throw"

#Throw
_Unit2 setpos [getpos this select 0, getpos this select 1,20]

exit
« Last Edit: 08 May 2003, 08:28:37 by fragsta »