PixelRebirth's Recent Forum Activity

  • My idea was to create an event that checked to see if the player's X velocity was positive or negative, and triggered when they pressed the button to run in the opposite direction. But I couldn't figure out how to check velocity, and some searching in the forums leads me to believe that you can only check velocity on an object with the Physics behavior.

    You can get the X vector for the platform behavior, it's called 'Get X component of motion' and the expression looks like this: Sprite[Platform].VectorX

    2. Even if I solved the Velocity issue, I still can't figure out how to make animations act properly. My main character has a 2-frame jump animation, and it's supposed to play the 2 frames and then hold on frame 2 until the character's state changes to "falling". But it acts weird -- sometimes it plays the 2 frames very quickly (which is what it's supposed to do) and other times it holds on frame 1 as long as you hold down the jump button.

    I admit it can be a little fight to get Construct to play your animations correctly, sometimes you'll have to set the animation to the first frame manually and use the 'Play animation' action after that.

    Other than that a cap file would really help pinpointing your problem.

    3. I tried making an idle animation by having the basic "standing still" pose be the first frame, which lasts 3 seconds, and then having the idle animation play after that. It worked fine, except for the fact that it would start the animation at random intervals, like you'd land from a jump and it would start halfway through the idle animation. How do I get it to start with the 3-second frame 1 every time?

    I created events that set a variable to "1" whenever a non-idle animation played, and then an event that ran whenever Idle animation played. If that variable was 1, it would set frame # to 1 and set the variable back to 0. It seemed like that should do the trick but it doesn't make anything act any differently.

    Is there an easier way to achieve this? I thought the Wait command might be the key, but couldn't figure out how to get it to work.

    Again, without a cap, I can't exactly tell what you did eventwise, although you provided a description. I'd suggest to check if the player was moving at all, then add to a value, if that value reaches a set max, you'll play the idle animation. In case the player moves again, you set the value to 0.

    4. I wanted a "landing" animation to play whenever the player landed a jump, where the character crouched for a frame or two before standing back up. How do you get something like this to work? My event that was supposed to trigger that animation on contact between the player and the ground didn't do anything.

    What conditions did you use for this event? An 'Is on ground' combined with a 'Trigger once while true' condition should do the trick.

    Thanks to anybody who took the time to read and/or reply to this. I don't know how to post a .cap, or I would. If somebody can tell me how to do it I'll gladly post mine. Any and all help anyone could offer would be much appreciated.

    Well, as i mentioned, I'd really appreciate if you posted a cap so you can be helped properly. Try checking out services like Dropbox and/or Box.net, which are popular around here, and for good reason so. Works great!

    And it probably goes without saying, but having one of your most thorough, helpful tutorials teach people to do things the wrong way isn't great. Is there any chance Platform School will be updated at any point?

    It doesn't seem you read the last post deadeye made in the tutorial thread. It's also locked now for good reason. Since a lot information is out of date. He's still working on an all new version though.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Okay, I took a look at your cap and made some edits:

    http://dl.dropbox.com/u/2306601/plinus_edit.cap

    First of all I noticed that you placed the gameplay area full of blocks in the layout editor, which is unnecessary. Even if you do want blocks sitting everywhere right from the startup, you should use a loop to create them (toggle event 2).

    Also you didn't seem to have made up your mind whether to use different objects or different animations to represent the different blocks/gameplay elements in the level editor. I think it's usually best to have one single object with different frames in a 0 speed animation. So I added that in.

    And I didn't see that you set the size of the array anywhere. You can just calculate the array size from the size of the layout/display on startup (first event in my edited cap, note that the -2 accounts for the border). Also it's a good idea in a game like this to have a global variable representing the size of a cell (Global('cellsize')). So you can easily reuse it where needed and your game will still work if you suddenly decide to change the size of a cell too.

    Well, loading and saving, it's obviously just some array loops. Checking for blocks at the currently looped position. And eventually storing the frame number/creating the object and setting the frame number. If there's no object at the current array position, the value is 0. Anything above 0 represents the animation frame number.

    So yeah, take a look at the cap. I hope this is helping. For further questions you know what to do.

  • I do believe there are quite a few examples around the forum for this. A recently added array map editor seems like a good match:

    Haven't tried that one myself.

    Please help if you can. (And I know you can. )

    You're right about that.

    In case you absolutely need specific help with your cap, say so and I - or someone who's faster - will take a look at it.

  • I'm not sure it makes much sense to organize things in the way you showed. Wouldn't it be better to go about it like this in the INI:

    [James]Health=5
    
    [Jeff]
    Health=15
    
    [/code:8t3iix3p]
    
    So every group is a character and you can add attributes like you want as items. Or in case you need the character names as items too, I'd prolly just do:
    
    [code:8t3iix3p]
    
    [Char1]
    Name=James
    Health=5
    
    [Char2]
    Name=Jeff
    Health=55
    
    [/code:8t3iix3p]
    
    And again, I would prefer to use a Hash Table instead of an Array to get the data in the game.  Just create a hash table for each group and add the items as keys. Some simple loops. 
    
    In case you do absolutely need a cap example or insist on using an array (for a reason I'm not aware of), just say so.
  • As the title states this short game was made for the Klik of the Month Klub #43 over at Glorious Trainwrecks. That's a monthly event where individuals get together on IRC and create potentially awful games in a few hours.

    My contribution was NightPimmel, a physics platformer which pokes a little fun at a certain indie game. I think it's not that hard to guess.

    <img src="http://dl.dropbox.com/u/2306601/np_shot1.png">

    Anyway, this is not to be taken seriously and can be downloaded here:

    http://www.glorioustrainwrecks.com/node/1578

    or alternatively also here:

    http://dl.dropbox.com/u/2306601/nightpimmel.rar

    Sagal was so kind to quickly provide some music for this, thx man!

  • With the the latest version of Construct(0.99.93) you can reference a newly created object in python like so:

    System.Create('Sprite',1,0,0)
    objRef=SOL.Sprite  #this gets the reference of the new Sprite.
    
    objRef.x=400
    objRef.y=300
    objRef.angle=30
    objRef.skewy=20[/code:27wbcj3x]
    

    My logic tells me this is what you're looking for, hopefully. Not much of a python user myself.

    And welcome to the community magicalblender!

  • I'm fairly certain you can't change the framerate mode at runtime. You can set the fixed fps rate, when you selected "Fixed" as mode in the runtime properties. That's about it.

    The reason why I am asking is because I want to have an option where users can set whether they want V-Synced or not.

    Fixed mode reduces the display quality significantly. Also if you "code" your game properly, it should run correctly in Vsync mode on all computers. If you had improper events, mostly involving Timedelta errors, the game would appear different on different computers depending on the refresh rate. Did you consider this already?

  • I'm loading external graphics so my game can be moddable. So that means each image has to go into a animation frame for the sprite. Now instead of have 100 frames when I might only need 10, is there a way to add a frame while the game is running, so memory is saved?

    I do believe there's no way to add new animation frames at runtime. So you might need to become very creative in order to include moddable animations. Or just force a frame count restriction on the user.

  • How about the following simple thing:

    For each group, item class equal to "desired class", do stuff.

    So you could have a filtered list of classes stored in a Hash Table for example. And then do something like For each key => INI group Hashtable.CurrentValue, ... you get the idea.

    On a serious sidenote you would want to limit the number of file operations when dealing with inis. Ideally you'd only check stuff from the INI once on startup. If you need to check back often, you should just load the groups and items from the ini into values. The S plugin can be handy for this. Also as a complete replacement for INI in many cases.

  • A newly created object will always be topmost on its layer. So when you create the ShouldBeOnBottom sprite, it'll automatically be in front of everything else on the layer it's created on. Just add a "Send to back" action right after you create the object.

  • EVENT: Sprite.Value('Type') = "Wood"

    ---SUBEVENT: Fire is Overlapping with Sprite ACTION: Set Sprite.Value('On Fire') to 1

    First you're picking the correct instances of your sprite. But with your subevent, you're newly picking instances of the sprite that overlap the fire object. If you switch the object order of that condition, it'll work correctly:

    EVENT: Sprite.Value('Type') = "Wood"

    ---SUBEVENT: Sprite is Overlapping with Fire ACTION: Set Sprite.Value('On Fire') to 1

    There's no need for a subevent btw, it could all be conditions of the same event.

    Oh, and welcome to the community!

  • You restart a layout by using the "Go the layout" action and specifying the same layout you're currently in. Just in case it wasn't clear you could do that.

    Problem is, even though the layout seems to restart, certain events seem to not work. Events that are set to happen every couple of milliseconds do not work. For example, the players shield and weapon energy, which go up every certain amount of time, simply do not anymore.

    There's no good reason why these kind of events shouldn't work anymore once you go back to the same layout. Unless you're having them in a group, which you deactivated for some reason.

    It usually has something to do with the way you set up your events. So it would be mighty helpful to see your cap.

PixelRebirth's avatar

PixelRebirth

Member since 26 Mar, 2008

Twitter
PixelRebirth has 1 followers

Trophy Case

  • 16-Year Club
  • Entrepreneur Sold something in the asset store
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

23/44
How to earn trophies