fisholith's Forum Posts

  • That is true , though I think rafaelsorgato was trying to go from the Ship to the Antenna, rather than from the Antenna to the Ship. Still, it's a good piece of information to know.

    As for the Antenna physics, rafaelsorgato,

    I might be wrong, but I don think the pin behavior works with the Physics behavior.

    What you might want to do is make the Antenna a non-Physics object, and pin it to the Ship physics object. Then the Ship does all your physics, and the Antenna is just a sprite along for the ride.

    If you need the Ship to break into physics pieces when destroyed, and the Antenna is one of them, then you can replace the live sprite Antenna with a dead physics Antenna at the moment the Ship is destroyed.

    If you really do need the live Antenna to use physics, so it can flex around while the Ship moves, you can try attaching it to the Ship using a physics joint, but if you do, the Antenna will change how the ship controls and moves, unless the Antenna has very low mass.

  • Just released another small update "v4e", (previous was "v4b").

    Fixes and refines a few small things, like the position and visibility of the "Stretch to fill window" option, and other minor stuff.

    Also the Scirra Arcade version now shows the link to this thread correctly. Unlike the desktop version of this app, the Scirra Arcade version can't just directly open a link to a webpage, so instead it pops up a copyable link.

    Hey there totoe, thanks for the comment.

    Thanks mOOnpunk, happy to hear you find it handy.

  • No problem A01214706, glad it helped out.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey there mOOnpunk,

    Not only will I make an osx version for you, I'll make an entire new update to the whole program!

    That's what ended up happening anyway. :]

    It's got some new features, like Middle-click-drag for rotation, and each blend mode button has a tiny preview of the subpixel diagram beside it.

    Even the modes not included in C2 are shown for completeness, and if you click on them there's a popup explanation as to what they do and why C2 doesn't include them.

    Also ... there's an owl in there now. It's fairly low res though, so it's safe.

    (fancy thumbnail for Scirra Arcade version)

    (Update: Changed from version "v4b" to "v4e", small fixes, and Scirra version now shows link to this post correctly.

    OSX: fi_BlendCompositeModes_v4e_osx64.zip

    (Let me know if it doesn't work. I've been hearing the NW.js export is having problems with OSX.)

    Scirra Arcade: Blend composite modes sandbox

    I also put it on Scirra Arcade, just in case the osx version has any issues.

    Win64: fi_BlendCompositeModes_v4e_win64.zip

    ...In case anyone else happens by here before I get a chance to update the original post.

    If you have any questions, feel free to ask.

  • Hey there ,

    When you go to the new layout, I think the "Play Animation" action doesn't come along for the ride.

    It will probably try to play the animation in the layout that you're leaving.

    I think you may need to set up an event that will run as soon as the next layout starts.

    You probably can't just say "On start of layout" play animation X, because you don't want it to happen every time that layout starts.

    So, the event will need to know if you wanted to play the animation when you left the previous layout.

    There are a bunch of ways to pass this kind of information between layouts.

    Global variables are one way. If you create a variable and place it at the root event level (not under a parent event), then anything you set that variable to will carry over between layout changes. This will do the job, but it can get a bit ugly if you have a bunch of trivial values being passed around with global variables.

    Another way is to create a Dictionary object (which is global by default). Any values you set in it will be accessible everywhere.

    So, when leaving the first layout, you would set a global-ish variable like "readyToPlayAnimAtStart" to 1.

    Then, at the start of the next layout, another event says:

    Event:

    + On start of layout,

    + Global-ish variable "readyToPlayAnimAtStart" equals 1

    Play animation X.

    Set Global-ish variable "readyToPlayAnimAtStart" back to 0.

  • Hey A01214706,

    which I'll assume is pronounced AOLZLATOB! :)

    Okay, if I understand, you have 2 text objects Text1 and Text2.

    If the player touches Text1, it is moved horizontally to x=544.

    If the player touches Text2, it is moved horizontally to x=464.

    If Text1 and Text2 have both been moved, then TextCorrect (which says "Correct") should be moved to a given [x,y] position.

    There are a lot of ways to make that work, the one I'll explain isn't the most efficient, but it's easy to set up.

    The fast way:

    1. In the Layout View, select the Text1 object.

    2. In the properties panel, in the "Instance variables" section, click the blue "Instance variables" link.

    This will open the "Instance Variables" editor for the object.

    3. In the Instance Variables window, Click the plus "+" button at the top.

    This will pop up the "New Instance Variables" dialog.

    4. Change the Name field to "wasMoved".

    Later, we'll use the "wasMoved" variable to keep track of whether the text object has been moved yet.

    5. Click the "OK" button.

    6. Close the "Instance Variables" editor by clicking the "X" at its top right.

    7. Repeat the same process (steps 1-6) for the Text2 object, to give it a "wasMoved" variable.

    8. In the Event Sheet, find the event where the Text1 object gets moved.

    9. Under the action that moves Text1, add a new action.

    10. In the action browser, double click the Text1 object.

    11. In the "Instance variables" section, double click the "Set value" action.

    12. Make sure that "wasMoved" is selected in the "Instance variable" field.

    13. Change the value to 1, and click the "Done" button.

    We can later check to see if the value is 1, and if it is, we know the object was moved.

    14. Repeat the same process (steps 8-13) for the Text2 object, to create the action for its "wasMoved" variable. You'll need to find the event that moves the Text2 object.

    15. Create a new event with the following two conditions:

    Text1: Compare instance variable "wasMoved" = 1.

    Text2: Compare instance variable "wasMoved" = 1.

    (Note: To add a second condition, you can click in the event and press the "C" key on your keyboard.)

    16. Add the action to move the TextCorrect object to the desired location:

    Finally don't forget to disable your original event that moved the TextCorrect object.

    Done.

    It should look like this:

    Event:

    + Player touches Text1

    Text1: Move to new position.

    Text1: Set "wasMoved" to 1.

    Event:

    + Player touches Text2

    Text2: Move to new position.

    Text2: Set "wasMoved" to 1.

    Event:

    + Text1: Compare instance variable "wasMoved" = 1.

    + Text2: Compare instance variable "wasMoved" = 1.

    TextCorrect: Move to new position.

    A more efficient way

    There are more efficient ways to do this same task, but I didn't want to over-complicate things.

    With the solution described above, the game will be constantly checking to see if both "wasMoved" variables are currently 1.

    If you want to try making it more efficient, you can instead have the game only check when the move events for Text1 or Text2 occur.

    This way the game only checks when there's a chance we should move TextCorrect.

    Event:

    + Player touches Text1

    Text1: Move to new position.

    Text1: Set "wasMoved" to 1.

    ~ ~ Sub-Event: - (You can create sub-events by pressing "B" on your keyboard.)

    ~ ~ + Text1: Compare instance variable "wasMoved" = 1.

    ~ ~ + Text2: Compare instance variable "wasMoved" = 1.

    ~ ~ > TextCorrect: Move to new position.

    Event:

    + Player touches Text2

    Text2: Move to new position.

    Text2: Set "wasMoved" to 1.

    ~ ~ Sub-Event: - (You can create sub-events by pressing "B" on your keyboard.)

    ~ ~ + Text1: Compare instance variable "wasMoved" = 1.

    ~ ~ + Text2: Compare instance variable "wasMoved" = 1.

    ~ ~ > TextCorrect: Move to new position.

  • No problem.

  • Hey there Exion,

    This is usually because the edge of the sprite image is touching the edges of the image area.

    If you double-click the sprite to open the image editor, and click the Crop button (just right of the rotate buttons), it will add a margin of transparent pixels so that the sprite doesn't touch the edges.

  • Thanks oosyrag for the suggestions.

    I agree, though, I think "trigger once" is also checked every tick, it's just that it makes a much simpler boolean check, to see if it can reset. If you code your own equivalent trigger-once-style functionality I think it should perform about as well.

    The "trigger once" condition is especially good for cases where you know the True/False frequency of the rest of that event's conditions will always be slower than 2 ticks. The event sheet's Nyquist frequency, so to speak.

    So the case of on-hover is a bit tricky in that respect. If your buttons are really far apart you're probably safe. However, if you have a row of buttons close to each other, you can roll off one button and onto another button, without an intermediate tick where no button was hovered. And that can confuse a "trigger once" based system. It wouldn't if "trigger once" really was a trigger-type condition, but I don't think it is.

    I might be mistaken, but I think adding "trigger once" to an event does not actually make it a triggered event. Relatedly, C2 has both True Triggers and Fake Triggers. In the C2 event sheet they appear identical, including both using the little green arrow icon. The "Fake Triggers" are literally tagged as Fake Triggers in the Javascript of the plugins that employ them. I think the purpose of them is to interact with other conditions in the same way true triggers do (e.g. no stacking) but under the hood, they are still per-tick events.

    As far as I know, true "Triggered events" are implemented as message-subscriber style function calls internally, or something similar. The "On function call" is an example of a true triggered event, as it really doesn't check every tick. In fact, I think "On function call" may be an even more specialized version as the function name may be hashed or something to make it even faster than a normal true "Triggered event".

  • Interesting. Thanks for the info

  • Thanks oosyrag,

    That's the workaround I've been using.

    I started looking into the possibility of a hover selector, because setting the colors back to the non-hover state with actions seems to be a little finicky sometimes. There's always the brute force method of every tick set to normal, followed by if hovering set to hover colors. I may try storing the UID of the hovered button and explicitly checking for the end of a hover on the current UID button.

  • Hey rafaelsorgato,

    One way to do this is to store the Antenna's UID (Unique ID) at the moment it is being pinned to the Ship.

    For the Ship, create a private variable called "antenna_uid".

    In the event sheet, just below the action that pins the Antenna to the Ship, add the action,

    Set the Ship's private variable "antenna_uid" to contain the Antenna's UID.

    Now each ship will store the UID of it's personal Antenna.

    To pick the Antenna, use the condition,

    Antenna: Pick by UID: And use the Ship's "antenna_uid" as the value.

  • Hi hychoi,

    This is just my impression, from having worked with C2 for a while.

    If you only use the standard plugins in C2, it would be quite hard to make a simple DAW.

    The built-in features of C2 work very well for games and even a lot of applications, but many of the core features of a DAW are not natively supported by C2, and might be pretty hard to implement.

    C2 is very flexible though. Using the SDK, you can build custom plugins to handle just about anything.

    So, it's theoretically possible to build a DAW in C2, but you would probably have to do a huge amount of the work in the JavaScript SDK.

    Just about everything involving audio, midi, and VST style modules would need to be implemented as custom plugins. The built-in Audio plugin, is pretty nice, and solves a lot of tricky web audio problems, but it's focus is fundamentally not tailored to DAW tasks. I think you'd only be able to use it for UI sounds in this case.

    So, I would probably not recommend building a DAW as your first major project in C2.

  • I think you may be right zenox98, though I've been hesitant to bump it again, as I know Ashley's probably got quite a bit going on with C3 and all. Maybe I should though.

  • For HTML objects like buttons, you can set their normal CSS properties with actions.

    Is there a way to set CSS hover properties with actions?

    e.g. Set a button to have a red boarder when hovering over it.

    It looks to me like it may not be doable with actions, but I wanted to ask. The runtime JavaScript for the button object uses a JQuery function that does not look like it's set up to be able to select the "hover" version of the button.