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

Upgrading Shops

Status
Not open for further replies.
Level 3
Joined
Jul 15, 2007
Messages
36
Dear all, Thank-you again for your help.

I am trying to have an upgradable shop, based off the arcane vault structure.

My problem is, when the unit upgrades, the new "items Made" don't show up. Instead, the old items remain. The new items do show up if the shop is built from scratch rather than upgraded.

1) Is there an object editor field I am looking over?
2) Assuming I have to use a trigger to remove the items made from the old unit when it is upgraded, how do i get this (in particular, what is the event? Tried Player-owned unit starts construction, starts an upgrade, neither seemed to fire)?

(P.S. I was originally trying to just remove the triggering unit and replace with the upgrade. will that work?)

Cheers,
Lauren

======================{EDIT}=========================
You know how, after several hours of trying to figure it out, you work it out about 15 minutes after you post for help?

  • Events
    • Unit - A unit owned by Player 1 Begins an upgrade
  • Conditions
    • (Unit-type of (triggering unit)) equal to UnitUpgrade
  • Actions
    • Unit - Kill (Triggering Units)
    • Unit - create 1 (unit-type of (Triggering unit)) at position of (Triggering unit) facing Default Building Degrees
(Or, as I suck at de-leaking GUI);
JASS:
function Trig_Upgrade_Actions takes nothing returns nothing
    local location l
    if GetUnitTypeId(GetTriggerUnit()) == 'h00C' then
    call KillUnit( GetTriggerUnit() )
    set l = GetUnitLoc(GetTriggerUnit())
    call CreateNUnitsAtLoc( 1, GetUnitTypeId(GetTriggerUnit()), Player(0), l, bj_UNIT_FACING )
    elseif GetUnitTypeId(GetTriggerUnit()) == 'h00A' then
    call KillUnit( GetTriggerUnit() )
    set l = GetUnitLoc(GetTriggerUnit())
    call CreateNUnitsAtLoc( 1, GetUnitTypeId(GetTriggerUnit()), Player(0), l, bj_UNIT_FACING )
    endif
    call RemoveLocation(l)
endfunction

//===========================================================================
function InitTrig_Upgrade takes nothing returns nothing
    set gg_trg_Upgrade = CreateTrigger(  )
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_Upgrade, Player(0), EVENT_PLAYER_UNIT_UPGRADE_START )
    call TriggerAddAction( gg_trg_Upgrade, function Trig_Upgrade_Actions )
 
Last edited:
Level 1
Joined
Aug 1, 2007
Messages
4
I think that you have to make a new building.
Like, make another building with different items and then replace the old building with the new building when it is done constructing.
Im not sure though.
 
Status
Not open for further replies.
Top