[XP] Auto-use Ammo / Reload for BlizzABS

Started by Subsonic_Noise, January 23, 2011, 11:07:14 am

Previous topic - Next topic

Subsonic_Noise

So, this is actually not complicated at all. My game is averagely realistic and futuristic, so I'll have guns as the main weapons, and those guns will all only support one type of ammunition - none of that enchanted / exploding / anti-werewolf / anti-whatevethefuckpeoplecomeupwith bullets, just plain normal ammunition. So, the whole equip system is unneeded and seriously would get really annoying for the player, especially if he wants to quickly switch between a normal item (let's say, a grenade) and a gun, but he can't because he forgot to re-equip the ammunition and therefore dies and is slowly eaten by mutants.
Well, I myself wouldn't want that as a gamer, but just getting rid of that would make it a bit... not challenging. Therefore, I thought: if I'm going for a more realistic feel, why not include reloading?

So, my request is:

- Weapons that require ammunition will automatically use it, based on what I configured in the script
- It can only hold a certain amount of ammo though. If the ammo it holds reaches 0, shooting is impossible. The amount of holdable ammo is configured in the script, too.
- Reloading is executed by a configurable button and needs a different amount of time for every weapon. During that time, the player is set to auto-sneak.
- ...It also plays a soundeffect and an animation... blah blah configurable.
- Wherever the weapon icon is shown, it has a small number on it indicating the amount of ammo it can hold and the amount of ammo it is currently holding.

I hope this was easy to understand and ellaborate enough. Would be awesome if anyone could do this! :D

The Niche

January 23, 2011, 01:51:37 pm #1 Last Edit: January 23, 2011, 02:17:31 pm by The Niche
Hmm...I think this could be doable with the combo system. Just a second...*checks configuration*...ok, it is if you know the script call for reducing items. Or here's another idea, using common events:

Weapon: Gun.
Type: Bow.

Common event: Ammo
Type: Parallel. Condition switch: I hope I don't need to tell you this!
Conditional branch: Player has item[ammo] in inventory
Conditional branch: Player has [gun] equipped
Conditional branch: Variable [ammo in clip] > 0
Conditional branch: Input::Attack
Control variables [ammo in clip] - 1
Control items [ammo] - 1
Branch end
Else:
Conditional branch: Input::key['<Reload button>']
Set move route: Change movement speed, change actor graphic, play SE, play animation [player]
Wait (# of frames for your weapon)
Else:
(Repeat above, changing frames depending on the weapon)
Branch end
Brandh end

Tadaaaa...
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

Subsonic_Noise

Yes, nearly everything is doable in events, but I'd like a script, though - I've got a fuckload of guns and that would be a hell to configure let alone it would waste alot of variables. Thanks for the effort, though.

The Niche

Are you aware you can reuse variables? For this, you'd only need as many variables as you have gun users. Plus, once you have the first one down, all you need to do is copy, past and change the wait time.
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

Blizzard

I think a script here might be a wise choice. Sure, it can be done with eventing, but it seems to me that it's not something that should be done with events. As soon as you get something like "you need one variable/switch for every X in the database of your game", you are better off with a script than an event system.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

winkio

Get a script if you want, but it's a two-action combo per weapon that you can copy paste and just change the number for the item id:

Action 1:
Condition: Script: $game_party.item_number(id) > 1
Go To Action: 2

Action 2:
Attack
Script: $game_party.lose_item(id, 1)


This makes it so it doesn't use the attack unless at least 1 of the item is possessed, and then if the item is possessed, it decreases it's count by 1.  use it with a no ammo bow weapon, and it should work perfectly.

RoseSkye

Pfft, I am surprised he is not using clips/ clip sizes.

Subsonic_Noise

@winkio: That's only one of the featuresI requested - the others are what makes it reasonable to make it a script.
@Rose: Remind me - what's that?

RoseSkye

Clips are basically the amount of bullets a gun can hold. You may know them as 'rounds'.

Blizzard

You know, a Magnum can hold 6 bullets, a .38 has 18 bullet-clips, a .50 has 12 bullet-clips, an uzi has 30 bullet-clips, etc.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Subsonic_Noise

Quote from: Blizzard on January 24, 2011, 02:58:07 am
You know, a Magnum can hold 6 bullets, a .38 has 18 bullet-clips, a .50 has 12 bullet-clips, an uzi has 30 bullet-clips, etc.

Ah, yes! That's what I was referring to.. and Winkios combo doesn't do that, sooo.. this is still relevant. I'd appreciate it if anyone could give it a try.

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

AliveDrive

Quote from: Blizzard on January 23, 2011, 05:18:34 pm
I think a script here might be a wise choice. Sure, it can be done with eventing, but it seems to me that it's not something that should be done with events. As soon as you get something like "you need one variable/switch for every X in the database of your game", you are better off with a script than an event system.


Eventing is near and dear to my heart, but Blizz is right.

and also, I totally saw the other thread and not this one, my bad. :/
Quote from: Blizzard on September 09, 2011, 02:26:33 am
The permanent solution for your problem would be to stop hanging out with stupid people.