Random Destructable

DDRtists

ɹoʇɐɹǝpoɯ ɹǝdns
Reaction score
405
ok, im having a problum with a hero seige type map, that has a mini game. the game has about 20 gates, and i want them to randomly open wait about 1.30 seconds and close, well i can open them fine, but when i try to close them, i dont know how to store them, because if i open 2 at a time, the first one doesnt close, it just stays open and it closes the second one twice :nuts: can anyone help plz

-DDRtists
 
You can put them in an array variable of type: "Destructible" and do your actions on that variable instead of the Last Created Destructible.
 
The solution is simple
It's name is LOCAL VARS

The solution with less JASS involved requires to declare a global var, call it for exemple RndDestructable.
Then add this line at the very top of the trigger
Code:
Custom script: local destructable udg_RndDestructable
Then use all over your trigger the global variable to store the random destructable.
In fact, the game will use the local one and the second value will not erase the first one.
 
Make a destructible variable with array size 20, at map init set each 1-20 to a different gate. To open them do like..

Set RNDMIntegerVar = Math - Random # between 1-20
For each integer <RNDMIntegerVar> - <RNDMIntegerVar> do -
- Destructible - Open <Gate[For each integer A]>
- Wait 1.3 game time seconds
- Destructible - Close <Gate[for each integer A]>

The reason I put it in a For Each Integer is because it basically converts the global integer variable 'RNDMIntegerVar' into a local. It works throughout the For Each Integer ;)
 
Rad said:
The reason I put it in a For Each Integer is because it basically converts the global integer variable 'RNDMIntegerVar' into a local. It works throughout the For Each Integer
"For each A" uses the JASS global variable bj_forLoopAIndex, so it's not like converting the global variable to a local. It's more like using another global instead. And if any trigger uses a "For each A" loop during the 1.3 waiting time, the value of the variable will change.

To close the door use Destructible - Close <Your_variable> the same way you open the gate with Destructible - Open <Your_variable>
Remember to first set the value of the variable with something like Set <Your_variable> = Random destructible in <region> matching <condition>
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    we were down for a minute - think a log file or something got too big
    +1
  • Ghan Ghan:
    The alerts say it was down for a while unfortunately.
  • Ghan Ghan:
    Didn't know what was going on while I was at work.
  • Ghan Ghan:
    Disk filled up with logs. Fixed now.
    +1
  • The Helper The Helper:
    not a problem at all thanks for getting us back up
  • The Helper The Helper:
    I think the bots are finding a way to get through the anubis
  • The Helper The Helper:
    Happy Wednesday Everyone! Hope everyone has a Fantastic Day!
    +1
  • The Helper The Helper:
    Yeah, stats are showing big bot influx like 12k page views.
  • Wizard Wizard:
    :wave:
    +1
  • Ghan Ghan:
    TH changed his avatar again. 6 more weeks of summer.
    +3
  • Wizard Wizard:
    lol
    +1
  • The Helper The Helper:
    Guys just a heads up I am going to be shutting the site down soon. I am just waiting on the NUON people to decide whether they want to transfer forum data and keep the discord. My email is [email protected] for anyone that wants to keep in touch and I have a facebook too. I will make an official post later. Love you guys and will miss everyone!
    +1
  • V-SNES V-SNES:
    Sent a pm @The Helper
  • Stephen Stephen:
    Oh no - please don't lose the Nuon content
    +1
  • The Helper The Helper:
    Someone email AtariAge and see if they want me to transfer the forum data over to it
  • Ghan Ghan:
    Could probably keep NUON stuff around here if we wanted.
  • Ghan Ghan:
    Hmm what to do about the World Editor site though?
  • Stephen Stephen:
    I'd rather personally just own a backup of the Nuon data than see it go to AtariAge honestly. If it gets enshittified as per usual, or if some of the "regular" Jaguar folks get there, it's not gonna be fun
  • The Helper The Helper:
    There will be a github of the forum data so the NUON Forum Data I guess would be available there
  • The Helper The Helper:
    World Editor is technically Ryoko stuff not mine you guys can keep that I am not in that even
  • jonas jonas:
    :( end of an era :(
  • The Helper The Helper:
    Dont think of it as an end jonas - think of it as a beginning, because really my friend that is what it is.
  • A Andyoyo:
    Thank you for the hard work over the years. It did not go unnoticed.

The Helper Discord

Staff online

  • Ghan
    Administrator - Servers are fun

Members online

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top