Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: make the cpu ally and de-ally
make the cpu ally and de-ally
This topic is locked. You can no longer write replies here.
Sep 4 2009, 10:19 pm
By: emepetres  

Sep 4 2009, 10:19 pm emepetres Post #1



:stfu: I´m having problems when doing this :
When player 1 places any unit in location1, CPU must ally player 1. When there are no units in location1, CPU is enemy.
When player 1 places any unit in location2, CPU turns into enemy of player 1. When there are no units in location2, CPU is his ally.
As you see these triggers makes the CPU be an ally at the very beginning.
In addition, I put a command that kills every unit in both locations if player 1 sends units to both places.
I used switches for all these triggers, I´m not well versed on making my own UMS maps. And the computer starts without attacking me, so it begins fine, but never changes the alliance status. I would appreciate any help. :-(



None.

Sep 4 2009, 10:50 pm Kaias Post #2



Can you post the actual triggers (relevant to what you're trying to do) you used? You can copy from the text editor if you're using Scmdraft



None.

Sep 5 2009, 6:52 pm poison_us Post #3

Back* from the grave

Since the computer-allying works, I'm continuing to the unally. You need the trigger owner to be the computer who is allying, and it needs to have the action "set player 1 to enemy" or an equivalent.




Sep 6 2009, 7:44 am emepetres Post #4



:D Actually, i´d been using the X-tra editor but now I´m trying that SCMdraft and I located that option... this editor seems more interesting,
Here you have :
* "PLAYER 1" ( this is me)
* "LOS RETADORES" (Force 1) ----> including PLAYER 1
* "Deidad Maxima" (Force 4 only player 6 controlled by computer)
well there you go : :ermm:

Trigger("Player 1"){
Conditions:
Bring("Player 1", "Any unit", "Centro templo", At least, 1);

Actions:
Set Switch("Switch11", set);
Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1"){
Conditions:
Bring("Player 1", "Any unit", "nadie1", At least, 1);

Actions:
Set Switch("Switch11", clear);
Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1"){
Conditions:
Bring("Player 1", "Any unit", "Centro templo", Exactly, 0);

Actions:
Set Switch("Switch11", clear);
Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 1"){
Conditions:
Bring("Player 1", "Any unit", "nadie1", Exactly, 0);

Actions:
Set Switch("Switch11", set);
Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("\x003Los Retadores"){
Conditions:
Bring("Current Player", "Any unit", "Centro templo", At least, 1);
Bring("Current Player", "Any unit", "nadie1", At least, 1);

Actions:
Kill Unit At Location("Current Player", "Any unit", All, "Centro templo");
Kill Unit At Location("Current Player", "Any unit", All, "nadie1");
Kill Unit At Location("Current Player", "Any unit", All, "nadie2");
Kill Unit At Location("Current Player", "Any unit", All, "nadie3");
Preserve Trigger();
}

//-----------------------------------------------------------------//


Trigger("\x001Deidad Máxima"){
Conditions:
Switch("Switch11", not set);

Actions:
Set Alliance Status("Player 1", Enemy);
Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("\x001Deidad Máxima"){
Conditions:
Switch("Switch11", set);

Actions:
Set Alliance Status("Player 1", Ally);
Preserve Trigger();
}

//-----------------------------------------------------------------//


:rolleyes: These are the triggers I used, and I also put these ones because i wanted to know if the triggers were activating : :rolleyes:

Trigger("\x003Los Retadores"){
Conditions:
Switch("Switch11", set);

Actions:
Display Text Message(Always Display, "Switch activado");
Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("\x003Los Retadores"){
Conditions:
Switch("Switch11", not set);

Actions:
Display Text Message(Always Display, "Switch desactivado");
Preserve Trigger();
}

//-----------------------------------------------------------------//


:unsure: At the very begining of the game it says "switch activado" since switch 11 is set, and the computer called "Deidad maxima" doesnt attack me.
when i take a unit to "centro templo" it doesnt change, it keeps saying "switch activado"
when i take a unit to "nadie1" it DOES change, it reads : "switch desactivado" which means switch 11 is cleared. :omfg: BUT the computer called "Deidad maxima" never attacks me and i am in front of his soldiers...

Please need help ... if you need more info i can get it, again , i am just starting to play with these ums maps and i have many things to learn.



None.

Sep 6 2009, 9:04 am dpp89 Post #5



That seems like a lot of work for simple "unally" and "ally" triggers.

have you tried this?

PLAYER:
You+Person you're allying

COND:
Current player brings (x amount) of (unit) to (location)

ACTION:
(SetAllyStatus) Set (Player 1) to (option[ally/enemy/ally vic])
(SetAllyStatus) Set (Player 2) to (option[ally/enemy/ally vic])
Preserve Trigger

And then to unally, change to "enemy" instead of "ally" in a new trigger with a new location... I think...
Edit: pretty cool too: if you leave that unit on that location so it preserves the trigger, it'll become really hard to target your ally without unallying him. (hyper triggers make it impossible to attack an ally)

Post has been edited 1 time(s), last time on Sep 6 2009, 9:11 am by dpp89.



None.

Sep 6 2009, 1:49 pm poison_us Post #6

Back* from the grave

EDIT: wow, my whole last post was garbage. empetres, trigger syntax runs p1-p8, top to bottom, and you're telling the computer to unally, then re-ally. You've got one trigger saying that the computer unallies if there's someone in location x, and then a little further down you've got it so if nobody's in location y, it allies back. It is unallying, but nothing is happening because it re-allies almost instantly.

Also, a better test would be:
Checks the number of enemies p1 has


Your method checks if the switch is set, and this one checks if p1 has enemies.

EDIT 2: basically the only way to solve this would be to move the "exactly 0" conditions above the "at least 1"s. Otherwise, they will always ally.

Post has been edited 3 time(s), last time on Sep 7 2009, 6:10 pm by poison_us.




Sep 6 2009, 5:55 pm emepetres Post #7



Ok... your ideas are interesting. :)

I´m going to try that dpp89 seems easier and looks like it´s going to work.
Poison_us im going to change that text in order to know effectively whether if the alliance is working or not.

I´m letting you know how it worked, thanks to all of you. :rolleyes:
[/quote]basically the only way to solve this would be to move the "exactly 0" conditions above the "at least 1"s[quote]
P.D.: I have already tried that, in fact I had the condition saying "at least 1" then i changed it to "exactly 0". No difference. :unsure:



None.

Sep 7 2009, 6:10 pm poison_us Post #8

Back* from the grave

Quote from poison_us
trigger syntax runs p1-p8, top to bottom

What I'm saying is that the trigger containing the "exactly 0" condition should be the topmost trigger. Switch the entire trigger, not just the conditions.




Sep 7 2009, 8:56 pm emepetres Post #9



:D Thanks to all of your tips, i remade all the triggers, and now it´s working perfectly. I don´t really know what happened before but maybe was what you said poison_us "trigger syntax runs p1-p8, top to bottom" I didn´t get it at first, now I can´t be sure. :><:
Now my map is in good shape. I had made it so complicated, but now looks easier, thanks again. bye

Until another bug appears...



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[04:05 am]
O)FaRTy1billion[MM] -- the setting exists, it's just hidden in a weird place
[04:04 am]
O)FaRTy1billion[MM] -- instead change "Microtile Overlay" to "Impassable"
[04:04 am]
O)FaRTy1billion[MM] -- er, wait, idk why i was looking for height
[04:03 am]
O)FaRTy1billion[MM] -- below the minimap should be a thing that says "Overlay Settings" with a little + button in the corner, press the + to expand it, uncheck Use Defaults, then change "Tile Overlay" to "Height"
[03:57 am]
Sylph-Of-Space -- Unless I'm dum (possible)
[03:57 am]
Sylph-Of-Space -- It would be so so so nice if SCMDraft had some kind of dedicated "walkability" view for the tilesets.
[03:53 am]
Sylph-Of-Space -- :'( dont cry for me cat-gentina
[09:18 pm]
Ultraviolet -- 🔪🐈
[12:34 pm]
NudeRaider -- curiosity kills the cat!
[06:18 am]
Sylph-Of-Space -- No complaints here, i'm just curious!
Please log in to shout.


Members Online: O)FaRTy1billion[MM], Sylph-Of-Space, Roy, RIVE