Upgrade Centers
Nov 24 2008, 10:22 am
By: liver  

Nov 24 2008, 10:22 am liver Post #1



Okay, I'm making a hero arena style game, with 2 forces and a third for the 2 computers. We'll my question is, I can make a trigger to where the heros upgrade by moving their units onto the upgrade beacon, but problem is, when they get off the beacon, they still own the building, how can I fix this? my trigger looks like this:
Trigger("Force 1"){
Conditions:
Bring("Current Player", "Men", "upgrade protoss 1", At least, 1);
Switch("Upgrade", not set);

Actions:
Give Units to Player("All players", "Current Player", "Buildings", All, "upgrade protoss center 1");
Preserve Trigger();
Comment("Upgrade Begin");
Set Switch("Upgrade", set);
}



None.

Nov 24 2008, 10:50 am rockz Post #2

ᴄʜᴇᴇsᴇ ɪᴛ!

Trigger("Force 1"){
Conditions:
Bring("Current Player", "Men", "upgrade protoss 1", Exactly, 0);
Switch("Upgrade", set);

Actions:
Give Units to Player("Current Player", "Whatever player you want to have owning it", "Buildings", All, "upgrade protoss center 1");
Preserve Trigger();
Comment("Upgrade Begin");
Set Switch("Upgrade", not set);
}
You need a trigger to give the building back. The switches are pointless, unless you are using them in some other trigger. In fact they'll make it so if two people go onto the beacon, one of them can't use it until the other one leaves and that person leaves then gets back on. I'd highly recommend you also change it from "all players" to "whatever player you want to have owning it" when it's not in use. That way, you won't have people walking up on it and then interrupting the player's upgrades.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Nov 24 2008, 12:18 pm liver Post #3



such as giving it to a neutral player when the current player is done upgrading? ie. give back to computer 7?



None.

Nov 24 2008, 12:31 pm Vi3t-X Post #4



When the player gets off the beacon, you give the buildings back to whatever player who originally owned it. In this case, Player 7.



None.

Nov 24 2008, 1:08 pm Falkoner Post #5



In the conditions you may want to add that the computer player owns a building there, so they can't steal the upgrade buildings from eachother.



None.

Nov 24 2008, 1:49 pm NudeRaider Post #6

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

To summarize, this is the most simple and usable way to do it:

Preplace all the upgrade buildings for neutral, P9-11 or to a spare computer player. Depends on what other uses you have for those players. Any will work. I will use Neutral in my example.
Trigger 1: Grab the buildings
Player Force
Conditions:

Current Player brings at least 1 [men] to 'upgrade protoss'
Actions:
Give all [buildings] owned by Neutral at 'upgrade protoss center' to Current Player
preserve trigger

This will automatically prevent stealing the buildings as only Buildings owned by Neutral will be given.

Trigger 2: Give the buildings back (using Neutral)
Player Force
Conditions:

Current Player brings at most 0 [men] to 'upgrade protoss'
Actions:
Give all [buildings] owned by Current Player at 'upgrade protoss center' to Neutral
preserve trigger

If you don't use Neutral (but lets say P8) you need to rewrite this trigger a little to deal with leavers while upgrading:
Trigger 2: Give the buildings back (using P8)
P8
Conditions:

Player Force brings at most 0 [men] to 'upgrade protoss'
Actions:
Give all [buildings] owned by All players at 'upgrade protoss center' to P8
preserve trigger

Post has been edited 1 time(s), last time on Nov 24 2008, 1:54 pm by NudeRaider.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:49 am]
Ultraviolet -- "Not many people know this, but I actually got the idea for my mustache after seeing the end of a paintbrush for the first time." :lol:
[2026-3-08. : 1:15 pm]
NudeRaider -- literally Hitler
[2026-3-08. : 12:54 pm]
Oh_Man -- this is a work of art: https://youtu.be/NmjrfXO0mdk
[2026-3-08. : 12:10 am]
Ultraviolet -- "often was always pretty cool" 60% of the time, it works every time :shifty:
[2026-3-07. : 11:26 pm]
NudeRaider -- The visuals are good, the animation is terrible: the movement is off, the impacts in battle scenes have zero weight to it, the lip sync is right up uncanny valley. But yeah, considering what it is it's pretty good overall.
[2026-3-07. : 6:24 pm]
Oh_Man -- https://youtu.be/pPZafFJOi48 crazy good
[2026-3-07. : 9:51 am]
NimoStar -- And Pathfinding in SC1 was not *that* bad, the problem is that it was designed as a flat 2D game like WC1 (and it was in the alpha) and then switched to isometric without changing the base code. So its actually a flat game pretending to be isometric. With the custom competitive maps that use larger ramps and elevation, pathfinding is quite fixed.
[2026-3-07. : 9:47 am]
NimoStar -- The unlocking and map choice was fine, but mostly in WoL - In HoTS the worst of all units are irrelevant because Kerrigan has infinite summon and stuff. And even in WoL the spaceship instakill map powers are better than units. If I could RTS in my RTS that'd be great.
[2026-3-05. : 8:45 pm]
NudeRaider -- Nekron
Nekron shouted: NudeRaider not that the og sc1 campaigns are particularly good mechanically but cmon, SC2 map mechanics are the opposite of fun
There's many parts to it. I think the raw rts gameplay of sc1 is unsurpassed to this day. And I too never liked that sc2 missions always rush you in some way or another, because I like to take my time. However I still have to admit that they way they did it often was always pretty cool. Like lava rising and receding, a huge-ass mothership destroying bases, undead coming at night, just to name a few, those are definitely creative, so I'm sure there's people that liked it. But that's not even what I meant. It's the unlocking of new features and upgrades and choice which map to play next that made it so much more motivating for me.
[2026-3-05. : 6:49 pm]
Nekron -- like the train maps, enemies just kind of come at you (I'm not sure if there is a real enemy base, there might be one just on a technicality - you are to never interact with its production) and then you gotta chase trains for lulz
Please log in to shout.


Members Online: Excalibur