Jump to content
Sign in to follow this  
rwake345

AI Scripting

Recommended Posts

Hey all,

In my mission I am trying to make something like a store.

How would be easiest way to do this.

Create a trigger in the editor that adds the action menu command with addAction, or would it be easiest to do it in the code.

I've tried the trigger way but I can not get it to remove the command.

Any help?

Share this post


Link to post
Share on other sites

Do you mean a store like a shop? Where you go and buy stuff?

---------- Post added at 02:31 ---------- Previous post was at 02:30 ----------

Or a store that you know, stores stuff?

Share this post


Link to post
Share on other sites

Like, you buy guns.

I am trying to create an action menu, you know, scroll wheel.

Is it easiest to do this in the mission editor, or in the code.

Share this post


Link to post
Share on other sites

Trigger Settings:

Activation: Anybody (or one team)

Repeatedly

Present

Condition: this && player in thisList

ON ACT.: <Code that shows gunshop>

ON DEA.: <Code that hides gunshop>

Also you may have a look on the 404 wasteland gun shop code:

https://github.com/domuk/Arma3-404Wasteland-Stratis/tree/master/client/systems/gunStore

But it maybe too much.

Edited by Sanjo

Share this post


Link to post
Share on other sites

Best thing to do would be a init.sqf, that adds the action(s) to the object (building/crate/whatever).

As you should learn and find out for yourself...check this http://community.bistudio.com/wiki/addAction

So when the player selects the action for buying a specific weapon, do something like 'caller addWeapon "CLASSNAME"'

Good luck ;)

P.S. What does this have to do with "AI Scripting" ? ^^

Share this post


Link to post
Share on other sites

Well I did what you said Sanjo.

I put player addAction ["Store","store.sqs","",0]; in Act

And in Deact I put player removeAction 0;

The action menu command never goes away, what am i doing wrong?

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  

×