megatronx's Recent Forum Activity

  • megatronx

    Maybe post a small example of what you are doing so people can have a look.

    Not doing anything complicated. Basically have minions walking from base to the resources point, where timer is suppose to trigger their time working or offloading, and stop movement condition. On timer they suppose to get back to the base, one by one, each with own timer. When each one of them is at the base, the timer starts again stopping movement for short while, ( state is changed to Offload etc), and that's how they continue traveling back and forth. Units movement conditions where under For Each, Timer trigger was not, and at the end of mining or delivering conditions, timer was starting, on timer calling couple of functions responsible for setting targets. But after a while it would always drop one, or two, then three etc units, which would stand there with all the variables set to make a move, but doing nothing. And so I noticed that issue appear to happen at the time trigger moment. Removed it, replace with wait ( duplicated couple of actions unfortunately :/ ), and everything works as it supposed to.

    Anyway, I don't even have original version of the events anymore I spent whole day trying to sort it out, moving things around. Nothing fixed the issue! I'll probably keep timer for simpler tasks from now on.

    newt If you have to use "for each" then that is a bug. No, when I placed a timer under For Each, it didn't work at all. Thought there was no error message either.

    Possibly how the tags are set up. I sometimes set tags like this :< "name" & str(object.uid) > , but in both cases, weather it was just a name or name paired with uid, it didn't work, or rather, was bugy. It did display the tag properly in the debug, thought now I realised I didn't look up if tag's name uid is the same as the instance's.

  • > use

    >

    > > foreach  object
    > object is on screen              - do something
    > [/code:1f9quwyt]
    > 
    
    Yes, That is indeed "for each" condition.  Thanks!
    
    @megatronx 
    
    Nothing fancy really. 
    
    -On star of layout
    --for each sprite ->  set Timer "xxx" to int(random(5)
    
    -On timer  "xxx" -> set Timer "xxx" to int(random(5)   and do something with sprite.
    
    With all possible combinations with for each  xD
    

    Cool. I thought you went with something like this:

    Object with varTimerTime set to N, and boolean Timer

    For Each

    -Is Timer

    -Every 1 sec remove 1 from varTimerTime

    ---TimerTime less or equal 0 : do stuff

    Ha! thanks for reminding me

  • How are you handling the collisions? Using distance instead of is overlapping is just a different way to detect collisions, they don't affect how the collision is resolved.

    I found out it was timer behaviour as well as flipping and mirroring that was causing all the issues with objects getting stuck. Removing flipping stopped characters from getting stuck on slopes, and time behaviour getting stuck at destination points, where it was used.

  • You do not have permission to view this post

  • It might be actually a bug in Timer behavior. Few days ago i had similar situation, where each instance of same object had a different value set in Timer behavior.

    And usually when On Timer triggers other instances (with it's own Timer still running) started to do some strange things - things they not supposed to do . And also For Each did not helped at all. After removing a Timer and making the same behavior using normal instance variable fixed everything up.

    Now I'm thinking that maybe even Wait action is more imprecise then ever. But I'm tiered, so might be just imagining that without seeing the game. But could you tell me how you did the timer? I'm pretty sure I used to do those in the past, before such thing as timer was a reality, but I can't remember XD

    saiyadjin Not sure how this would suppose to help, but thanks anyway!

  • Might not be that, but you need a for each with the On Timer trigger if multiple instances have this triggering at the same time, not sure why but I remember it.

    That's exactly how I had it set up. I had it Outside For Each, then inside For Each ( this one didn't work at all). Just gaved up.

  • Hi,

    So I'm making a "minions" game. My minions would mine. Every time one of them would arrive at the mining place, timer would kicked in, and on timer out, he would go back to the base. But the thing is from time to time, some of them would just "stuck" at mining place, and even with all variables set appropriately, would not move at all. So after whole day of frustration, I switched Timer to Wait action, and everything started working fine. Bug?

  • You do not have permission to view this post

  • why wouldn't it

    Would you happen to know, if performance is on pair with "is overlapping" ? I need to switch to distance, cause on overlapping, collisions glitch out sometimes.

    EDIT@ NO!! They get stuck on distance too :<

  • why wouldn't it

    Cool, thx!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • How does the timescale exactly work from the event calculating point of view? Does it slow down calculations? I'm asking, because I noticed that after setting timescale to 0.8, after quite a while, collision detection bugs didn't happen yet.

  • Hi,

    Does "distance" works if both instances have their collisions set to off?

    Thx

megatronx's avatar

megatronx

Member since 25 Sep, 2008

Twitter
megatronx has 1 followers

Connect with megatronx

Trophy Case

  • 16-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

23/44
How to earn trophies