Need help understanding this hard-to-understand answer [URGENT]
Basically, I asked for some help making a random actor spawner (which spawns enemies) get increasingly faster. It's essential so more enemies are spawned faster as the game progresses, making the game harder.
I'm not too good with GameSalad (intermediate maybe?) so I need help going through this help answer that I got, because I don't understand it's instructions below very well.
Thanks to ookami007 for this, just need help understanding what they said:
Basically, I have an off screen actor that works off a TimeToSpawn REAL variable. When the game.Time > TimeToSpawn then it execute the block of code.
1st, it resets the timeToSpawn to game.Time + spawninterval
(SpawnInterval can be slowly decremented in your case.)
Then, generate a random number between 1 and number of possible "enemy" types.
Do a rule that tests for random = 1, then spawn
etc.
I set a variable called level and another called monstersSpawned
When monsters spawned = 10+(5*level) then level = level +1
the spawninterval is 3 (seconds) - (.1 * level)
But you can do yours anyway you want.
So, if anyone can go through step by step (what to press, which rules/behaviors to add) I'll be really appreciative.
It's my dream to make iOS games, and this one small obstacle is blocking me right now.
Thanks.
Comments
Hey ;-)
I can highly recomend the Videos on Youtube regarding first steps on GameSalad... helped me a lot. I released 2 Apps using GameSalad before even writing my first comment here.
It's pretty basic and simple stuff. The answer is right there in your post. What is it, that you don't understand? So i / we can help you better.
@3DMA
I have the basics of GameSalad down, this just in an obstacles right now.
Certain areas like "When the game.Time > TimeToSpawn then it execute the block of code." are vague, so I don't know what block of code it's executing, how to get it to the point of where it does that.
I just basically need that same answer, but more in depth as to where to go to get that certain area to function.
My brain just doesn't catch on when there's that small of information.
This means basically:
In your Spawn actor:
Create rule, choose Attribute -> game.Time then in the drop down choose ">" symbol (greater then) TimeToSpawn....
Ok TimeToSpawn means now here it will need to know the time you set, therefor i recommend create a game attribute calles "TimeToSpawn"... go to your game, attributes, create, choose integer, call it "TimeToSpawn" and give it a default value. I prefer to use game attributes, that way you can easy modifie those values from one single point and you don't have to crawl all your actors i order to find and / or modifie something....
Back to the rule:
once everything is done, drag your code (rules or whatever) into the "do" part of the rule you just created....
that's about it
i'm sorry for my writing, i'm not english.... but i hope you understand more or less what i mean.
I hope this helps you, if not, just leave a comment and i'll try to make some images...
Have fun ;-)
@3DMA
Ok, so now I have the random spawner dropping 1 of 4 enemies every second (for now), now this part.
I set a variable called level and another called monstersSpawned
When monsters spawned = 10+(5*level) then level = level +1
the spawninterval is 3 (seconds) - (.1 * level)
I also did what you said in your last post. Now I just have to make the timer go faster and faster every, say 5 seconds.
What kind of attribute (variable) do I make "level" and "monstersSpawned," and where do I put the code at?
@3DMA (or anyone else who wishes to help at this point)
These are my current Rules and Behaviors under my spawner. Where would I put the next step in this?
I can't look over all of this right now. But to make this timer faster and faster every fixed amount of time:
Create an actor called "Rules" or some like that, give it a bright colour so you can find it.
Double click the actor.
First look in the behaviours for "Change Attribute"
Select Attribute -> Rules (self) -> Colour -> Alpha = 0
This makes sure that this actor is invisible
Now add a timer
Choose "Every" in the drop down and say, for example 5 seconds
in the "do" area add an "Change Attribute"
in the left field click the "e" then select
Game -> TimeToSpawn
in the right field click the little "e" and set
Game -> TimeToSpawn - 0.5 (for example)
This makes now that TimeToSpawn decreases every 5 seconds by the factor of 0.5...
play with the values so they suit you..
once done, place this actor somewhere outside of the camera view in your game.
Saludos ;-)
@3DMA
Tried it, seems all in order, but it just won't work.
Maybe you can zip your project and post it here? or at least the part that matters. So i can have a look at it.
@3DMA
Check message?