Help with looping triggers

T

Tojso09

Guest
I'm making this map where you fight in an arena and have ten waves of enemies. I don't want to have to write triggers for each wave so I tried to loop them using a few switches, but it doesn't work right.

As a custom in most games, the wave or level of the player is represented in ore and for some reason it jumps by odd intervals of 5 or 7.

My triggers are supposed to set a custom score for a player you don't control and as the score goes up, so does the time for each wave and the enemies within it. I have not yet gotten to spawning enemies yet because of the timer.

Please post if this is confusing to you or if you would like to see my triggers.
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
Well, you can't tell the game to create a variable # of units within a trigger, the units created count must be a constant value.
You have to trigger each wave separately.
 
T

Tojso09

Guest
I understand that the unit variable must be a constant, but I also have discovered that functions such as x^3 have a constant in them. so what if I used multiple scores, and using triggers to increase/decrease values to get the desired unit count? Would that work?
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
No matter what you do, you have to have different triggers. It's what you have to put up with when you don't have inner-actionbox if/then/else options.


And I don't have any clue what the constant I was refering to has to do with the 4 possible constants in a cubic function...
 
T

Tojso09

Guest
The reason i mentioned that constant was because i wanted to show that it is possible to use constants to get funtions such as x^3.

And what I was going for was something like the level scheme in the premade "Defenders of the Galaxy" map that comes with the game. I was wondering if anyone had a easy explanation for it instead of having to follow all 30-odd switches in the triggers.
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
If its just a level based thing, why use switches? Why not use a number-based counter like a neutral player's gas resources or something?
 

Narks

Vastly intelligent whale-like being from the stars
Reaction score
90
Don't be lazy, its so much easier to create seperate triggers, although it will be much harder to edit if you make a mistake ;P
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
anarki, if it was possible to use variable values, THAT is what would be easy. Just set the value once instead of doing a 30x CnP.
 
T

Tojso09

Guest
So... is that it for help on this topic? just wondering. I would like to know if anyone is really good at looping triggers for situations such as these.
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
Well, nobody is good at looping triggers for this stuff because triggers where the constants change each time (which exception to the player number integer) aren't looping, it's several triggers.
 
T

Tojso09

Guest
I know that it takes several triggers and switches to loop, and for the constant, just use a nonplayable character's resources to keep a constant or to keep it looping.

I'm not sure if this works, but this is what I'm talking about.

Conditions:
Always
Actions:
Clear 'loop'

Conditions:
'loop' is cleared
Actions:
Set ore for all players. Add 1
Set ore and gas for nonplayable character. Set to 0
Set 'loop'
preserve trigger

Conditions:
'loop' is set
Actions:
Spawn x zerglings at location 'wherever'
Set gas for nonplayable character. Add 1
preserve trigger

Conditions:
nonplayable character accumulates 30 gas
Actions:
Set gas for nonplayable character. Set to 0
Set ore for nonplayable character. Add 1
preserve trigger

Conditions:
nonplayable character has least ore
Actions:
set 'loop'
preserve trigger

Conditions:
nonplayable character has most ore
Actions:
clear 'loop'
preserve trigger

Conditions:
nonplayable character accumulates 10 ore
Enemies command 0 men
Actions:
End scenario in victory for current player

As you can see, I did use multiple triggers, a constant (accumulates 30 gas), and it might be able to loop
 
T

Tojso09

Guest
coded triggers above to test and prove that it does work

public class starcraftTrigger//anything after the slashes, //, use starcraft trigger jargon to help explain what is going on{
//note:this only works for one type of enemy spawning at a time

static boolean victory=false,loop=false;
//booleans are basically switches, false means cleared, and true means set

static int P2Ore=0, allopOre=0, p2gas=0;
//resources used (could be called "variables")

static int x=0,y=0;
//x is enemies in the wave, y is total enemies faced, both are used for data collection only, DO NOT TRY TO PUT INTO TRIGGER EDITOR, WILL NOT WORK

public static void main(String[] args)
{

/*Trigger 1*/

loop=false;
//this line is a trigger, but it is not preserved and the condition is always

while(!victory){
//unitl victory is declared in triggers, the program will keep going through triggers 2-7

/*Trigger 2*/

if(!loop){
//means if loop is cleared

allopOre++;
//means add 1 Ore to all players
P2Ore=1;
//continues previous statement

p2gas=0;
//sets player 2's gas to 0

loop=true;
//means set loop

y+=x;
x=0;}
//for data collection purposes

/*Trigger 3*/

if(loop){
//means if loop is set

x+=5;
//use spawn enemies at location with the x value in place

p2gas++;}

/*Trigger 4*/

if(p2gas>=30){
//means if player 2 accumulates at least 30 gas, also, the 30 can be changed into a smaller number to show how many times you want the enemy to spawn at the location in each wave

p2gas=0;
//sets player 2's gas to 0

P2Ore++;}

/*Trigger 5*/

if(P2Ore<allopOre)
//means if player 2 has least Ore

{loop=true;}
//means set loop

/*Trigger 6*/

if(P2Ore>allopOre)
//means if player 2 has most Ore
{loop=false;}
//means clear loop

/*Trigger 7*/

if(allopOre==100)
//the 100 can be changed to whatever amount of waves you wish

{victory=true;}
//means end scenario in victory for current player

/*Data Collection*/
System.out.println("Player 2 Ore:"+P2Ore+"\t\tPlayer 2 Gas:"+p2gas+"\t\tEnemies"+x+"\t\tEveryone else's Ore:"+allopOre+"\t\tTotal Enemies Fought:"+y);
// ^ prints out data collected in triggers in each iteration while no victory is declared ^

//under these settings you face almost 750000 enemies with up to 15000 per wave, TAKES A VERY VERY LONG TIME TO GO THROUGH
//by wave 40 over 100000 enemies are faced total with over 5000 enemies in wave

}}}
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top