soupolai's Forum Posts

  • 7 posts
  • Hello Plinkie,

    Thank you for your answer. This was somewhat the way I started working on it but I still had the problem of different instance of the same production unit producing on a different time since in this case there is only one instance of the type "farm" in the array.

    For example I start producing vegetables on day X in farm A and a day later I produce vegetables in farm B. I will need to track both production time as separate entries in the array and return the yield on each finishing dates.

    I also want to try to have a day log of current and finished production on current day so an array seemed like the best solution.

    Thanks!

  • Hello,

    I have been enjoying Construct on a dozen of small games and I wanted to get to the next level but find myself in front of a wall that no tutorial so far was able to remove.

    I am working on an UI base management game where you can build production units (a farm for example) and then produce something (vegetables for example) using this production unit. It is possible in my game to have several instance of the same production unit available therefore same production (vegetable) from 2 or more similar unit can run at the same time. Since my game is 100% UI based I call the same layout for all similar production units.

    Producing through a unit takes time and also yield a result (in that case vegetables). Not being too familiar with data management I looked around and dynamically populating an array seemed like the best solution. Sadly I was unable so far to populate it the way I want (Production name, time to completion, yield) a bit like that:

    (note that since my game is time based, you have X in game days to complete it, the time to completion is a calculation of 2 var (remaining days - vegetable production time) that return a date compared to the current date)

    Vegetables 350 15000

    Vegetables 350 15000

    Wheat 346 6000

    Inserting data in the array with this format is where I am currently blocked. I will also need later to check the date, transfer the yield (with its type) into inventory and then destroy the finished line in the array.

    If anyone could help me understand a bit better how to populate an array dynamically without a set size and using the At() expression (since it s dynamic) I ll be more than grateful.

    Thanks!

    Tagged:

  • As we always say, this is when you put a question on a forum that you found the solution... It is surely dirty but it works so sorry for taking a forum spot for nothing

  • Just figured out that the Result1_1 as a condition makes no sense but even without it I still have issues...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi folks,

    I am on a little game that is all about completion time per level.

    Right now I have :

    • a global variable called timer that check the time globally on every level layout start
    • a global variable called timer_result that is set to timer when the player reach the end of the level
    • a global variable per level called result1_1 (1_2, 1_3 etc) that is used to display the best time on the level selection layout

    My timer works, I get the time saved in timer_result when the player reach the end of the level but my issue is to change or not the result1_1 based on timer_result.

    On my event sheet I get

    On end of layout  
    Result1_1 = 0    
    Timer_result < Result1_1 
    
    ====> Set Result1_1 to Timer_result[/code:sdgzwj6b]
    
    When I do that Result1_1 stays at 0, if I disable Timer_result < Result1_1 condition Result1_1 is updated but even if the new time is greater than the old one....
    
    I am brand new to using variables in my game and even it seems logical to me I am pretty sure I am doing something wrong....
    
    Thanks in advance guys.
  • Thank you very much for your reply Paradox, your plan worked like a charm

    I still have an issue, since the condition is on trigger down, the game spawn an infinite number of target/sprite on targets, I ll have to find a way to limit it at 1. Maybe a variable on the target/sprite itself?

  • Greetings!

    I am having a bit of an issue with my shooter here, let me explain :

    • Attached to the body of my hero sprite is a gun/arm
    • This gun/arm move 360 and an aim is attached to it
    • When the right trigger of the controller is down, the gun shots bullets toward the angle of the aim.

    So far so good, but here comes the part I can t really figure out how to do

    • When the left trigger of the controller is down, the hero can lock-on targets within the range and sight of his gun/arm
    • Each time a target is acquired, a locked-on sprite is spawned on each target
    • On left trigger release, X amount (X=number of locked-on target) of homing missiles will be spawned from the player and each missile will go toward is own target.

    I managed to get a semi-working multi lock-on system, but when I release the left trigger, only one missile is spawned and goes toward the first acquired target but not the others.

    Any hint on how I could make that happen.

    Thanks in advance.

    PS : I am a huge beginner so please bare with my possible stupidity

  • 7 posts