OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Robinhansen on 13 Feb 2005, 20:56:26

Title: addaction?
Post by: Robinhansen on 13 Feb 2005, 20:56:26
this string: [eng, "cover4"] exec "pos.sqs" works perfectly in a trigger, but how do I add it to a playeres actionmenu? :D
Title: Re:addaction?
Post by: Tyger on 13 Feb 2005, 21:03:32
well, i dont know what your string stands for but with addAction but maybe this will help  :-\:

actionname = unitname addAction ["Action Menu Title","Script To Execute.sqs"]
Title: Re:addaction?
Post by: Robinhansen on 14 Feb 2005, 00:02:20
ENG is the name of the player. COVER4 is the classname of Sparks fightposistion.
The script is supposed to create a fightposistion in front of the player, but in a multiplayergame the player cannot use radiocommands so it got to be in the actionmenu.
I'm sad to say it but the way it is described does'nt work. Tried it ealier... ;)
Title: Re:addaction?
Post by: Tyger on 14 Feb 2005, 22:23:54
ah, i see what you're sayin :P im a loon

okay, its not really possible to assign varibles like that through a sodding addAction command, but there are ways to cheat ;D

you have to make a global varible (or two) that the script accesses, which you assign before the player uses the addAction command. Or even just assign the varibles in the script like _myLoon = player. But you cannot pass varibles through the addAction command, unfortunatly. :P

Sorry mate. :'(

Title: Re:addaction?
Post by: Robinhansen on 15 Feb 2005, 01:00:49
Tanks for the tip m8, but I'm way ahead of ya' ;)

I got this reply ealier today...check it out:

http://www.ofpec.com/yabbse/index.php?board=8;action=display;threadid=22005;start=15;boardseen=1 (http://www.ofpec.com/yabbse/index.php?board=8;action=display;threadid=22005;start=15;boardseen=1)