R0J0hound's Forum Posts

  • irina

    You'd need to use the paster_3d_5.capx with the "rotate" function to be able to rotate the points on other axis. Where you'd rotate is right before where "draw3d()" was called then you'd need to undo the rotation right after.

    Basically:

    Call "rotate" 10 "y"

    Call "draw3d"

    Call "rotate" -10 "y"

  • int() and floor() round down to negative infinity. -33 is less than -32.7023072454 so that's down.

    int(-32.7023072454) = -33

    floor(-32.7023072454) = -33

    ceil() rounds up to positive infinity.

    int(-32.7023072454) = -32

    round() rounds to whatever direction is closer.

    round(-32.7023072454) = -33

  • irina

    Both those can be done by transforming the points around. To tilt the view you can rotate on the y axis. In the capx the z axis is toward the screen, so to increase block heights you'd need to specify the Cubs be taller when using the function to create one.

    The polygon sorting won't be satisfactory with the camera tilted though.

  • Nesteris

    I've thought about it but it has the same issue as converting from CC to C2. They're much too different so it would require more coding than I have time for.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Confirmed, looks like a bug. Filed a report here:

    My best guess is since "on collision" is only triggered once per overlap that is somehow not being cleared, and when loading the id's of everything changes or something like that.

  • Problem Description

    The save state increases over time when saving and loading. It seems to happen when creating objects that are then destroyed "on collision".

    Attach a Capx

    [attachment=0:2oj2q7yq][/attachment:2oj2q7yq]

    Description of Capx

    The capx creates a sprite every tick that immediatly gets destroyed on collision. Then every second the state is saved then loaded.

    Steps to Reproduce Bug

    Basically exactly like the capx, but...

    • Every tick create a sprite so it overlaps a second object.
    • Using the "on collision" condition check for a collison between the sprite and object and then destroy the sprite.
    • Periodically save then load the game state.

    Observed Result

    After a few saves and loads of the state, the save state gets bigger and bigger. Looking at the JSON string the section after "collmemory" gets longer and longer.

    Expected Result

    That the savestate would remain the same size

    Affected Browsers

    • Chrome: untested
    • FireFox: YES
    • Internet Explorer: untested

    Operating System and Service Pack

    Windows Vista sp2

    Construct 2 Version ID

    r199

    Further discussion on the bug found here:

  • Those two conditions need to be in the same event block for it to work. The only way it would go straight to zero is if only one of the conditions were used.

  • You just want a way to lookup/store stats for various objects. There are many ways you can do that.

    * One is to use a json string with a json plugin. I haven't really used it yet but it's topic should have some info on it's use.

    * Another is to use an array for it. The idea you'd set the size to (number of items, number of properties per item, 1). At the start of layout you'd setup the array and later access properties with Array.At( item id, property) where property is 0 for name, 1 for HP+, ...etc. It can be tedious to populate one value at a time so you could parse a text file or make an array editor to help populate the array, and then just load into the array the array saved as a json string with Array.AsJSON. Note: for a json string to be loadable by the array it needs to have the same format.

    Here's a topic with some ideas to make populating the array less tedious:

    * A third way would be to use sprites with instance variables. Each sprite would be for a different item type. You either could add an id variable to help pick the right one or carefully keep track of the order you created them so you could later pick them with the "pick nth instance" condition. The drawback of this is you may need some more events for picking the right type.

    For mixing it would probably be easiest to just take two items and make a third. To do it i'd just use events to do it. I suppose you could also use a array of size (number of item types, number of item types, 1) to do a table lookup of item combinations, but that sounds like an overkill especially since most objects don't combine.

    For saving you can use webstorage to save a key with Array.AsJSON which is a JSONized string of the array. If you want to save multiple different arrays you can either use more keys or make an array that you set with .asJSON strings. And just as a note almost every object has the .asJSON expression as well as an action to load it, which makes it very useful for saving or loading.

    [opinion]

    Overall I'd first just work everything out on paper what you want your system to do in exact detail with no worrying about if you'll use arrays, JSON or whatever. Basically the "what it should do", not "how it should do it". I do it all the time and I'm not very productive without some paper to work stuff out on. Like you I have most of an idea of what it should do, but don't have a lot of details ironed out. As you get better you can do more of it in your head. Event and code are just obscure what you want your stuff to do.

    [/opinion]

  • Here I made one way:

    On a granular level you could just count laps. A little less granular would be to count checkpoints. In the above it also incorporates the distance to the next checkpoint on top of the number of checkpoints passed.

    The only major math used finds the distance to a line instead of a point.

  • The trick is you need to make sure all of the tilemap that you want to paste is onscreen before pasting.

    For everything else the usual method of using paster as a screen is to

    1. move paster to the location

    2. paste objects

    3. move paster back to original location

    For the tilemap or even particle object you need to move both onscreen.

    1. move tilemap to the negative of the location you want to draw. (-x,-y)

    2. move paster to the top-left of the screen

    3. paste tilemap

    4. move paster back to original location

    5. move tilemap back to (0,0)

    The above will work as long as the paster object's size is less than or equal to the screen size. If it's bigger then you'll need to scale the layout or layer so tha everything is on screen before pasting.

  • The plugin only does 2d physics so using z is not possible with the plugin.

  • Yeah that's what I meant. My ascii art failed. Also if you can make the ground out of slopes it would work better.

    Outside of that you could make your own platform movement with events. The most useful way would be moving the player completely with physics and not using the platform movement at all.

  • mattb

    One idea that may work is use a force on the object toward the base of the rope and just set the length as it gets closer. That may be more true to life where a force would be used to pull the rope in. You could also instead set the velocity of the object parallel to the rope as well, which would make the rope retract at a constant rate. For the latter you'll need this formula to get velocity along an angle:

    velocity at angle = vx*cos(ang) + vy*sin(ang)

    So given:

    ang= angle of rope

    and

    rope_vel

    We can set the velocity so the perpendicular velocity stays the same and the velocity along the rope is whatever value we want.

    perp_vel= vx*cos(ang+90) + vy*sin(ang+90)

    vx=rope_vel*cos(ang) + perp_vel*cos(ang+90)

    vy=rope_vel*sin(ang) + perp_vel*sin(ang+90)

    Then as with the first idea only set the rope length as the object moves closer.

    Edit:

    A third idea would be to set the maximum force of the joint so that the collision isn't as radical.

  • You can check if the xVelocity is between -1 and 1 with two conditions.

    Basically this:

    Sprite.Physics.velocityX > -1

    Sprite.Physics.velocityX < 1

    Now there are a lot of conditions that can be used to do this. A basic one is the system->compare condition. And if you want it to work with more than one instance of sprite add a "for each sprite" condition above the two conditions.

  • The pin behavior is run after the event sheet, so you either would have to wait till the next tick or position B with events before pasting.