PDA

View Full Version : random switch


darkwhale
11-27-2007, 7:53 PM
Hi I bean reading tutorials on map making
I need help to set up a random unit trigger that makes 4 units randomly and works each time player 8 (cp) brings plane to a location.
O ya and does any one know were i can find a list on the extra AI scrips in scmdarf I am so lost?:D

Ling666
11-27-2007, 8:51 PM
Cond:
Always;
Actions:
Set Switch 1 Randomize
Set Switch 2 Randomize
Comment(Initial Switch Settings)

Cond:
Bring Current Player, At Least 1, Plane, Location Wherever
Switch 1 is set
Switch 2 is set
Actions:
Set Switch 1 Randomize
Set Switch 2 Randomize
Remove 1 Plane owned by Current Player at Location Wherever
Create Unit 1 At Wherever

Cond: Bring Current Player, At Least 1, Plane, Location Wherever
Switch 1 is cleared
Switch 2 is set
Actions:
Remove 1 Plane owned by Current Player at Location Wherever
Create Unit 2 At Wherever
Set Switch 1 Randomize
Set Switch 2 Randomize

And so on for the other two with Switch 1 Set and Switch 2 Cleared, as well as for Switch 1 Cleared and Switch 2 Cleared. You can do this with more switches too, and the units you can make increase by twice as much each time, but you have to have a trigger for every possible settings of the switches.

As for the AI scripts, I have no idea, I haven't messed with SCMDraft's AIs.

SilverCrusader
11-27-2007, 10:07 PM
Here is a map a made that shows the fundamentals of randomization.

darkwhale
11-28-2007, 6:24 PM
I am sorry to say we have a negative on that.
Did it the same way on my little trigger testing map(I started testing triggers an stuff on small maps before putting them at the intended destination )
\= Don't think scmdarft 2 is working buggy ea there.:D

Ling666
11-29-2007, 12:25 AM
Well if it doesn't work in the test map you could always post it so someone might find an error.

darkwhale
11-29-2007, 9:32 PM
Thanks for the help, the hole thing basicaly the one in the map suets my needs I just changed the a condition in the 1st action to give the overlord to a neutral player. I edited a little so 4 units get made per condition instead of one. I don't what them to get picked off one at time.:D

condition
player brings units bla bla
action
randomize switch 1
randomize switch 2
set switch 3
give unit to player bla
preserve trigger


condition
switch 1 cleared
switch 2 cleared
switch 3 set
action
create unit m
create unit f
create unit t
create unit m
clear switch3
preserve trigger

condition
switch 1 set
switch 2 cleared
switch 3 set
action
create unit f
create unit g
create unit g
create unit m
clear switch3
preserve trigger

condition
switch 1 cleared
switch 2 set
switch 3 set
action
create unit m
create unit m
create unit t
create unit t
clear switch3
preserve trigger

condition
switch 1 set
switch 2 set
switch 3 set
action
create unit t
create unit g
create unit g
create unit m
clear switch3
preserve trigger

SilverCrusader
11-29-2007, 9:53 PM
Why is switch 3 always set?

darkwhale
11-29-2007, 10:19 PM
Why is switch 3 always set?

Not a clue its called guard in the example.:concern:

SilverCrusader
11-29-2007, 10:44 PM
Well it is kind of unneeded. If you have a condition that states if so and so brings such and such unit to location X. And then you remove it from the location. Well the conditions are no longer met and the guard trigger is unneeded. Guard switches only come in handy... Well almost never.

Ling666
11-30-2007, 1:37 AM
Doesn't make much sense here either.

darkwhale
11-30-2007, 3:03 PM
I when back to see what it does for this instance if u leave out stet guard and clear guard and have preserve triggers it makes units endlessly, until the condition is met then it randomly picks the next unit to be made endlessly.:)

Ling666
11-30-2007, 5:26 PM
It shouldn't work like that. When the unit gets removed, the conditions are no longer met, and it should stop. Just make sure that in the conditions it requires there to be a unit there, and then remove that unit in the actions. You must have "Bring at least/most/exactly number of type of unit to location" otherwise the trigger will keep going even if the unit isn't there. Also, you need to add an action of removing that unit in the action list.

"condition
[Problem right here, it doesn't require the unit to be brought to that location. Add Bring Player etc. etc.]
switch 1 cleared
switch 2 cleared
switch 3 set
action
[Another problem, it needs to remove that unit]
create unit m
create unit f
create unit t
create unit m
clear switch3
preserve trigger"

It should work fine after that and you won't need switch 3.

darkwhale
12-01-2007, 12:44 AM
I see what u mean it works but with out a preserve trigger at the end i get the same units.

Cond:
Always;
Actions:
Set Switch 1 Randomize
Set Switch 2 Randomize
--------------(preserve)-------------
Comment(Initial Switch Settings)

IF this is more efficient I got I got about 50 triggers to redo in my map.
Sweet while were on switches usind a ling and switches to to move units to a location when they get to ship the is labeled as a location.


I got this for each type of unit
Cond
Player brings unit to x unit
player 8 comp brings ling to location 1
action
set switch 1



Con
switch 1 cleared
action
move all unit x1 to landing bay
move all unit x2 to landing bay
ans so on the
-
-
-
-
-
Center view at location
preserve trigger

I had a set up like this for 2 forces with the same triggers.
They stopped working for force one I change force from switches to normal conditions and action. Force twos triggers worked, but then after some editing they stop working I did not even change them.

darkwhale
12-01-2007, 12:19 PM
\=

I just got this from the same map to day;

Warning: Trigger property usage out of sync
(May be caused by having previously editing the map in an editor which does not
properly follow CHK format.

Ling666
12-01-2007, 5:09 PM
I get that from SCMDraft a bit. It hasn't done anything bad for me yet though.

darkwhale
12-01-2007, 7:36 PM
Ya but it's not letting me edit triggers any more nvm.

darkwhale
12-02-2007, 12:21 AM
Thanks for the help guys.(=

SilverCrusader
12-02-2007, 9:15 AM
Ohh, thats SCM Draft corrupting for ya'. Just open the map in StarEdit, save it. And then open it back up in SCM Draft. StarEdit is your friend for fixing unintentional corruption.