YetAnotherSuperhero's Recent Forum Activity

  • But that only works on integers not floats.

    How could I do this but with floats?

    Also... with negative numbers if you did -450%360 it gives you -90 but if you set a sprite to -450%360 and retrieve the angle it is at you get 270 which is what I want

  • Maybe I'm not being clear...

    If you tell a sprite "set angle" to 450.33, it would be pointing at 90.33.

    How could I get 90.33 without resorting to using a sprite?

  • That sort of works...

    If I set an object's angle to 1000, I need to know what angle (0-360) that would be.

    So if the number happens to be 450.33 then the object would be pointing at 90.33 degrees.

    This way gives me an approximate but only in whole numbers.

  • I'm in need of help...

    How would I convert a number (i.e. 1000) to whatever angle that would be?

  • I mean I would need to check specifically, if [Health] or [Speed] or [xxx] or [yyy] has changed. Not just [any variable]

  • I know it's sorta late in 0.x's development for a feature request, but...

    It might clean up a lot of coding if there was an event to check if a sprite's variable has changed.

    That's it really.

    If someone could implement this it would be awesome!

  • I'm having a senior moment,

    My GUI is on it's on layer with scrollrate 0 and if I change the window size How can I reposition that LAYER to the horizontal center? (Without having to move each object individually)

    Thanks.

  • So, I set up my engine and the mechanics are working fine (yay!) now, I need to figure out the best method for handling AI.

    Just to be clear, I'm not asking how do I get my sprites to act as enemies, but the best structure for going about doing that.

    And for an example of what would need to work...

    I have a ship heading towards a planet. This ship has no reverse engines and it's purpose is to dock with said planet. So what to ship would need to do is turn off it's engines (so it won't be propelled into an incorrect heading) then rotate 180 degrees, and when it is 180 from it's original heading it needs to fire back up it engines to slow down.

    I have all the math for how long this would take worked out (ReverseCalc).

    So, essentially, it goes like this:

    If SHIP.REVERSECALC is greater than {DISTANCE TO TARGET}: Turn engines off & turn to SHIP.ANGLE-180
    
    SHIP rotates...
    
    Now that SHIP has rotated 180 degrees, turn engines back on[/code:1qlbl85a]
    
    It seems pretty simple, but there will be other things such as if the ship DOES have reverse engines, if the ship is actually on course, and how to get back on course.
    
    So, if this explains enough what would be the method to do this, or the materials to read up on?
    
    Thanks.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks, I just found out this morning what was up!

    Ship: Pick by GetToken(Ship.Value('Equipment:EngineCount'), 2, "|") Equal to ""[/code:3aupakc4]
    
    Was messing it up. I made the second token say "0" instead of nothing (and updated the picking event to match) and it works now!
  • This does not seem to be working correctly:

    + System: For each Ship
    + Ship: Pick by GetToken(Ship.Value('Equipment:EngineCount'), 2, "|") Equal to ""
    [/code:usrqvyif]
    Sub-Event:
    [code:usrqvyif]+ Ship: Value 'AI:Purpose' Equal to "Dock"
    [/code:usrqvyif]
    Sub-Sub-Event:
    [code:usrqvyif]+ Ship: Value 'Movement:State' Equal to "Go"
    [/code:usrqvyif]
    Sub-Sub-Sub-Event:
    [code:usrqvyif]+ System: Ship.Value('Movement:ReverseCalc') Greater than Ship.Value('Movement:Distance')
    -> Ship: Set 'Movement:TurnTo' to Ship[Movement].Angle-180
    [/code:usrqvyif]
    
    What this code [b]should[/b] do is pick all the ship that have no engines in the second token [b]and[/b] have the purpose for docking [b]and[/b] have the movement state of "Go" [b]and[/b] if the time it takes to reverse their direction is greater than the distance they are from their target, [b]then[/b] reverse their direction.
    
    It seems to ignore that last condition. And this is driving me [b][i][u]NUTS[/u][/i][/b].
    
    Anyhoo... 
    
    What am I doing stupidilly?
    
    Thanks
  • No, nothing just array, ini, hastable, object pairer.

  • But, I don't have anything named Swap Values, that's straight from the python dll. Nothing in my code says that.

YetAnotherSuperhero's avatar

YetAnotherSuperhero

Member since 20 Jul, 2008

None one is following YetAnotherSuperhero yet!

Connect with YetAnotherSuperhero

Trophy Case

  • 16-Year Club
  • Email Verified

Progress

17/44
How to earn trophies