YetAnotherSuperhero's Forum Posts

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.
  • 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.

  • It looks like my .cap got stuck with some funky python code

    If I tell it to do Python(70+1) I get a error message window saying this:

    File "<string>", line 984
      def Swap values(self, p0, p1, p2, p3):
                 ^
    SyntaxError: invalid syntax[/code:325e2vtp]
    
    But the program stills returns 71 and won't give the error past the first time.
    
    I'm hoping I don't have to recode from an earlier backup.
    
    Any ideas?
  • I need to assign random equipment to NPC's but it can't exceed a certain worth.

    So I have a function "Assign Equipment"

    And in there, is the loop

    While "Worth" is MORE than "Amount Available" = Reassign Equipment

    And I can validate that it is the while loop; If I put in "Close Application" as an action it doesn't close.

    Is there a known bug of this? or any ideas?

  • [quote:2hh5nkmt]Containers always have the objects contained affected, and or picked.

    That's what I want. If there are twenty ships and one gets destroyed I want the engine graphics to get destroyed with it.