PixelRebirth's Forum Posts

  • Online functionality is one of the bigger weaknesses of Construct.

    Of course the Download object does its job fine for downloading, but I'm afraid there is no object that is able to directly upload files.

    With the HTTP Object you can communicate with websites, such as passing arguments through a PHP script/HTML form. I've used it before to create a simple flatfile highscore table.

    I haven't used the object in quite a while, but together with a proper PHP upload script, it should be able to get the job of uploading a file done.

    In actions there is:

    1. Add file - what argument name means? (same with add number and string)

    2. Set user agent - what is it and usage?

    3. Requests - what is it and usage?

    1. See above - adding arguments when you post to a site basically. Like it could pass the username, a password and a message, all being different arguments.

    2. User agent would be the string which is used to identify your browser, to be able to choose the appropriate content to display for example.

    3. 'Get' and 'Post' would obviously refer to the HTTP methods of the same names. Take a look here maybe. With 'Get' you could also download any site as a string, which would be returned in the expression 'HTTP.GetResponse'. And with 'Post', well, you usually post stuff.

    Keep in mind that I'm no authority on these online matters though, I hope I was able to provide some insight at least. Anyone able to add to that or correct me by all means do post!

  • >

    > > When you create an object it becomes the only picked object for the remainder of that event. After that the object cannot be picked until the next tick (or frame).

    > >

    >

    > Is this accurate? I thought it was like this:

    >

    >

    > > The way it is, though, is that when you create an object, it doesn't really exist until the end of the next top level event or trigger.

    > >

    >

    From my experience, it seems to be like ROJOhound says. You can't, for example, access a pv of a newly created sprite until the next tick. I still think, the object is created at the end of the tick, and all you do in the creation event is just buffered.

    I do think Ashley said what he said for a reason. Look at this overly simplistic example:

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

    When you press X, a Sprite is being created at the center of the screen. But with the current event order, you won't see anything. It's immediately being destroyed by the second event. However if you switch the event order, the sprite briefly appears before being destroyed. Which means it already existed and could be picked before the next tick - according to my very own logic. Otherwise it shouldn't have blinked when you switch the order. Unless something is going on I'm not getting, which is always a good chance. Still Ashley said what he said!

  • When you create an object it becomes the only picked object for the remainder of that event. After that the object cannot be picked until the next tick (or frame).

    Is this accurate? I thought it was like this:

    The way it is, though, is that when you create an object, it doesn't really exist until the end of the next top level event or trigger.

  • I don't think there's a way to directly encrypt a normal array. However the S plugin is able to save to encrypted files. It's the only method I'm aware of with Construct and the plug is really worth looking into.

  • Just uploaded my fix when I saw chrisbrobs' reply. A lot of what he said is valid. However he didn't mention that you could simply use the 'Auto mirror' angle setting and get rid of the additional angles in your animations.

    Also I would advice against using key presses to trigger animation changes. You should base it on the movement instead. I simply changed the walking animation event to have a 'Is moving' combined with a 'Is on ground' condition (edit: or if you like it not complicated use 'Is walking', hehe). You could also compare the X speed to achieve something similar.

    So, here's the cap with auto mirror:

    http://dl.dropbox.com/u/2306601/00009_edit.cap

    Oh, and good luck with your contest entry!

  • What I did instead was I set a private variable to a number (once the required conditions for running were true) and then subtracted from it every tick until it goes back to zero.

    This is what I'm doing quite a lot as well. But...

    My question for the community is-- is this a bad way to do this? I think ticks are based on framerate, and so the ability to run within the game might be affected based on the frame-rate itself... if that was the case could I just set the framerate to a constant 60 perhaps? Or should I rework it based off of milliseconds and whatnot...?

    ...yes, you really should use Timedelta here. So instead of simply subtracting a certain value every tick (you don't need to add an always event btw for it to run every tick), you substract value*Timedelta, as described in the wiki. Otherwise the game will definitely run differently depending on refresh rate.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ASHLEY!!! Please consider adding 'get object name'

    Not exactly a new request. And seeing that it hasn't been added yet, I wouldn't hold my breath.

    I need to store object names for later use in my level editor, then use 'create by object name' - a feature that seems pretty useless unless you can retrieve an object's name :T

    It's still very useful. Think about naming conventions and things alike.

  • I don't understand the motivation of some new members of reviving old threads for no good reason.

    Being a 'newbie' to Construct myself I too would like to see some sort of pdf file as I like to read printed stuff and have them to have as reference.

    If you guys were that eager to have some kind of documentation (apart from the wiki, the numerous tutorials and examples - yeah, stuff that isn't presented on a silver plate), you should have found this by now:

    Unofficial Construct manual made by chrisbrobs

  • It helps a lot! But what confuses me is that I don't know how you saved the blocks, because I created a new object and it didn't save it.

    Hehe, well, as I said:

    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.

    So the different objects are just frames of the edi_block sprite. To add a new object, add a new frame. That's all.

    And all you did( for saving ), as far as I can see, is clearing the array with a value. Where are the events that save the information about the blocks?

    Click on the small plus sign to the left of the condition to reveal the whole event tree. There's actually a loop below that, which sets the value at the current array position to the frame number.

  • 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.

  • 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!