mugaben 10 Posted February 24, 2010 I'm not into all the scripting stuff, and I've searched everywhere, and tried everything now. :mad: Everything but the addaction issues is sorted out. (bombs, triggers and so on) .My team needs to disarm a bomb. .The actions must work for everyone, online. .There will be 5 actions, one that does nothing and works as a headline, and 4 choices. 1 of the 4 choises will be correct. The other three is wrong. The team can only choose one of 4 choises, and when chosen the 5 actions must disapear. My scripting skills only leads me to making a object, calling it "trigger" and adding this to its init: trigger addaction ["Question", "nothing.sqf"]; trigger addAction ["option1", "true.sqf"]; trigger addAction ["option2", "false.sqf"]; trigger addAction ["option3", "false.sqf"]; trigger addAction ["option4", "false.sqf"]; The true.sqf is just a defuse = true; and false.sqf the opposite. I've tried with player removeAction trigger; without any luck. Also, I know there is some issues with addaction, and not working online on dedicated servers.? Hopefully, someone will answer my prayers. Thanks in advance! :) Share this post Link to post Share on other sites
celery 8 Posted February 24, 2010 (edited) The correct addAction syntax is trigger=player addAction ["Question", "nothing.sqf"] Try this action removal loop (sqs): _index=0 #removeloop player removeaction _index ?_index<trigger:_index=_index+1;goto "removeloop" The trigger variable you're using saves the ID number of the action and the number gets larger the more actions there are present. Edited February 24, 2010 by Celery Share this post Link to post Share on other sites
mugaben 10 Posted February 24, 2010 Trigger=player addaction will add the action constantly, the addaction needs to appear only when looking at trigger-object. EDIT: But yes, I forgot to save the actions. Thats done now. _Nothing, _option1 _option2 _option3 and _option4 How should I call the removal sqs? Share this post Link to post Share on other sites
celery 8 Posted February 24, 2010 Trigger=player addaction will add the action constantly, the addaction needs to appear only when looking at trigger-object. Right, didn't pay attention to that one. In that case make it lastindex=this addAction ["Question", "nothing.sqf"] To make things simple, name every action lastindex so it will keep the highest ID number in memory for easy removal. How should I call the removal sqs? [] exec "actionremoval.sqs"; in each of the action scripts, or write an sqf version in the scripts (I don't know how at the moment). Change the "trigger" to "lastindex" in the removal script. Share this post Link to post Share on other sites
mugaben 10 Posted February 24, 2010 (edited) Didn't do anything.. Hmm.. EDIT: Forgot to change the "player" to "trigger" in the sqs. The headline (first addaction) then got removed. :bounce3: But not the rest. Edited February 24, 2010 by MugAben Share this post Link to post Share on other sites
celery 8 Posted February 24, 2010 What is this object you're giving the actions to? Should the action be available when you're looking at the object or all the time everywhere? In the latter case you should add the actions to the players. Share this post Link to post Share on other sites
mugaben 10 Posted February 24, 2010 (edited) The actions should only be available, when looking at the object (Something that looks like it could contain a nuclear weapon) Right now, its just the small object, sattelite phone as a temporary. EDIT: When I turned down the music I noticed, when the script comes active the FPS goes from 60 to 23~ and cranks up my harddrives bad Edited February 24, 2010 by MugAben Share this post Link to post Share on other sites
celery 8 Posted February 24, 2010 Didn't do anything.. Hmm..EDIT: Forgot to change the "player" to "trigger" in the sqs. The headline (first addaction) then got removed. :bounce3: But not the rest. So the object's init line now looks like this? lastindex=this addAction ["Question", "nothing.sqf"]; lastindex=this addAction ["option1", "true.sqf"]; lastindex=this addAction ["option2", "false.sqf"]; lastindex=this addAction ["option3", "false.sqf"]; lastindex=this addAction ["option4", "false.sqf"]; Share this post Link to post Share on other sites
mugaben 10 Posted February 24, 2010 (edited) Ahhh, there it is. I had a "_" infront of every lastindex. It's not perfect but it works now. My harddrives and fps still goes south though. Is that normal? :j: ---------- Post added at 04:36 PM ---------- Previous post was at 04:26 PM ---------- Tried with -showScriptErrors. It says, "missing ;" in line 3 in true.sqf. This is my true.sqf: [] exec "actionremoval.sqs"; trigger deleteAction _lastindex; yay=true; :confused: But thanks alot celery, the rest works as a charm. :) EDIT: Confused little me. :) The "trigger deleteaction _lastindex;" is in no need after the sqs. :) Thanks again! Edited February 24, 2010 by MugAben Share this post Link to post Share on other sites
dr_eyeball 16 Posted February 25, 2010 As an alternative, you can avoid many of the issues of handling removeAction and client synchronisation, by instead using the addAction condition parameter instead. The condition could contain some global (or public) variable set by the trigger. Share this post Link to post Share on other sites
Monsada 10 Posted February 25, 2010 (edited) I'm not into all the scripting stuff, and I've searched everywhere, and tried everything now. :mad:Everything but the addaction issues is sorted out. (bombs, triggers and so on) .My team needs to disarm a bomb. .The actions must work for everyone, online. .There will be 5 actions, one that does nothing and works as a headline, and 4 choices. 1 of the 4 choises will be correct. The other three is wrong. The team can only choose one of 4 choises, and when chosen the 5 actions must disapear. My scripting skills only leads me to making a object, calling it "trigger" and adding this to its init: trigger addaction ["Question", "nothing.sqf"]; trigger addAction ["option1", "true.sqf"]; trigger addAction ["option2", "false.sqf"]; trigger addAction ["option3", "false.sqf"]; trigger addAction ["option4", "false.sqf"]; The true.sqf is just a defuse = true; and false.sqf the opposite. I've tried with player removeAction trigger; without any luck. Also, I know there is some issues with addaction, and not working online on dedicated servers.? Hopefully, someone will answer my prayers. Thanks in advance! :) Hi DampetDK, is easy: In the init of the object you want de actions put next code: this addaction ["Question", "nothing.sqf"]; this addAction ["option1", "response.sqf",[true]]; this addAction ["option2", "response.sqf",[false]]; this addAction ["option3", "response.sqf",[false]]; this addAction ["option4", response.sqf",[false]]; now came on with response.sqf a //response.sqf private ["_obj","_caller","_id","_response"]; _obj = _this select 0; _caller = _this select 1; _id = _this select 2; //Parameters _response = (_this select 3) select 0; // remove the action once it is activated _obj removeAction _id; //Now set defuse defuse = _response; /*public variable to all clients. this is very important if you want that all clients knows about the action being done. if not doing only player who does de action will be informed about result.*/ publicvariable "defuse"; hintsilent format ["defuse=%1",defuse]; Edited February 25, 2010 by Monsada Share this post Link to post Share on other sites