Trashmas
  • Trashmas
  • 50.25% (Neutral)
  • Private Topic Starter
11 years ago
Hello,

Can somebody tell me how to make RANDOM counter on WB? I tried with Random Seconds Timer and Random Frame Timer but it doesn't work.

*** IF ***
True.
*** THEN ***
Set timer 'Random7' to expire between 0 and 2 frames.

*** IF ***
Counter 'Random7' IS Equal To 1
*** THEN ***
Set Flag named 'GiveADropItem' to TRUE



True.
*** THEN ***
Set timer 'Random7' to expire between 0 and 2 seconds.

*** IF ***
Counter 'Random7' IS Equal To 1
*** THEN ***
Set Flag named 'GiveADropItem' to TRUE


Sponsor
klingondragon
11 years ago
Have you made sure that the activation conditions are correct
Trashmas
  • Trashmas
  • 50.25% (Neutral)
  • Private Topic Starter
11 years ago

Have you made sure that the activation conditions are correct

Originally Posted by: klingondragon 



aren't?

timers set counters to 1 or 2, maybe 0, so chance is 1/3, but i tried 20 times the scripts in the game, but they doesn't work.

maybe other script can make random counter?
klingondragon
11 years ago
i meant the ifs and also the conditions like run script every frame and deactivate upon success are what they need to be
also is it skirmish or mission
Trashmas
  • Trashmas
  • 50.25% (Neutral)
  • Private Topic Starter
11 years ago

i meant the ifs and also the conditions like run script every frame and deactivate upon success are what they need to be
also is it skirmish or mission

Originally Posted by: klingondragon 



UserPostedImage

Mission, of course
klingondragon
11 years ago
Trashmas
  • Trashmas
  • 50.25% (Neutral)
  • Private Topic Starter
11 years ago

Your script is not active

Originally Posted by: klingondragon 



This script active by other script (activated)
klingondragon
11 years ago
Does the activation script activate a subroutine script or a normal script
Trashmas
  • Trashmas
  • 50.25% (Neutral)
  • Private Topic Starter
11 years ago

Does the activation script activate a subroutine script or a normal script

Originally Posted by: klingondragon 



Simple script ("Enable Script...")

I tested frame timer on a simple map:

*** IF ***
True.
*** THEN ***
Set timer 'timer' to expire between 1 and 2 frames.


*** IF ***
Timer 'timer' has expired.
*AND* Counter 'timer' IS Equal To 2
*** THEN ***
Team 'team0001' is dealt a lethal amount of damage.



No effect. it work only if i set "Equal to 1". i think it cant give a random counter......
Gameanater
11 years ago


UserPostedImage

Originally Posted by: - 



Your script is not active

Originally Posted by: - 

Originally Posted by: - 



Not only that, but if they DO end up working, you're gonna get a ton of lag because it's constantly working on the script every single millisecond in-game.

Anyway, if it's being activated by another script, maybe that script's not working right. If it is, then I don't know why it's not doing anything.
Any old friends still on here can add me on discord @jcdenton2187. I'm far more likely to respond there.
Trashmas
  • Trashmas
  • 50.25% (Neutral)
  • Private Topic Starter
11 years ago
No lags, if a lot of scripts with every frame-check only.

So no more ideas with random counter?
Pasha
  • Pasha
  • 50.25% (Neutral)
  • Captain
11 years ago
I made a simple AOD map to show how you can use Random.

Randomly, Overlords (as team3) or Comanches (as team2) or Quad Cannons (as team1) are spawn and attack in Attack_Area.


AOD Random_v_02.zip has 2 players and AI must be GLA.
SetStartTime script sets a time to define when RandomTime will assign.
SetRandomTimer Script sets RandomTime to expire between 1 and 3 frames,
According to RandomTime value Random1 or Random2 or Random3 scrips run.

I tried 10 times and all worked.

You will understand when you open map with WorldBuilder and read scripts.

I hope I could help 😉   AOD Random_v_02.zip (4kb) downloaded 17 time(s).