• 🏆 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!

bj_stockUpdateTimer in Lua?

Level 13
Joined
Jul 12, 2018
Messages
510
So i'm a GUI user who recently converted my map to Lua.

As we know, in Jass you can keep items from disappearing from a shop by running the following trigger:

The trigger below will stop items that are added to shops via trigger from disappearing after purchasing them.
  • Shop Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: call PauseTimer(bj_stockUpdateTimer)
      • Custom script: call DisableTrigger(bj_stockItemPurchased)

From what i've been told the only difference in custom scripting to a GUI user between Lua and Jass is that you delete the "call " bit.
This trigger doesn't seem to function anymore though despite doing that.

Any suggestions? Thanks in advance.
 
Level 13
Joined
Jul 12, 2018
Messages
510
I'm still messing with this and found a solution. I was using the scripts to populate shops with items after the shops were created. My issue was that items got removed from shop on 1st purchase.

Have no idea why, but it seems the items only get removed from units belonging to Neutral Passive player. If you change the owner after adding your items to a different player (may need to be allies with the buying unit, have only tested that way) then the items stay permanently purchasable from that unit.

Can't find where to mark solved, maybe that's not part of my permissions. if it's a mod action then feel free to.
 
Top