• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Noob in need of scripting help

Status
Not open for further replies.
Level 1
Joined
Oct 3, 2021
Messages
6
Hello ladies and gentlemen! This is my first post here! I am a noob wc3 map developer just starting out!
I need help in creating a script for a map that i am trying to bugfix
Specifically i want to limit a given item that player 11(dark green in this map) from getting more than 15 stacks of that item(Note that i am already familiar with object editor and i set the maximum number of stacks that item can get but this didn't work so i suspect i have to create a script from scratch and i am a complete noob lol)
Thanks in advance!
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
try these on for size:


 
Level 1
Joined
Oct 3, 2021
Messages
6
try these on for size:


thanks Cheshire!
 
Level 1
Joined
Oct 3, 2021
Messages
6
You need to go into the Gameplay Constants and turn on Inventory - Enable Item Stacking in order to take advantage of the Max Stacks field. This is only available in version 1.31+.

Note that this will allow ANY item with charges to stack.
the item in question is already stacking but i want it to not be able to stack more than 15 times! i will check the gameplay constants okay!!
 
Level 1
Joined
Oct 3, 2021
Messages
6
yep i figured that!
okay i enabled the autostacking in the gameplay constants and set the maximum stats to the desired number but still no luck...the item in question will stack above the desired number still...i found a workaround by reducing the stock replenish time to 3600 seconds...that's the maximum it can't go over 3600 seconds
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,517
It should work as long as the item's settings are correct. Why not base the item off of something that already works? I know Healing Salve worked for me, stacking up to 6 times. Copy and paste that item and work from there.

Also, you can shift-click a field in the Object Editor in order to bypass limits like the 3600 stock duration. Additionally, you can go into the World Editor's preferences and enable "Allow negative real values..." for further control.
 
Last edited:
Status
Not open for further replies.
Top