Majinboo's Forum Posts

  • 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?

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Use compare distance with variables

    https://www.scirra.com/tutorials/1320/p ... enemies-ai

  • i have an array with a lot of enemies, ordered by "NO_CLICKED", name, type, color, LEVEL (this level never change) and XP LEVEL. ->

    Right now this array is in JSON format and is spawing 5 objects at the same time using LEVEL and if the object is NO_CLICKED (0). ->

    If you click the enemy and destroy it then the enemy will respawn again because NO_CLICKED will have the value 0 and the enemy didn't level XP up or will level XP down, however if you destroy the enemy without clicking it then the enemy will level XP up. ->

    What i want? well i want that my enemies respawn by time and time will be determinated by level XP, something like this: ->

    Here i tried to use the plugin rex revive behavior but it didn't work because i need to save my values in the array and i don't need to revive the sprite specifically because the values are in the array, how i can do this with my array? i need to use real time and some enemies need to respawn maybe in 48 hours, for example... the player will save the game progress then if the player open the game after 48 hours then the enemy will appear of course i want to use waves, for example 5 enemies appear at the time otherwise you will have +30 enemies on screen and this is not the idea, each enemy will have his own time countdown, for example you destroy an enemy and the enemy level UP to 5 then this enemy will respawn in 72 hours.

    i need the help of this comunity please because i am very sure that i cant do this myself because i spend a lot of time reading tutorials etc and i am not programmer <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad"> ... any advice, tutorial, guide or whatever help will be appreciated, thanks!

    MY CAPX ->

    http://www.filedropper.com/arrayspawnbylevelandxp

  • I think I might have the wrong idea of how loops work, as well as local variables. I wish the debug panel could should array values in a grid or something..

    Yes, the debug panel helps you to check if the array is modified, but the next array tool helps me a lot to understand and handle the arrays:

    I partially solved my problem with the array, check the part of the code that solves my problem, maybe can help you too:

    Now i can find two values in the array and if are matching then spawn new enemies, but sometimes didn't work because sometimes just spawn 4 objects instead 5.

  • create 3 Compare variable > greater or equal value -> action

  • i have the same question, arrays are hard, i dont know if this will help you but this piece of code works perfectly to me:

    With this code i can find 1 value in the array but i need to find another value in the array and if two values are matching then -> action (spawn enemies in this case)

    i am reading this:

    http://www.gamechange5.com/devpage/10

    maybe the answer its here, maybe we need nested loops.. i am still reading

  • Use a playerbox (PIN empty sprite over your character) to avoid collision mistakes and use variables to the animations.