• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Charged-up Item stacking? What?

Status
Not open for further replies.
Level 3
Joined
Oct 14, 2004
Messages
33
Yo,
The map I'm making at the moment, it's one based off the 'Real Life' maps, is gonna have weapon items in it. I know how to put the items at a set number of rounds for a gun, say 8 shots for a pistol, but I don't know how to stack the items so they don't fill up your inventory.
So if somebody had a shotgun with 4 shots, I wanna be able to make it so when they pick up another 4 shots, instead of adding another shotgun to their inventory, the original shotgun goes from 4 to 8 rounds. Did that make sense? And if it did, can somebody tell me how to do this?

Thanks,
-Jase
 
It takes a few basic triggers that run all the time.

When you make your shotgun item, make it a charged item with as many charges as you want the player to possibly be able to carry.

Then, when you get your first shotty, change the quantity of charges (via an "Item" action) to 4. Whenever you get a shotgun after that, change the number of charges on the existing shotty to the number of current charges + 4, and remove the new shotty item.
 
Thanks for the help, but could you explain it like this please?

Events
Conditions
Actions

This would make it a little easier to understand for me.
 
Code:
Events: 
Unit - a unit aquires an item

Conditions:
none

Actions:

If/then/else - multiple conditions
If - Unit has item of type (shotgun)
Then - Item Remove (aquired item) from the game
        - Item add 4 charges to (attach a variable to each weapon picked up...)
Else - do nothing

That should do the basics.... that is code done without the editor though.
 
For the love of Pete, open the trigger editor up, make a new trigger, and make a new action in that trigger. Almost right away there's the action "If - Multiple Actions".

In order to be able to develop triggers, you're going to need to be willing to dive in and try things out before running for help. There's simply too much for people to tell you how to do everything.
 
Let me redefine what I meant before you go flaming my mapping skills.
I could find If/Then/Else in the Actions menu, but I couldn't find the
"Unit has item of type"
"Remove (aqiured item) from the game"
or "Item add 4 charges to (variable)"
Okay? Now could you please tell me the correct actions and conditions to use in the If/Then/Else function?
 
Status
Not open for further replies.
Back
Top