OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Supergrunt on 29 Nov 2007, 19:04:44
-
in my mission the player char (jc) needs to walk up to a guy (r2) and by using a custom action (buy=jc addaction ["get gear","scriptname.sqs"] )
he gets a gear menu just like the weapons crate
any way i can get this to work ?
( putting a ammobox underneath R2 is not an option.....)
the meaning is that JC walks to a guy and can select his gear from this dude (for free) (like a real armory where you get weapons etc. from a employee)
thanks already for any brain damage i inflict on you scripters :P
-
You will need to create a dialog with a listbox showing the different weapons available, add the seller an action with a script to open your selling dialog. Be adviced, this is a lot of work so better try to find an existing resource doing something similar.
-
There are a lot more issues than you think involved in directly transferring equipment to the player, which is why people so often use the ammo box method. You need to be reasonably skilled in creating dialogs and, most importantly, to be able to have a good understanding of ArmA config just to be able to work out whether someone can carry something!
Although I never considered it when I designed it, you could use the shop interface from my SPON Money (http://www.ofpec.com/forum/index.php?topic=30551) with all items configured to cost $0. I'm still not at all sure why you can't just have a big ammo box if everything is free, but I'm sure you have your reasons; I certainly can't see that effectively re-creating the inventory menu would be worth the effort, even if you reused the BIS dialog with your own code manipulating it, since this is quite a complex thing to do when there already perfectly good ammo boxes in the game.
-
well i do have my reason for not wanting a big ammo box (interaction with rebel forces..) i tried looking at your spon money scripts but i (being a scripting idot) didn't figure out how to implent it to my mission (yet...) and how to change the money values... i does however contain the exact thing i need so i will start looking at it again (and again and again) to see if i can figure it out....
thanks anyway guys
-
The money values can be altered by just using 0 for all the prices in the examplePrices.sqf. The readme that comes with it has some errors/omissions that may be confusing you, so read the discussion in the thread where I try to explain it to someone else who was having problems. If you still can't get it working, post your problems in that thread and I'll see what I can do to resolve them for you. Good luck!