• 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.

bj_stockUpdateTimer in Lua?

Status
Not open for further replies.
Level 15
Joined
Jul 12, 2018
Messages
560
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 15
Joined
Jul 12, 2018
Messages
560
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.
 
Status
Not open for further replies.
Top