[Trigger] Randomly occuring events

Status
Not open for further replies.
Level 7
Joined
Sep 24, 2008
Messages
281
Hello hiveworkshop community, I was wondering if anyone here knew how to create events which occur a random times throughout a game (but not starting untill, as an example, one minute has passed.) An example would be parasite two, in which meteor showers and space storms (whatever) occur at random points. Thanks:grin:
 
The system used in that map, last time I checked, was unoptional and not very reliable.

The ideal system I would make by having a timer fire every minute. In it, it chooses a random disaster via random number comutation, out of a section of many with a few dummy ones which do nothing. After performing the disaster, it will then have a cool off time whereby another can not occur to stop bad luck resulting in multiple in a row. Finally it resumes back to its 1 minute luck process.
 
The system used in that map, last time I checked, was unoptional and not very reliable.

The ideal system I would make by having a timer fire every minute. In it, it chooses a random disaster via random number comutation, out of a section of many with a few dummy ones which do nothing. After performing the disaster, it will then have a cool off time whereby another can not occur to stop bad luck resulting in multiple in a row. Finally it resumes back to its 1 minute luck process.
So how would I go about doing that? :confused:
 
I guess you could make a periodic events, which generates a random number every 5-10 minutes of gameplay. For Example:

Event would be a periodic timer every 5-10 mins

Action would be to make an integer variable, then set it to a random number between 1 and however many events there are :)

Then you could simply list a load of IF statements:

e.g.

If random number = 1, then start trigger Event01
If random number = 2, then start trigger Event02

and so on :) you can just repeat that for however many random events youve made.

If you want me to provide an example of the exact triggers, let me know :) Im just too lazy to do it now :P

hope this helps!
 
Thanks, I'll try it out

Perphaps an example would be helpfull as I really have no idea how to do what you have just suggested.
 
Last edited by a moderator:
Trigger number one:
  • Events
  • Map Initialization
  • Conditions
  • Actions
  • Timer - Start timer as a one shot timer set to expire in one minute
Trigger number two
  • Events
  • Timer - timer expires
  • Conditions
  • Actions
  • Custom script: do_stuff()
  • Timer - Start timer as a one shot timer set to expire in (Random integer between 1 and 10) minutes
How about that?
 
Trigger number one:
  • Events
  • Map Initialization
  • Conditions
  • Actions
  • Timer - Start timer as a one shot timer set to expire in one minute
Trigger number two
  • Events
  • Timer - timer expires
  • Conditions
  • Actions
  • Custom script: do_stuff()
  • Timer - Start timer as a one shot timer set to expire in (Random integer between 1 and 10) minutes
How about that?
Number one works, assuming that "timer" is a variable. number two however, I am having trouble with. How can I make it an integer, instead of a number?
 
Do you mean integer instead of a real?
Conversion - Real to integer

  • Events
    • Time - timer expires
    • Conditions
    • Actions
      • Countdown Timer - Start timer as a One-shot timer that will expire in (Real((Random integer number between 1 and 10))) seconds
 
  • Rep if I helped you
    • Events
      • Time - Elapsed game time is 60.00 seconds
    • Conditions
    • Actions
      • Wait (Random real number between 100.00 and 500.00) seconds
      • Set IntegerVar = (Random integer number between 1 and 3)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IntegerVar Equal to 1
        • Then - Actions
        • Do Something
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IntegerVar Equal to 2
            • Then - Actions
            • Do Something Else
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • IntegerVar Equal to 3
                • Then - Actions
                • Do Something Totally Different
                • Else - Actions
      • Trigger - Run (This trigger) (ignoring conditions)
 
  • Rep if I helped you
    • Events
      • Time - Elapsed game time is 60.00 seconds
    • Conditions
    • Actions
      • Wait (Random real number between 100.00 and 500.00) seconds
      • Set IntegerVar = (Random integer number between 1 and 3)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IntegerVar Equal to 1
        • Then - Actions
        • Do Something
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IntegerVar Equal to 2
            • Then - Actions
            • Do Something Else
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • IntegerVar Equal to 3
                • Then - Actions
                • Do Something Totally Different
                • Else - Actions
      • Trigger - Run (This trigger) (ignoring conditions)

this mean every 60 seconds of game time it will wait for another 100/500 seconds which mean the trigger will fire every 60 seconds or never at all and ignoring conditions mean that all actions will fire at once. I think u just done nothing at all and asking for rep is forbiden. Stop posting triggers that u never test if they work or not, otherwise u look stupid just like this one:ugly:

  • Events
    • Time - every (Random real number between 60.00 and (the max time u wan't)) seconds
    • Conditions
    • Actions
      • Set IntegerVar = (Random integer number between 1 and 3)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IntegerVar Equal to 1
        • Then - Actions
        • Do Something
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IntegerVar Equal to 2
            • Then - Actions
            • Do Something Else
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • IntegerVar Equal to 3
                • Then - Actions
                • Do Something Totally Different
                • Else - Actions
 
this mean every 60 seconds of game time it will wait for another 100/500 seconds which mean the trigger will fire every 60 seconds or never at all and ignoring conditions mean that all actions will fire at once. I think u just done nothing at all and asking for rep is forbiden. Stop posting triggers that u never test if they work or not, otherwise u look stupid just like this one:ugly:

  • Events
    • Time - every (Random real number between 60.00 and (the max time u wan't)) seconds
    • Conditions
    • Actions
      • Set IntegerVar = (Random integer number between 1 and 3)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IntegerVar Equal to 1
        • Then - Actions
        • Do Something
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IntegerVar Equal to 2
            • Then - Actions
            • Do Something Else
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • IntegerVar Equal to 3
                • Then - Actions
                • Do Something Totally Different
                • Else - Actions


Read plixplox ''Time - Elapsed game time is 60.00 seconds'', so please read my trigger first b4 commenting. just the ignoring conditions was wrong, and fine. I wont help an other soul if that is what you want. And if I remember correct, putting random numbers in the ''Time - every'' bugs..
 
Status
Not open for further replies.
Back
Top