Majinboo's Recent Forum Activity

  • Hey, sorry man was away all day. Had a brief look at your capx and try this.

    When all enemies are destroyed (all 5 of them) maybe then make a loop to subtract countdown time for all saved enemies in the array. And when that loop is done spawn new wave of enemies. Loop through huge array will take some time, but if nothing currently will happen on the screen it should be fine.

    As of the subtracting TimeAway from countdowns. You don't need to check them all the time in game. There is no need for that. What you want to do is a quick check only at the Start of layout.

    In short something like that.

    +On start of layout

    ++For Each value > 0 - > set value to value - time away.

    This works as a "game initialization" you only need to run in once, when player starts the game.

    i optimized a lot the events, right now my main issue is subtract the away time, i tried on start of layout but didn't work, i tried a lot of things but for some reason this didn't work.

    http://www.filedropper.com/v2_3

  • i want to spawn this enemies in order and with little pauses between each spawn, for example i want to spawn 5 enemies but each enemy will appear each one with 0.5-1.0 second of difference and in order, right now they spawn in disorder and not in order like they are in the json array.

  • Finally i make this work, please give me a hand to subtract the time away to the countdowns,

    http://www.filedropper.com/countdownandspawnarray

    I used localstorage to save the countdowns, the capx makes exactly what i want.

    Now i just need to fix a 3 issues:

    1. When i refresh the browser new objects disappears because the value 2 is saved in the array before i destroy the enemies. (i tried to fix this but i cant find the logic to do it)

    2. Respawn each enemy with interval of time between each spawn to looks more natural (right now sometimes spawn 4 or 5 enemies all at the same time) , and spawn in order, like a queue list.

    3. Subtract the away time to all countdowns, i used the rex_time_awayL then right now i can see the away time in a text object to debug but i need to subtract it to all countdowns when you reopen the game, i tried on start of layout:

    UPDATE: now didn't work, i don't understand why <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad">

    Maybe i am doing unnecessary things with this loops but if you see with the debugger visor and you see what the capx makes then you will understand perfectly what i want to do, thank you so much for your help!!! i cant believe that i progressed so much xD

  • Ok, got it. From what I see I think you should approach this from other side.

    Don't add enemies to the Array when they are spawned, but rather add them when they are destroyed. In short it means that you don't need to ....

    I need the values of the array because of what i explain you in the PM, level time countdown in the capx was an example, i will set countdowns even of 6 months, 43 hours etc..

  • Ok, got it. From what I see I think you should approach this from other side.

    Don't add enemies to the Array when they are spawned, but rather add them when they are destroyed. In short it means that you don't need to ....

    5 Unseen enemies spawn each time , after you destroy these 5 enemies without clicking then they level up +1 so the countdown start, after the 5 unseen enemies are destroyed then the old enemies spawn 5 each time too of course when the countdown ends, so i will have a queue list of time out enemies, after you don't have old enemies to spawn then more unseen enemies will spawn 5 each time.

  • Ok, got it. From what I see I think you should approach this from other side.

    Don't add enemies to the Array when they are spawned, but rather add them when they are destroyed. In short it means that you don't need to ....

    level up will be simple, destroy 1 enemy without clicking then enemy +1

    Check your PM's

  • I don't want to sound like a dick but I'm not entirely sure you know what you are doing.

    I'm trying to understand everything you wrote and show in images and honestly I think you trying to overcomplicate this by a lot.

    Do you really need to countdown hundreds of objects?? What is the purpose in that? I'm just trying to understand your logic so I can help you better.

    I am trying to do this:

    its very simple, you kill an enemy then the enemy will level UP +1 , you cheating clicking the enemy with the mouse then the enemy will Level Down -1 and will respawn again so you can have another chance to kill it but without level up because you fail the first time, each enemy have a level and each level means that the enemy will respawn in a future, i need countdown to all my enemies by level (hundred of enemies even maybe thousands of different enemies).

    Obviously this is a template, for example you can use a specific combination of magic to kill an enemy, if you use the wrong magic combination then you can kill the enemy but the enemy didn't level up instead this enemy will level down and the countdown will be short of course because low level enemies will have low countdown times, yes i need to countdown thousand of enemies because i have a big list of enemies with names, type, etc... maybe you cant see the purpose of this but i want to make something different, step by step, i cant think in the next stage of my game without solve this, i need at least 8,000 countdowns and maybe countdowns even of 6 months.

  • "Or more easy, i don't know if this can be done, just save the game, all countdowns are paused, when you open the game again the countdowns are unpaused but subtract the away time to all countdowns"

    That is the way to go. rex_time_awayL don't care about object, array or any other stuff it simply saves the key (you set the name) and value (time)

    1. You don't array but you can use if your enemies have some stuff to save (like position, variables, states etc or even respawn time) then Array will help organizing it

    2. If you set proper naming convention for Time Away then yeah. It's a matter of simple for each loop

    Countdowns don't need to run every tick. You can update them ever 1 second, and don't worry about the lag. I have a mobile game where I have very similar setup

    and on my old Samsung Galaxy S3 it checks an array with 900 items every one second and it's perfectly fine.

    But just in case I've modify my system a bit. At start array is empty (size 0,4,1) every time enemy is destroyed I'm adding a new index to the array, and when enemy is respawn I'm removing it, It reduced the countdown checks from 900 to max 20-30 a second

    how can i countdown objects inside in the array? i am reading about rex time plugins but i cant realize how to do this , i want some enemies even respawn after 2 or 3 months then use every second maybe isn't worth because countdown 3 months takes a lot of time and i need hundred of countdowns.

    I am thinking in this:

    On destroyed level XP 9 enemy -> save in array 3 months to countdown (how can i countdown a object inside the array?, using a rex plugin?)

    i have all my enemies values (level XP, Type, leve, name, etc..) in the json array, after destroyed the sprite didn't exist anymore so how can i countdown? can i countdown the values inside the array? i cant realize how to do this, i am thinking in global variable but you cant save the values of a global variable with localstorage?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • it's this plugin suitable to have thousand of timers running at the same time? for example i want to use rex_time_awayl plugin to subtract the away time to timers but i want to use thousand of timers and some timers will have months to countdown.

  • Use Local Storage instead. To respawn enemies 48 hours later you can use "rex_time_awayL" plugin which saves the time you are away (game is closed) and you can easily compare how much time have passed between game sessions.

    and like gumshoe2029 said. to save data externally you will need some kind of a server (or service) that can do keep the record of your players and their score, settings etc.

    rex_time_awayL will help me but in need to understand how to do this.

    The system will look like this----->

    Destroy enemy (without clicked) -> +1 level XP UP

    Destroy enemy (clicked) -> - 1 Level XP Down

    On destroyed = Level XP 1 -> Respawn in 1 hour

    On destroyed = Level XP 2 -> Respawn in 2 hour

    On destroyed = Level XP 10 -> Respawn in 90 hours

    I need each enemy have a countdown, i dont know how to do this or if i need to save the time in the array, when the player close the game then obviously the countdown stop but when open the game again then i need with the rex_time_awayL subtract to the countdown the time away from the game, i don't care cheating etc.. i just want to make this easy because i cant advance in my game without this, when the countdown ends then i will add 1 in the array to the enemy so the with a loop i can spawn new enemies with value 1 in the array, like a queue list.

    1. When save the game -> save in the array the time left of the countdown of each enemy, maybe i don't need save this in the array? just subtract the away time to the current countdown.

    2. On load complete -> subtract Time Away to all countdown time values in the array, then -> find in the array 0< time values, then -> add string "ready" in the array to all enemies with 0< values (this to make a queue list) then -> loop = spawn enemies of the array that contain the string "ready".

    Or more easy, i don't know if this can be done, just save the game, all countdowns are paused, when you open the game again the countdowns are unpaused but subtract the away time to all countdowns, the question is how i can use a countdown for each destroyed enemy? because each enemy will be destroyed and if i have a lot of enemies (more of 100) a lot of countdowns will lag the game?

  • variable + AI State + MoveTO Rex Plugin + line of sight, keep reading!

  • If you are respawning enemies 48 hrs later, you will need to use WebStorage if you want data to be carried over in between players' closing their browsers. Keep in mind though that WebStorage is inherently tamperable, so people will be able to easily hack your game.

    I want to save local and backup it in a hosting because if the player lost his mobile phone or uninstall by mistake the game then he can lost his progress, i want too the players can carry his progress between different versions (mobile/PC), anyways i don't will launch the game for browsers just only for windows 10 store and mobile devices, to think about all this i need first solve the problem of how to respawn enemies 48 hours or later by XP level, however if i cant use arrays using LocalStorage or WebStorage then this will be a concern right now.

Majinboo's avatar

Majinboo

Member since 21 Jun, 2015

None one is following Majinboo yet!

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies