Tokinsom's Forum Posts

  • I'm working on a snake that uses both the moveto and the sine behaviors. I want to tell the snake's head which angle to face based on the "moving angle" of the moveto behavior, which will be limited to 0,90,180,270.

    Problem is, the moveto's "moving angle" expression is just the angle between the object's current and previous position, and the sine behavior screws it up. Instead of, say, 180, I get values between 160 and 170. I tried to make the snake face an angle if the moving angle was between these values, but that didn't work for some reason. I'm assuming this is because the variation of the sine is so great that my conditions overlap...or something.

    So I'm wondering if there's some math I can use to remove the sine offset from the moveto's "moving angle" entirely. I think I need to calculate the difference of the angle w/ sine and the desired angle, then subtract it, but I dunno how to get the desired angle in the first place. Agh.

    EDIT: Kinda solved this by rounding a separate move angle var to the nearest max deviation of the sine, then comparing that variable instead. So if the moveto's moving angle is within, say, 15 of 180, my var will be 180 and the snake will face it properly. Would still be nice to have the proper expression if anyone's got some free time though

  • C2 loves making difficult things easy and easy things difficult. What you're asking doesn't sound terribly difficult though. Just use generic input functions, UIDs, families, and maybe custom containers because C2's aren't very good.

  • rexrainbow Tried that and a handful of other things. The sine keeps screwing it up. Can't you just change the moving angle to the angle between previous target and next target instead? Or a new type of moving angle that does something like that to be completely independent of other behaviors?

    edit: Trying to do this myself with events but it's easier said than done...

  • I don't really see what's so terrible about it :T For example in my game I use functions to damage enemies

    +Projectile collides with enemy

    -Call "Projectile_Destroy" (Projectile.UID)

    -Call "Enemy_Hurt" (Enemy.UID)

    +On "Projectile_Destroy"

    +Pick Projectile by UID Function.Param(0)

    +If Projectile.Name = "Blah"

    -Do a thing with it

    +On "Enemy_Hurt"

    +Pick Enemy by UID Function.Param(0)

    -Hurt Enemy

    So now I can do many things that hurt the enemies just by calling that function, or I can hurt all enemies at once by excluding a UID. I have a higher level of control this way, and no duplicated code whatsoever.

    Also sometimes you'll want to store the UID of a different instance than the one that called the function. I do this for a complex moving platform system.

    *Shrug* We'll see what Ashley thinks I guess.

  • Could always set the val to 0 at the bottom of the sheet or event.

  • I never even considered that a workaround...functions aren't meant to work on any specific objects unless specifically told to. An option to maintain the SOL could be useful, though. If anything to remove the need for "For Each Object" on functions that affect multiple of the same object.

  • #2 is not pixel art and no it's not supposed to look crappy...

  • rexrainbow I noticed that the MoveTo's retrievable "Moving Angle" is not independent to the behavior. For example, if I use the MoveTo and Sine behaviors together, the movement from the Sine behavior changes the MoveTo's Moving Angle. I assume you're just getting the angle between the object's current position and previous position for this. Can it be fixed/changed? Or do you have a workaround?

  • This is literally one of the easiest things you could possibly code yourself O_o;;

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You select the event sheet that's attached to the layout in the layout properties panel, if that's what you mean. Aside from that there are only event sheet includes.

  • Yeah we had Dethlands at SXSW and smaller conventions (I didn't attend them myself, though). Honestly I don't think they're that important. With this thing called the world wide web you can get feedback from thousands of people in a fraction of the time

    I guess it's fun to see people playing your game..but there are also LP videos for that!

  • Only 1 sheet can be tied to a layout. However, you can include sheets in other sheets.

    So make a primary sheet like "eGameStuff" and then, while it's open, right-click empty space and include other sheets like "ePlayer" or "eEnemies".

    Manual entry on event sheet includes

  • +1 At the very least for organization/management. I've got layers for backgrounds, objects, overlays, triggers, zones, HUD, and then global for pause menus and options. Would be nice to be able to toggle visibility or lock all a whole group in one click or target a whole group at runtime.

  • No need. You can use something like

    +Object is NOT overlapping solid at offset: Object.Width, 4

    -Turn object around

  • Thanks man I'll try it out soon