Jump to content
Sign in to follow this  
Alan

How to create a custom scroll menu.

Recommended Posts

Hey, for a while I've been wondering how to make a custom scroll menu, lets say if I walk into a trigger, and then I have a scroll menu that can activate another triggers and so on, how can I do that.

Share this post


Link to post
Share on other sites

Hi,

addAction is the command you are looking for.

addAction always referes to a scriptfile AFAIK.

put in your first trigger something like

myAct = player addAction ["nameOfAction", "myScript.sqf"];

in your init.sqf:

variableAction1 = false;

in myScript.sqf -> goes to your missionfolder

_obj = _this select 0;
_caller = _this select 1;
_id = _this select 2;

_obj removeAction _id;

variableAction1 = true;

the condition of your second Trigger will be

variableAction1

this should work in SP, MP will be more complicated

Share this post


Link to post
Share on other sites

yea, I just need to make sure it's multiplayer compatible, anyways thanks for the help, I appreciate it. ;)

Share this post


Link to post
Share on other sites

For MP, a addAction is local to the client, so that is what you need to be aware of.

If you create it only on the client where player == unit1, then unit1 player will be the only one to see it and use it.

if you create it on the server, and its a dedicated, noone will see it etc..

Share this post


Link to post
Share on other sites

Alright, so if I make like 6 units (Playable), I can name them : unit1, unit3, unit4, unit5 and unit6; then I make a trigger for the scroll menu and i set it to unit1, but then, i can just copy and paste it and put one trigger on top of the other one, but renaming the unit1 to unit2.. if you know what I'm saying, then i can just group the units.

Edited by Alan

Share this post


Link to post
Share on other sites

On map triggers will execute for all clients connected. It's great for things like a Day/Night toggle on the map activated from addAction. Have the triggers condition a publicVariable and have the addAction change that variable. That way you can have all clients change based on one guy's action.

However for most things it gets more complicated. What exactly are you trying to do with this menu thing?

Share this post


Link to post
Share on other sites

I'm creating a detective mission, and I want, let say if i walk up to someone and scroll down the menu to lets say ask the witness something, it will activate another trigger and there will be a reply.

Edited by Alan

Share this post


Link to post
Share on other sites

this moveInCargo vehicleName;

You can also use moveInDriver if you want them to drive the vehicle in question.

---------- Post added at 03:18 PM ---------- Previous post was at 02:38 PM ----------

Ya know, for the talking to the guy you should try using the kbtell system. Here's a good tutorial (part1 and part2) that covers it pretty well. Seems overwhelming at first, but should work pretty well. :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×