cacotigon's Forum Posts

  • Hmm, I just did some more checking, sometimes it seems like with this code when the CPU usage is maxed out and the frame rate drops, the jump release key code sometimes won't detect, so even if I just barely tap the key, the player sprite will jump to its furthest height.

  • Pile of barf bags. I forgot with my solution you'd have to worry about other overlapping sprites and pictures and backgrounds. HERP DURP DURP.

    EDIT:

    If you were willing to create solid color "cut-outs" (like masks) of all the animation frames, you could do the pin, making sure to update the overlay frame to correspond to the currently displayed sprite frame. The only benefit to this approach versus just making a copy of all the sprites frames in the colors you want would be that you can combine multiple overlays with additive properties at once allowing for blends or combinations, or change the opacity of the overlay without affecting the main sprite's opacity.

  • Scirra, regarding other languages and the difficulty inherent in moderating them, I thought I'd mention that I can read and write Chinese, so if you guys ever need help with moderating a Chinese forum (like how the XNA App Hub forums have specific language boards) or anything else related to that, I'd be more than happy to assist in anyway I can. Let's promote Construct in any way, shape, form or language we can! ??????????????????????????????Construct??????

    -- cacotigon

    EDIT: lol, that was amusing, the Chinese I typed just displays as a bunch of question marks. Yay unicode!

  • You have two possibilities:

    You could create alternative colored images for every picture you have. Kind of a pain though.

    What I would do is:

    1. Create a bunch of solid colored blocks in paint.

    2. Make the block be wider and longer than any sprite you intend to use it with.

    3. Load all of these into a single sprite called OVERLAY on different frames, set animation speed to 0, and give this sprite a pinnable behavior.

    4. Write a bunch of global variables COLOR_RED, COLOR_BLUE, COLOR_GREEN which numerical values correspond to the OVERLAY's respective frame.

    Whenever you want to change a sprite's color, simply do the following:

    1. Have that sprite spawn an OVERLAY

    2. Set OVERLAY frame to the appropriate color

    3. set its effect to ADDITIVE

    4. Pin it to the sprite (assuming origin is the middle point of that sprite).

    You can destroy it later, or change its visibility, etc.

    Hope this helps,

    -- cacotigon

    EDIT: I whipped up a quick capx file to demonstrate it:

    Color overlay capx project

  • I have a design/structure question related to player platform behavior movement. Custom controls is set to true. The main question is related to ON_KEY_PRESS vs ON_KEY_DOWN.

    Here is the keyboard code:

    <img src="http://dl.dropbox.com/u/12667027/Construct%202/Keyboard%20Movement%20Handling/Player%201%20Keyboard%20Events.png" border="0" />

    Here is the actual movement code itself.

    <img src="http://dl.dropbox.com/u/12667027/Construct%202/Keyboard%20Movement%20Handling/Player%20Movement%20Events.png" border="0" />

    For example, the jump is implemented as ON_KEY_PRESS, but I could have just as easily implemented it as ON_KEY_DOWN.

    Which do you think is better? Sometimes it just feels like my character isn't too responsive when jumping, especially when attempting to do lots of little hops.

    Keyboard logic is separated from movement logic for purposes of handling multiple players.

    Looking at this code, what do you think? Is this a poor way of implementing keyboard controls, player movement and animation?

    Thanks!!!

    -- cacotigon

  • Woot! Say goodbye to really long nested pick / reset clusters!

    By the way, speaking of feature lists, have you guys ever considered implementing something along the lines of a voting system? For example, Scirra would show a long list of potential features on the website, and every paid user is allocated X points (for example three), to which they can spend on any of those features. At the end, the features that are more important to the users would float up to the top. At any time, a user is free to deallocate one of his points, and put it in something else, or even put all three points in a single feature that they really want. Whenever a feature is implemented, all of the points that users had allocated are given back to them.

  • I would devour an entire planet full of unicorns for a UID indexer, something like how object() parentheses takes IID, using brackets would refer to the UID, so you'd have object[UID] and object(IID).

    This would save me so many times where I've saved off a certain UID during runtime, and in another expression (which has already done a pick operation on the same object type but a different instance) I suddenly need to get one of the saved_UID object's inner values like speed, velocity vectors, etc. Right now I have to setup lots of { reset pick, pick object uid, save object's vector to local variable } subevents.

    -- cacotigon

  • Hmm, I messed around with saving IID values instead of UIDs, since the arrays are going to be around for the duration of the program. It appears that accessing an object via its IID, aka object(IID), is not affected by any prior picking; I don't have to do any resetting or worry about selections. And unless I'm mistaken, the IID values should remain constant for a given object type *provided* that nothing is destroyed, right? Is there anything I should be concerned about when using IIDs?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • KYATRIC. Thanks that clears it up, I didn't realize that the ( ) index was a reference to a IID. I'm going to have to re-read the manual about picking/indexing/IID/UID so that I avoid making this kind of mistake again.

  • Ashley, I've discovered another bit of strange behavior with the pick although I'm not willing to discount the possibility that maybe I'm just misunderstanding how the pick is working in this case.

    <img src="http://dl.dropbox.com/u/12667027/Construct%202/ForloopPickBug/forlooppickfailure%20screencap.png" border="0">

    Since I've reset my pick list, how come referencing a specific BaseArray via a (UID) index doesn't seem to be working properly?

    I created this capx from scratch to test it.

    Forloop Pick Project

  • Ashley: I don't think that this is an event code copy problem, I think it's related to my prior misunderstanding of the Construct pick inheritance as in forum post:

    Pick inheritance post

    Thanks!

  • Ashley: Regarding Option (3), that's what I had initially; separate array objects, the problem with this is that I have a rexrainbow function which takes an array as a method parameter. Normally, I would consider putting all of my arrays into a single Family, but I assumed that cast to Family like ArrayFamily(Function.Param(0)) where Param(0) is a UID of an Array belonging to ArrayFamily would fail or would have some unexpected results since Family is still fairly new and Family behaviors are not yet implemented.

  • Ashley

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU!

    That's exactly what is happening! I had no idea that a PICK command in a subevent could only pick from its inherited "pick list" which happens on a Create object command. Subeventing the Pick UID code under a Pick All completely fixes the problem. I think I've got a much better understanding of the code-flow now. Also, I created a completely new project and tested extensively with sprites/arrays/etc and there doesn't seem to be any bugs. Hurray!

  • As a possibility, you can at the top of the event sheet, do a specific object spawn with a bunch of branching if statements for which object you want to spawn. After that, you can use events which act on the Family, however, as mentioned in the r75 event log, families do not support added behaviors, and instance variables.

    To get around this, you could have a single object called ChessPiece and have different animations each of which corresponds to a different piece, queen, king, rook, knight, bishop, and pawn. Then you can just set the appropriate animation, and use event conditions which compare against a pieces current animation.

  • You could have a 2D array where the Y value is associated with the language and the X value is each respective string. Then at the beginning you could have a menu layout for choose language and a global var called ActiveLanguage. Then whenever you set a text object to a string just pull the appropriate one from the array.