Jump to content
Sign in to follow this  
Trapper

Dialog & scripts for a inventory / ammobox

Recommended Posts

ofpinvdialog0ef.th.jpg

I'm trying to script an inventory/ammobox dialogbox for a mission.

To make the rearming of a squad more easy than radio-6-x and waiting a long time for one ai, thats running for an ammocrate, was the main idea.

What I also added is that the ammunition is "stored" as rounds instead of magazines (ie 100x 9mm rounds give you the possibility to generate the kind of pistolmag needed). Somekind of selfmade JAM-ammocrate.

The dialog only works correct with predefined weapons and ammunitions, but thats ok for this mission.

When finished the Player should be able to transfer weapons and ammo of the whole squad in and out of this "inventorybox"

The dialog and scripts are almost done, but with some annoying compromises:

1.

Addmagazine command can only add full magazines. So 9 rounds left in inventory are useless, if the smallest magazine needs 10 rounds. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ? ammo >= 10 : character addmagazine "xzy"

2.

Its also a problem backwards: If the player brings 4 almost empty m16 clips, i can only add 120 rounds to the inventory, even if there are only 4 bullets left inside of them. Ammo command is no help, because only ammo in the loaded magazine is returned, but removemagazine grabs the unloaded magazines first. Also i dont want the player to -close/open the dialog then select weapon x ect- for every magazine he wants to store, just to check the true ammocount.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#loop

? magazines character select _x == "M16" : ammo556 = ammo556 + 30

...

goto "loop"

3.

But thats not all, if the player goes into battle with M16+grenadelauncher, 4x M16 magazines, 2x handgrenades, 2x riflegrenades and he returns with zero ammo, the magazines command still would count ["M16", "HandGrenade", "GrenadeLauncher"]

If I allow the player to "Remove all magazines" no matter what, he gets 120x 5.56mm rounds, 1x Handgreande, 1x Riflegrenade stored for nothing.

If I allow it with >1 magazine of a kind only, he won't be able to store one last (notempty) magazine or grenade.

If ammo command could help, it would still require the player to close/open the dialog, just to change to the weapon (rifle, pistol, ...) for counting.

Someammo command looks for all kind of ammo, I dont think it can help here.

4.

Another magazine-adding problem: Player has to count for himself how many magazines he can issue to a unit (otherwise the overflowing ammo disappears), because i can think of no easy way to count its available magazineslots. Ok, I can find out what vehicleclass the unit is (10 slots for soldier, 6 for police, 4 for medic and civillians (yes, i want to use them all)) but, then again: I would have to count the magazines they already have. ...see 3. for the the problem that arises.

Maybe there is a scripting solution i can't imagine, or anybody has easier ideas for the inventory thing?

PS: Perhaps the secret is kept in the normal ammocrates and vehicleweaponcargospace. They store all magazines added with the right bullet count. But even they need the player to have the right weapon selected, so he can store its magazinetype.

Share this post


Link to post
Share on other sites

I made a loadout menu a while back, but it sounds like you're trying to get very granular with yours, all the way down to the ammo.  Mine mainly deals with magazines and the weapons.  Here's a link to an old thread where I talked about it.  I had to edit the post to make the links in it up to date.

http://www.flashpoint1985.com/cgi-bin....y352152

Edit: after looking yours over even more, I think you're going more for an inventory standpoint. Mine doesn't care about inventory, it just deals weapons, so it's probably of no use to you script-wise.

Share this post


Link to post
Share on other sites

Thanks Karrillion, but I'm busy right now and will have a look later. I'm downloading your sample mission already.

You're right about the inventory function, it's the most important part of the dialog. It's supposed to replace the briefing weaponselection in a one-mission-campaign.

Share this post


Link to post
Share on other sites

When I created our inventory for SOW, I have a list of all available weapons in the mission (built by hand) with how many slots they take up and what slot category they fit into.

That was the only way I could count how much space is available and what can fit on a person.

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  

×