Home   Help Search Login Register  

Author Topic: Addaction  (Read 599 times)

0 Members and 1 Guest are viewing this topic.

TERA_Forrest

  • Guest
Addaction
« on: 30 May 2005, 20:27:48 »
My problem is that once the addaction takes place, you have the option of clicking on that action were ever you go.  this is what I've used...

Condition: this
On Activation: Intel=player addaction["Take Intel","intel1.sqs"]


I've read in a post that I need to put this into the condition, but I get errors from it.

Condition: player distance actionzone < 5
On Activation: Intel=player addaction["Take Intel","intel1.sqs"]

Just to clearify, I want the player to be able to click on the option only if he is within 5-3 feet from it.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Addaction
« Reply #1 on: 30 May 2005, 20:31:24 »
what errors do you get? what is 'actionzone' - is it an object, a unit, a trigger?

best way to do this is make a trigger 5 x 5, set to repeating, on activation -

Code: [Select]
intel=player addaction["Take Intel","intel1.sqs"]

on deactivation

Code: [Select]
player removeaction intel
place it where you want the player to go, and then group the trigger with the player to make it fire when the player is inside.
« Last Edit: 30 May 2005, 20:31:44 by bedges »

TERA_Forrest

  • Guest
Re:Addaction
« Reply #2 on: 30 May 2005, 20:48:13 »
I'm not really sure what the "actionzone" is, I just read that in a post to figure out how to use the addaction command.  The problem is that when the player goes into the trigger then the option for "take Intel" stays with him if he does not click it.  He can walk away and still have the action availible if he does not click on it.  Everything works fine if he clicks on it.

The thing I'm worried about is that this will be a coop, and if somone is bumbling around setting off the triggers then he maybe the only one to be able to click the options.

In this mission what is happening is that the player has to meet up with a resistance leader to get intel.  The leader then tells the player that he can have certain men join his group to help if he wants.  So I used the addaction command to "ask to join" which works out fine but I noticed that if I go running past some of the men that I'll get all the options.  I want it so that if others want to have some AI with them they will be able to.

I've set them in pairs of men and there's several groups around the camp.  I've used this in a sqs file.

[r5,r6] join player

player RemoveAction join3
exit


one question on this, will the command "player" become the person who triggers the trigger or will this not work in multi player?

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Addaction
« Reply #3 on: 30 May 2005, 20:55:11 »
yep, you're on the right track - the main thing is the removal of the action in the deactivation field of the trigger. that way if the player scoots out of the trigger area without clicking, the action is removed.

your script is also fine - if the player clicks the action inside the trigger the action is removed also. i would go one step further by naming your triggers, and in the joining script, use the deletevehicle command on the trigger so that once it's used, it disappears.

as for the multiplayer question, i have no idea. once you solve this problem, maybe head over to the multiplayer board and ask - make sure it's a separate question though, so as to avoid the Double-Post Wrath ;)

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Addaction
« Reply #4 on: 30 May 2005, 20:55:56 »
Add the action to the object in question.    It will then appear in the action menu of whoever gets close enough.    When the action is used, the first thing the script does is remove the action from the object so nobody else can use it.

And I think bedges is right - get this working in SP and make sure you fully understand addAction, then if needs be post a seperate question on the MP board to get the MP aspect of it sorted out.    
« Last Edit: 30 May 2005, 20:57:26 by macguba »
Plenty of reviewed ArmA missions for you to play

TERA_Forrest

  • Guest
Re:Addaction
« Reply #5 on: 31 May 2005, 03:28:30 »
I just tested it out and it works great! thanks alot guys, I was racking my brain on this one.  I'll test it in multi to see if it has any problems and post here for anyone looking for the answer.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Addaction
« Reply #6 on: 31 May 2005, 05:33:38 »
Just to give you a heads-up in MP:

The action will only be visible on the client where it was added. If you want all players to be able to see the action, then run the line from init.sqs or some other script that will be run on all computers.

When a player uses the action, the script will only be run on that player's computer.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

TERA_Forrest

  • Guest
Re:Addaction
« Reply #7 on: 11 Jun 2005, 22:36:59 »
Thanks for the info General Barron, ;)

Yup, didn't work well in MP, er... not at all.  So how would I go about running the "addaction" line in the init.sqs file?  I tried making a seperate sqs file for each action but I think some of the commands I used will not work in MP.

One of the options was for "intel", which triggers some global chat dialog and is suppose to make an empty marker visable.  Works out fine in single but obviously not MP. (the dialog doesn't work, only the player that clicks it sees it)

As for another "addaction", I placed several resistance soldiers around the camp, after getting the intel, the contact tells the players that they can ask some resi's to join them if they want thier help.  I used this in a sqs file for that.

[r1,r2] join player

player RemoveAction join1
deletevehicle tjoin1
exit


The soldiers tend to join only one player in the coop reguardless of who clicks the action.  Also, when any of the players triggers the "addaction" it shows up for everyone reguardless of position on the map.