Two questions

Status
Not open for further replies.
Level 12
Joined
Dec 2, 2016
Messages
733
Ok so first question, I have a town hall that trains workers to harvest lumber. I want to have them auto harvest upon being trained, I can't seem to figure out how to do that even with setting their passive abilities to harvest.

#2) I enabled all 12 player slots, and they are all set to user. Yet when I play the game, all the slots are unused and create Computer players. ( I created spawn locations for each player.) I have triggers that create the specific unit to that color at the spawn locations. How can I make it so when they spawn, they only spawn if that slot is in use?

Thanks!
 
Level 14
Joined
Nov 30, 2013
Messages
926
If you want to automatically order your worker to harvest wood without a flag, use this.
  • Create
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Peasant
    • Actions
      • Unit - Order (Trained unit) to Harvest (Random destructible in (Region centered at (Position of (Trained unit)) with size (WIDTH, HEIGHT)) matching ((Destructible-type of (Matching destructible)) Equal to Summer Tree Wall))
 
Level 12
Joined
Dec 2, 2016
Messages
733
Level 14
Joined
Nov 30, 2013
Messages
926
And #2, the auto harvest sort of works.

Gyazo - 18fb6b5db1d0994bf60fa24b72ca33df.png

What do I do for the size aka width and height? It seems like 1000 seems to move them. But what exactly do the height arguments stand for? The tree, or the worker or?

Thanks a lot btw!
The size is used as how big the region is to pick any destructible within it.

Hard to explain but here's a sample of a pic.
full
 
Level 12
Joined
Dec 2, 2016
Messages
733
Thanks, got another question.

I'm making a merchant shop, that you can buy units from. I need to somehow make this building available to one team of two players, and not available to the other team. But the other team can see what has been bought/on Cooldown at any time without buying it.

I've been trying to figure this out for a few hours with no luck. I really appreciate the help btw.
 
Level 12
Joined
Dec 2, 2016
Messages
733
I'm not sure exactly what you mean?

I don't know how to make the building viewable to both players, or even all players. It seems to by default only allow the player color of that specific building to view units. The teammate can select the building, but can't buy anything nor see anything.

For the triggers, do you mean. Something like > If unit bought and unit color not equal to Xplayer color then do nothing, something like that?
 
Level 43
Joined
Feb 27, 2007
Messages
5,464
No, make a new upgrade called whatever you want and make the shop owned by neutral passive. Add that upgrade to the Techtree - Requirements for any unit that should be sold by the shop. Then enable that upgrade for any player the shop should be able to sell to.
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Player Group - Pick every player in (All allies of Player 1 (Red)) and do (Actions)
      • Loop - Actions
        • Player - Set the current research level of <Your upgrade> to 1 for (Picked player)
 
Level 12
Joined
Dec 2, 2016
Messages
733
I figured it out, under abilities you need to add 'Select Unit'.

Everyone can see it now, but yeah the abilities tech tree doesn't seem to work.

I was thinking we could have variables, like

IsVamp = true

and then if the button is clicked, check if IsVamp is true and spawn the unit. But I guess there's no way to detect if the button was clicked?
 
Level 12
Joined
Dec 2, 2016
Messages
733
This is what I came up with.
  • unit sells unit
    • Events
      • Unit - Vampire Merchant 0002 <gen> Sells a unit
    • Conditions
    • Actions
      • If ((Triggering player) Equal to Player 12 (Brown)) then do (Player - Set Player 12 (Brown) Current gold to 750) else do (Do nothing)
      • If ((Triggering player) Equal to Player 11 (Dark Green)) then do (Player - Set Player 12 (Brown) Current gold to 750) else do (Do nothing)
It's not registering that I clicked the item. Is triggering player not the one who clicks on the item?
And as for what I came up with, I'll figure something else out hopefully to spawn or delete the unit spawned if it's not by the correct player.
 
Level 12
Joined
Dec 2, 2016
Messages
733
  • unit sells unit
    • Events
      • Unit - Vampire Merchant 0002 <gen> Sells a unit
    • Conditions
    • Actions
      • If ((Unit-type of (Triggering unit)) Not equal to Dracula) then do (Unit - Kill (Triggering unit)) else do (Do nothing)
      • If ((Triggering player) Equal to Player 11 (Dark Green)) then do (Player - Set Player 12 (Brown) Current gold to 750) else do (Do nothing)

In this cause, triggering unit is the shop, I'm trying to make it my hero that is the triggering unit. Did I do this wrong?
 
Level 12
Joined
Dec 2, 2016
Messages
733
Got it

  • unit sells unit
    • Events
      • Unit - Vampire Merchant 0002 <gen> Sells a unit
    • Conditions
    • Actions
      • If ((Unit-type of (Buying unit)) Not equal to Dracula) then do (Unit - Kill (Sold unit)) else do (Do nothing)
      • If ((Triggering player) Equal to Player 11 (Dark Green)) then do (Player - Set Player 12 (Brown) Current gold to 750) else do (Do nothing)
  • [\TRIGGER]
 
Status
Not open for further replies.
Top