Prowl's Recent Forum Activity

  • Ok Ram, you def have me in the right direction and I'm almost there. I understand the functions a little more clearly now, but still have a problem translasting it. I tried to bring it over more or less exactly, but without the wave functionality you built in yours, since mine is going to be more of a level system rather than waves. When doing that, It wouldn't wait between spawns, and it is spawning them infinitely.

    I got into looking through tutorials of some of the functions, and I wonder would the repeat function be something that would work for me? In my mind, I want to take the system repeat function, tell it to repeat x amount of times, then I want it to spawn object with a random range delay, so I could do random (3, 5) and it would randomly spawn between every 3 to 5 seconds. Then lastly, I want to use your set frame option, to have it randomly choose which one to spawn from.

    End result, game randomly selects spawn point every 3-5 seconds, spawns a unit, and repeats that function x amount of times. I'm going to mess with it a little longer before I call it a night.

    Edit: So I messed around with it a bit longer, and I came up with something that to me logically should work perfect, but logic isnt winning here. Here is what I have

    Condition: Repeat 10 times

    Condition: Pick a random instance (spawn sprite selected)

    Action: System wait 5*loopindex

    Action: (Spawn sprite) spawn (Object sprite)

    What I expected was for it to spawn the object 10 times, once every 5 seconds at a random spawn. What I got was it just spawning an infinite amount of objects at every spawn. I also tried your for command that you used, and ended up with the same result. I think I'm close, just missing something small I'm sure.

  • Ram, that is helping me some, I'll mess around with it some more, but is there a way to add in a spawn limit for number of units spawned?

    Martin, I was trying to mess with arrays, also using the tutorial here on scirra's website, but they depict an actualy seeable object, but when I make an array, I do not actually see it. I think the array method, in reading how they work, may actually work great. Seems I can set an array on all 4 sides, and spawn from them at random. so I want to learn more about them.

    I will try to learn some by looking up some youtube video's, but I usually learn best by manipulating similar code to what I'm looking for, so may see if I can find some turorial that includes some base code for me to play with and learn off of.

  • Valhallen, that description sounds perfect. Now, the big question is, is there some way for the code to figure out the angle the original unit is moving at?

    So my code will know the objects angle of movement, then one new spawning object adds 90 degrees, the other subtracts, and they each move 25 pixels in their correct directions. What would that code look like, and what action would I be entering it under?

  • So, what I want to do, is create a bunch of spawn points off map, and set for enemies to spawn randomly at this spawn points periodically. I also want to have a specific total number of spawns.

    Example.

    I create 30 spawn points.

    I want 20 enemies to spawn, between these spawn points

    I want the enemies to spawn roughly within a 2 minute time frame

    So I want each spawn to lower a specific value, when that value reaches 0, the random spawning is turned off on all points.

    My goal is this helps future level creation easy, because all of the code is identical, and all I need to change is how many total enemies I want to spawn, so I just adjust that variable up to increase difficulty.

    A concern I have after doing this is, with a random function, will i sometimes have instances when I have a bulk of the spawns go off all at the same time? If so, is there a way to manage spawn frequency between all points to keep them within some sort of threshold. Like no more than x amount of units will spawn within y amount of seconds of each other... something of that nature.

  • I made a picture to better represent what I'm trying to do.Or even better, if I could say let the 1st one spawn in it's default position, and the 2nd one spawn anywhere within a certain radius of the 1st one at a random value, but far enough away so it doesn't collide with the 1st one upon spawn. But at the very least, I would like to have the 2nd object spawn either to the left, or right of the original object, based upon the direction of travel.

  • Mike, I just used your advice but instead did just random (-10, 10) and it seems to have the desired result, curious what the difference would be between that, and the combination of you using choose

  • Whenever I try to use your code, it says syntax error and highlights the parenthesis

  • Now if I do that, then the 2 just sit on top of each other with collision being disabled, plus, I really just don't want them to spawn on top of each other is it, there may be instances where they may collide, and I want that to happen.

  • So I have a moving object, when that object is killed, it spawns 2 new smaller objects. Issue I am having is, they spawn on top of each other, collide, and one of them shoots off into a random direction, when I want them both moving in the same general direction.

    Only way I found to avoid this was to use the move ahead action, but what I really want, is them to spawn side by side, relative to the angle they are moving at. Any help on how I might achieve this?

  • Maybe I'm a little more new than I thought I was, so what I previously was doing to set my angle of motion was going to the event sheet, and adding the action for my object for "Set angle toward position x=480, y=270"

    So, to use your code instead, where exactly where I put it, for those coordinates, and im going to have N = 5, so it's a total variance of 10

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • That makes sense thank you!

  • Already answered the first part of my question, what I don't have now is how to randomize that angle within a certain threshhold

Prowl's avatar

Prowl

Member since 15 Jun, 2015

None one is following Prowl yet!

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies