Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: How do I set a location?
How do I set a location?
Mar 3 2010, 3:21 am
By: bman427  

Mar 3 2010, 3:21 am bman427 Post #1



How do I set a location?
I want to make a Human vs Comp type diplo map. How do I set a location so when you have a building of some kind that you gain x amount of minerals every minute or so.
I have searched, but I keep on getting how to set a start location.

I am also having trouble with the ai doing some weird things, would I be better off having 2 ai slots, one is defending, and one is harassing?

I am new, and it is my first post, but I plan on staying here through SC2. I just started map making a couple days ago.



None.

Mar 3 2010, 3:23 am Aristocrat Post #2



Using hyper triggers, if player brings 1 building to that location, add 1 warp gate death count or similar.

When warp gate death count reaches some number, set DC to zero and add minerals.



None.

Mar 3 2010, 3:24 am Vrael Post #3



When you post, you probably want to provide more specific information so we can help you better.

If you just cant figure out how to place a location, first, what map editor are you using? SCMDraft2 is highly recommended, it's the best. On layer, click "location" at the top command bar, then simply click on the map and drag your mouse as large as you like.

Also, since you're new, I advise reading over this topic: http://www.staredit.net/topic/7783/
as well as the links it contains.

One critical concept to mapmaking is the death counters, I highly advise you read over that section in the FAQ topic. They can be used as virtual timers, counters, to do math, ect. Read over the death counter material, try again on your own and if you still can't get any further come back with what you can't figure out.



None.

Mar 3 2010, 1:50 pm bman427 Post #4



Ok, I have read the FAQ, but I don't think I am understanding how the Death Counter can be used. Will I be destroying a building that the player can't see too add to this money?

Also is the count down timer any use here?

I tried SCMDraft2, but it always crashes on every map, so now I am just using staredit

Post has been edited 1 time(s), last time on Mar 3 2010, 2:05 pm by bman427.



None.

Mar 3 2010, 2:00 pm JaFF Post #5



Read the death counter wiki.

countdown timer is useful. You can just add the money when it hits some value, say, 1 second, then set it back to, say, 60 seconds.



None.

Mar 3 2010, 2:05 pm Oo.DaMeiN.oO Post #6



Nah, death counters do not require you to blow a building up.

Once you get used to them they are fairly easy to use, heres a way you can do it via a timer.

Code
Trigger("Player 1"){
Conditions:
    Command("Current Player", "Terran Barracks", At least, 1);
    Deaths("Current Player", "Alan Schezar (Goliath)", Exactly, 0);
    Deaths("Current Player", "Alan Turret", Exactly, 0);

Actions:
    Set Deaths("Current Player", "Alan Schezar (Goliath)", Set To, 96);
    Set Deaths("Current Player", "Alan Turret", Set To, 1);
    Preserve Trigger();
}


Quote
Command("Current Player", "Terran Barracks", At least, 1);
This line states that the current player MUST own this building in order to receive the minerals.

Quote
Deaths("Current Player", "Alan Schezar (Goliath)", Exactly, 0);
This line is going to be used for our countdown timer, at this time it needs to be 0

Quote
Deaths("Current Player", "Alan Turret", Exactly, 0);
This line is like a placement holder, it makes sure the trigger does not repeat until the allotted time.

Quote
Set Deaths("Current Player", "Alan Schezar (Goliath)", Set To, 96);
Now that we have the conditions met, we have to start the timer. That is what this is for, 96 deaths is approximately 10 seconds.

Quote
Set Deaths("Current Player", "Alan Turret", Set To, 1);
Now we have to set this to hold the place, just to make sure the trigger does not keep setting the timer to 10 seconds over and over, not allowing for it to countdown.


Okay, so now we have the starting of our trigger, the initial countdown timer and now we have to make it countdown :)


Code
Trigger("Player 1"){
Conditions:
    Deaths("Current Player", "Alan Schezar (Goliath)", At least, 1);

Actions:
    Set Deaths("Current Player", "Alan Schezar (Goliath)", Subtract, 1);
    Preserve Trigger();
}


This is the trigger for making it countdown.

Quote
Deaths("Current Player", "Alan Schezar (Goliath)", At least, 1);
This line states that if the current player has suffered a death of at least 1 of the countdown timer to do the following:

Quote
Set Deaths("Current Player", "Alan Schezar (Goliath)", Subtract, 1);
This is the part that makes it countdown, because we are subtracting 1 death of the 96.


Now that we've made it countdown we need to make it award the minerals after 10 seconds.


Code
Trigger("Player 1"){
Conditions:
    Deaths("Current Player", "Alan Schezar (Goliath)", Exactly, 0);
    Deaths("Current Player", "Alan Turret", Exactly, 1);
    Command("Current Player", "Terran Barracks", At least, 1);

Actions:
    Set Deaths("Current Player", "Alan Turret", Set To, 0);
    Set Resources("Current Player", Add, 50, ore);
    Preserve Trigger();
}

This is the trigger to award the minerals after the allotted time.

Quote
Deaths("Current Player", "Alan Schezar (Goliath)", Exactly, 0);
This lane states that the countdown must reach 0 of 96

Quote
Deaths("Current Player", "Alan Turret", Exactly, 1);
Remember the place holder? It must be at 1 to activate the following:

Quote
Command("Current Player", "Terran Barracks", At least, 1);[/code]
This is to make sure that they still have the Barracks before awarding them.

[quote]
Set Deaths("Current Player", "Alan Turret", Set To, 0);
We need to clear the place holder in order to repeat the timer
(If you only want it to happen once you can merely change it to

Quote
Set Deaths("Current Player", "Alan Turret", Set To, 2);
And this will ensure that it wont run again, because the starting trigger requires a 0.

Quote
Set Resources("Current Player", Add, 50, ore and gas);
And finally we have the awarded minerals :)


Any questions let me know :)

Oh, you should also add this so that if they lose their building that it stops the awarding of minerals.

Code
Trigger("Player 1"){
Conditions:
    Command("Current Player", "Terran Barracks", Exactly, 0);

Actions:
    Set Deaths("Current Player", "Alan Schezar (Goliath)", Set To, 0);
    Set Deaths("Current Player", "Alan Turret", Set To, 0);
    Preserve Trigger();
}


And finally, the last but not least thing is Hypertriggers. In order for deathcounters to work efficiently you MUST use these. With that being said, you can no longer use Waits in your triggers or your map will glitch.

To do a Hypertrigger simply make a trigger that looks like this

Code
Trigger("Player 1"){
Conditions:
    Always();

Actions:
    Wait(0);
    Preserve Trigger();

And copy the preserve 62 times (Or 63 if you don't plan on using comments, which in this case it would be really bad not to :) ) and then copy the whole trigger about three times.

There is an example map attached :P

Attachments:
DeathCounterExample.scm
Hits: 1 Size: 39.09kb

Post has been edited 5 time(s), last time on Mar 3 2010, 2:35 pm by Oo.DaMeiN.oO.



None.

Mar 3 2010, 11:23 pm bman427 Post #7



From above ^

Thanks for the help, it really help me understand to have an example. I will try to figure out the rest.

Thanks again for your time and knowledge.



None.

Mar 4 2010, 12:02 am Lanthanide Post #8



96 deaths is just a smidge over 8 seconds at Fastest, and 12 seconds at Normal speed. At fastest you get ~11.9 trigger loops per second, so 10 seconds is 119 deaths, not 96.


The "placement holder", Alan Turret, is unnecessary.

Boiled down:
Trigger 1: Always, subtract 1 from counter
Trigger 2: If counter = 0, give minerals, set counter to 119.

That's all you need.

If you want to have a timer that is only triggered after some event:
Trigger 1: Always, subtract 1 from counter
Trigger 2: Event has occurred, set counter to 120
Trigger 3: If counter = 1, give minerals

On the trigger loop after the minerals are given, the counter will be at value 0, where nothing happens. Note that with the triggers as shown, if the event from trigger 1 happens during the countdown, the countdown will be reset to 120 and the player will not get the minerals from trigger 3; which may or may not be what you want. If you don't want the timer to reset, then you would want a condition "countdown = 0" in trigger 1. If you want to 'stockpile' events up, then you'd want something like this:

Trigger 1: If event occurred, add 1 event occurred
Trigger 2: Always, subtract 1 countdown
Trigger 3: If event occurred at least 1 and countdown = 0, subtract 1 event occurred, set counter to 120
Trigger 4: If countdown = 1, add minerals



None.

Mar 4 2010, 4:51 am bman427 Post #9



I got a second question, I don't want to make a new thread so I hope people see this.

But I have gave the ai scripted for Terran Campaign Insane, the ai was not aggressive and was hardly a challenge and barely building anything even though I gave them 9999999 ores/gas. So I tried the Custom Terran, etc..all of them and they all are not a challnge. I also set it for 4 humans(with a big disadvantage from some things) vs4 comps.

I have disable some tech/upgrades, units that can't be produce. Is that the problem?



None.

Mar 4 2010, 5:11 am Vrael Post #10



In the future, if you have 2 mapmaking concerns that are mostly unrelated (like AI scripts and death counts, as per this thread) just make a 2nd thread for the 2nd question. It helps us keep our material and topics organized, especially for when other people search the forums for similar problems.

I advise you to read over this: http://classic.battle.net/scc/faq/aiscripts.shtml
Which was also in the FAQ under "AI Scripts"



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[12:34 pm]
NudeRaider -- curiosity kills the cat!
[06:18 am]
Sylph-Of-Space -- No complaints here, i'm just curious!
[11:05 pm]
Ultraviolet -- :wob:
[2024-5-18. : 3:55 pm]
Zoan -- :wob:
[2024-5-18. : 10:34 am]
NudeRaider -- SEN doesn't rely on spammers initiate its sleep cycle. It hat fully automated rest and clean-up phases. Please understand that this is necessary for the smooth operation of the site. Thank you.
[2024-5-18. : 3:45 am]
Sylph-Of-Space -- Does the shoutbox get disabled when there's spammers?
[2024-5-17. : 6:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[2024-5-17. : 5:41 am]
Ultraviolet -- 🤔 so inf is in you?
[2024-5-17. : 4:57 am]
O)FaRTy1billion[MM] -- my name is mud
[2024-5-17. : 4:35 am]
Ultraviolet -- mud, meet my friend, the stick
Please log in to shout.


Members Online: Roy, belzussmch, NudeRaider