R0J0hound's Recent Forum Activity

  • They do work in the same event but you need to change the order to

    "compare instance variable" then "pick random instance".

  • You can emulate key presses with the "simulate control" action for the platform and 8direction behaviors. For general simulating mouse and keyboard controls I would set some state variables for each control and use the variables in my events instead of the mouse or keyboard conditions. Then simulating a control would be as simple as setting a variable.

    I don't think simulating the controls would give an exact replay unless the game ran at the exact same framerate the whole time.

    If you want just a visual playback then the game state is unimportant. You just need to save the position,angle,size,opacity or anything that can change visually for each object on screen every frame.

    hoanganh17 you say it's for game testing, could you give an example where it would be useful for testing?

  • Images are saved to spritesheets to save VRAM in C2:

    http://www.scirra.com/blog/87/under-the-hood-spritesheets-in-construct-2

    Music and sounds likely take the same amount of space as their file sizes. There is no need to fully decompress an audio file in memory. Only the bits of the sound that will be played soon are decompressed and sent to the sound card to be played.

  • The 0:7 is the column:row in th .fx file of the error and "No precision specified for (float)" is the error.

    I found this page that seems relevant:

    http://learningwebgl.com/blog/?p=2507

    Add this line to the top of your shader and it won't assert.

    precision mediump float;

    Hope that helps, from best I can tell this is a subtle difference between webgl glsl and opengl glsl.

  • Here is a capx of the methods I wrote about:

    http://dl.dropbox.com/u/5426011/examples14/destroy_oldest.capx

    I personally like the instance variable solution, it's very clean.

  • Like this?

    +sprite: platform is on floor

    +sprite: Is overlapping bouncy at offset (0,5)

    --- sprite: set platform vector y to -500

  • countofquad

    In regard to this Q:

    he reason that I'm concerned is what would happen if Object A's OnCreated code contained a Spawn Sprite statement for SpriteC. Would SpriteC be in the SOL at the point of Line 4?

    SpriteC would not be in the SOL. The "on created" trigger only has the newly created object picked. It does not effect the SOL of the event it was created from.

  • Remove the "wait 5 seconds" and only 5 will be created. With it you get a continuous stream of 5 planes a tick for 5 seconds.

  • The solutions work fine since the objects are created at runtime. Ashley's quote refers to not being able to assume iid or uid of an object in the editor.

    At runtime once an object is created it gets a unique uid that remains the same for the life of that object. IID's at least in this situation are 0 for the oldest increasing in order to the newest. Changing the ZOrder, layer or deleting a mid aged instance (with some older and some newer) at runtime may be cases that might scramble the iid order, but I would have to test those cases to verify.

  • 1. Add a sprite of your pendulum.

    2. In the image editor move the origin to where you want to pivot.

    3. Add the sine behavior to the sprite.

    4. Change "Movement" to "Angle".

    5. Profit

    6. Tweak settings to your liking.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The oldest sprite will have the lowest UID and a IID of 0.

    Here is one way to do it:

    +on key pressed
    ---+system compare: Sprite.Count>=2
    ---+System: pick instance 0 of sprite
    ------ sprite: destroy
    ---+every tick
    ------ system:create sprite

    Another way is to give the Sprite an instance variable "age" with an initial value of 0.

    +on key pressed
    --- sprite: add 1 to age
    --- system:create sprite
    
    +sprite: age>=3
    --- destroy sprite
  • Wastrel

    I like your idea, I was trying to figure out a way to parse sentences and you pointed me in the right direction.

    I used a slightly simplified approach by using pattern sentences:

    eg.

    take 1

    open 1

    unlock 1 with 2

    The sentences the player types needs to match one of those with the numbers replaced with object names, otherwise it will say "i don't understand" or "I don't know what 'foo' is".

    Besides the parsing the game logic is made simple as possible. The command and object names are put into global variables so there are no "tokenat" expressions cluttering it up. The end result is the bare minimum number of conditions to do game logic.

    ex.

    object="key":

    --inventory has "key":

    ----set text to "you already have the key"

    --else

    ----set text to "you take the key"

    ----delete "key" from room_objects

    ----add "key" to inventory

    The room objects and inventory are dictionaries. I didn't implement it but room changing is as simple as changing the room objects. You could add room persistence by storing the AsJSON of the room objects somewhere when leaving the room. A save would consist of the room objects of each room and the inventory asJSON.

    Only about 15 events for the sentence parsing, the rest was for game content (~30 events).

    http://dl.dropbox.com/u/5426011/examples14/text_adventure.capx