Shop Upgrade

M4st3rM1nd

New Member
Reaction score
0
Hi, I'm currently working on an Hero Defense and I would like to enable users to upgrade the shops but I don't know how.

Requirements:
- All the shops are from neutral passive! (so normal upgrading doesn't work)
- The shop has 5 levels each level has more and better items
- There are 5 different shops and they need to be upgraded individually

I can't get it working, does anyone know how to do this?
 

Exide

I am amazingly focused right now!
Reaction score
448
The easiest way is probably to create all the shops in the Object Editor first.
When you've done that you can create a trigger that replaces a level 1 shop with a level 2 shop, and so on.
 

Dest

New Member
Reaction score
26
You can also make a trigger that when the time passes, you remove the first shop and add the second shop. I can give a trigger if you want to but it'll leak, so...
 

Jayykob

New Member
Reaction score
1
Here's a leak trigger ^^

Code:
Event
   Time elapsed equal sumthing

Condition
   picked unit equals a structure equal to true
   picked unit is owned by neutral passive

Action
   Pick every structure in region and do actions
      set buildpoint to (point of picked unit)
      remove (picked unit) from the game
      Create 1 "your shop" at buildpoint facing default building degrees
 

Exide

I am amazingly focused right now!
Reaction score
448
Here's a leak trigger ^^

Code:
Event
   Time elapsed equal sumthing

Condition
   picked unit equals a structure equal to true
   picked unit is owned by neutral passive

Action
   Pick every structure in region and do actions
      set buildpoint to (point of picked unit)
      remove (picked unit) from the game
      Create 1 "your shop" at buildpoint facing default building degrees

Not only does it leak, it also won't work, and it isn't what the thread starter asked for.
Which makes it a useless thing to post.

What did you do wrong?
-First of all the event. He wants the players to be able to upgrade the shops manually.
-Secondly the conditions don't make sense and will prevent the trigger from running at all.
-Thirdly it leaks, and creates a shop, instead of replacing an existing one.
 

Dest

New Member
Reaction score
26
Here's a leak trigger ^^

Code:
Event
   Time elapsed equal sumthing

Condition
   picked unit equals a structure equal to true
   picked unit is owned by neutral passive

Action
   Pick every structure in region and do actions
      set buildpoint to (point of picked unit)
      remove (picked unit) from the game
      Create 1 "your shop" at buildpoint facing default building degrees

As above poster said, it will not work and I just learn how to stop leaks :p

If the start poster wishes to, I could make you a trigger of doing that what I said.
 

M4st3rM1nd

New Member
Reaction score
0
As exide said, i wanted the trigger to meet al conditions. The players must buy with gold (or mabye something else but atleast buy) the shop upgrades. If I wanted to make the shops upgrade in X time I could have done it myself. But not this, I've tried to do it many time and all have failed :(

If someone has the trigger to do it according to my conditions, please tell me :cool:
 

Exide

I am amazingly focused right now!
Reaction score
448
I would've done it by firstly creating a dummy unit.
One that isn't to be seen, costs a certain amount of gold (preferably same amount for each upgrade), and that is removed once it is sold. I would also name it something like 'Upgrade', with a Tooltip saying: "Upgrade your shop, in order to buy new and improved items." (Or something similar.)

When I got my dummy ready I would add it (via trigger) to my pre-placed shop (level 1).

I would then have created a trigger that sets a "shop index", running on Map Init (or very early in the beginning, at least.)
'Map Init'
set ShopUpgrade[1] = *Your_Shop_Unit_Level_1*
set ShopUpgrade[2] = *Your_Shop_Unit_Level_2*
set ShopUpgrade[3] = *Your_Shop_Unit_Level_3*
//and so on..

Finally add a trigger that checks 'Unit - A Unit sells a unit', 'Unit type of (Sold Unit) Equal to *Upgrade*'.
Then I would do actions:
set *ShopInteger* = *ShopInteger* + 1'
'Unit - Remove (Sold Unit) from the game'
'Unit - Replace (Triggering unit) with ShopUpgrade[*ShopInteger*]
If *ShopInteger* greater than or equal to 5 then
'Neutral Building - Add *Upgrade* to (Last replaced unit)'
else


Something like that. :p
 

Dest

New Member
Reaction score
26
My idea is that when a player buys the item, the shop automatically upgrades by removing the level 1 shop and create a level 2 shop there. The action also removes the item from the player bought.
 

Exide

I am amazingly focused right now!
Reaction score
448
Items demand a slot in the inventory (unless if they're powerups), units do not.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top