Random Switches
Jan 1 2008, 10:54 pm
By: Kaleidx  

Jan 1 2008, 10:54 pm Kaleidx Post #1



Alright, so I'm using random switches to randomize 2 different switches. The randomizing is to get a random countdown timer set .. but I seem to be getting a little confused on this concept. There are a couple problems I'm running into.

At a certain point in my map, when current player brings [men] to loc the switch to begin the randomization is set. i.e. BeginRandomTimer is set Randomize switch1, switch2 and to stop it from continuing to randomize, I clear BeginRandomTimer .. but unfortunately I would like this to loop in a way where countdown timer is at most 1 second, there would be a small break and then reset BeginRandomTimer to get another loop. I think I got that part down right but I just thought I'd explain in case that somehow has something to do with my problem.

Now I'm sure you know that switches start out cleared and since that would be an outcome of randomization, I have to set an outcome for that event. The problem is, that means it'll happen at the very beginning of the map.
Another event that seems to interfere with that is since I'm trying to loop it so after the first timer runs out, a second timer starts .. I have to preserve the "BeginRandomTimer is Set" , "Randomize switch1, switch2"
I have to clear both switches after the action so the countdown timer -isn't- permenantly set as if it is frozen.

BeginRandomize
--
"BeginRandomTimer" is set
-
Randomize "switch1"
Randomize "switch2"
--

Outcome1
--
"switch1" is set
"switch2" is cleared
-
Set Countdown Timer to 180 seconds
Clear "switch1"
Clear "switch2"
--

So then of course that'll just loop to the event where both switches are cleared. So I think you can see my dilema. :flamer: Do you think I should just use a different method for my randomization? Or any suggestions on how to fix my problem would be really appreciated.

Post has been edited 1 time(s), last time on Jan 1 2008, 11:44 pm by Kaleidx.



None.

Jan 1 2008, 11:23 pm fm47 Post #2



I dont entirely understand your situation, but you could use death counters to determine when or how often you want it to randomize/reset the timer.



None.

Jan 1 2008, 11:25 pm who Post #3



Have the outcomes only occur when "BeginRandomTimer" is set, and clear it at the end of every outcome.



None.

Jan 2 2008, 1:18 am NudeRaider Post #4

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

I hope I figured correctly what you want. However, here's my solution:

Conditions:
Current Player brings at least 1 civ to 'beacon'
Switch 'BeginRandomTimer' is cleared
DC 'cooldown' is 0 for <comp player> (optional)
Actions:
Set Switch 'BeginRandomTimer'
Set Countdown Timer to 10s

Conditions:
Switch 'BeginRandomTimer' is set
Countdown timer is at least 1s
Actions:
<randomize switches>

Outcome #1
Conditions:
Switch 'BeginRandomTimer' is set
Countdown timer is at most 0s
Switch 1 is set
Switch 2 is set
Actions:
Clear Switch 'BeginRandomTimer'
Set Countdown Timer to 180 seconds
Clear "switch1"
Clear "switch2"
Set DC 'cooldown' to 20 for <comp player> (optional)

Outcome #2
Conditions:
Switch 'BeginRandomTimer' is set
Countdown timer is at most 0s
Switch 1 is set
Switch 2 is cleared
Actions:
Clear Switch 'BeginRandomTimer'
Set Countdown Timer to 80 seconds
Clear "switch1"
Clear "switch2"
Set DC 'cooldown' to 20 for <comp player> (optional)

Cooldown Counter (optional)
Always
Subtract 1 from DC 'cooldown' for <comp player>


The grey part is optional if you want some delay after the 10s randomization so the player can't activate it right after the first loop.

EDIT: Hehe, lol I guess someone09 answered it already but I realized it only when I was finished. ;)




Jan 2 2008, 3:52 am Falkoner Post #5



http://Falkoner.CoW.GooglePages.com/Switches.html

You're using the Basic Switch Randomization.

Now, I think a problem you have is that the condition that it's cleared is met as soon as the map starts, so just make sure there's an extra condition, other than just the combination of switches.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2026-7-18. : 2:27 am]
Symmetry -- https://staredit.net/topic/18903/ THE REVIEWS ARE HERE! "ok these are pretty good memes" - ssj9Kevin
[2026-7-17. : 2:58 pm]
Ultraviolet -- Symmetry
Symmetry shouted: Man I wish we had this tech back in the day when people played ums lmao
fr fr
[2026-7-17. : 2:39 am]
Symmetry -- Man I wish we had this tech back in the day when people played ums lmao
[2026-7-16. : 6:28 am]
NudeRaider -- EUD actions, specifically. The conditions remained. Today we can even have actions again, but they're all virtualized/whitelisted (not sure on the actual technical implementation) so you can only use them for specific intended purposed, not arbitrary code injections.
[2026-7-16. : 6:26 am]
NudeRaider -- I mean yes, maps - through EUDs - were theoretically able to do that as well, but that was patched quickly.
[2026-7-16. : 6:25 am]
NudeRaider -- Symmetry
Symmetry shouted: Ohhh imagine a SC map that could delete itself
not the map, the editor
[2026-7-16. : 2:28 am]
Symmetry -- I vaguely remember Voy doing some ACE back in the day, but I had no idea EUDs could do that kind of shit. I am very much catching up on the technology
[2026-7-16. : 2:28 am]
Symmetry -- Ohhh imagine a SC map that could delete itself
[2026-7-15. : 8:51 pm]
NudeRaider -- Symmetry
Symmetry shouted: NudeRaider Is EUD editor capable of writing shit onto the player's harddrive? That seems like it would be dangerous
yeah an editor that isn't allowed to write files sounds rather pointless, so I'd assume it can. Like most other programs too btw. and yes, obviously that's dangerous, but also kinda necessary. MS introduced that virtualization for exactly that reason.
[2026-7-15. : 4:10 am]
Ultraviolet -- I don't think so. I think they shut that shit down after 1.16, maybe even earlier
Please log in to shout.


Members Online: Roy