Magistross's Forum Posts

  • From the manual :

    Gamepad expressions

    Axis(Gamepad, Index)

    Retrieve the current position of an analog joystick on a specific gamepad. Index specifies left analog X and Y or right analog X and Y axes, subject to Key mapping. Axes range from -100 to 100. Axis values within the Analog deadzone are returned as 0.

    o I believe the that axis index 2 and 3 means X and Y axes of right stick if you use basic mappings.

  • Something like this pseudo code should work :

    Start of frame 
        -> Set player.oldPos to player.currentPos
    
    Every tick 
        -> Add to Player.movementDelta : distance(player.oldPos, player.currentPos)
        -> Set player.oldPos to player.currentPos
    
    While player.movementDelta >= 32
        -> Do what you want here
        -> Substract 32 to player.movementDelta[/code:3160nrp1]
    
    ninja'ed ! You should use definitely use a while if you plan of having tremendous speed, otherwise don't bother.
  • I believe project files are exported to a single common folder, so your logic will probably need some fixing.

    Anyhow, if you want to load at run time your XML, use the AJAX object's "Request project file" action. Then, on AJAX completed, Load XML -> AJAX.LastData

  • Your server has to receive data and append it to your CSV file. The only way to do that in C2 is indeed via an AJAX post action to a server side script (PHP, ASP or whatever). It's quite straightforward if you know what you're doing.

  • You will probably want to do some AJAX post request processing from your server. On submit, post AJAX request with your data, you server side script should then take that data and append it to a CSV file with the method of your choice.

  • Or alternatively you could set period offset to 50% of the period, so the sin cycle starts the other way around. FYI, you can also use 25% and 75% of the period the start at either peak of the curve.

  • I normally use normal for loops and Array.at() anyway. Maybe it's the old school developer in me It's just more flexible IMO

    Not only is it more flexible, it is the only way to iterate through an array and keep the "stop loop" functionnality ! I never liked Array's built-in loops...

  • Then I guess you could do with a bit of reading on How Events Work.

    You'll see that conditions themselves are doing the picking. Pick by evaluate will pick all objects which the provided expression evaluates to a non-zero value, that is by the book. UIDs are non-zero value (except the very first object instance), so you were in fact re-picking all objects that were already in the SOL.

  • There's a lot of picking errors here and there. Why all the pick by evaluate ? All of them are picking all objects with non-zero UID, is it intended ?

    Also, most of these problems stem from the fact that some pick condition scopes might select more than one object and it can't iterate through them unless explicitely said to, by using a for each condition.

  • The functions work because only one UID is ever in the context, referencing the same object through multiple families.

    The "For each" is needed because the system condition "Pick by evaluate" won't implicitely loop through all famEnemyMelee UIDs. As a rule of thumb, when you are using expressions and can't use "Self" to reference your object, take for granted that you'll need a for each.

  • Here's a less than optimized way to do it. Perhaps you can build upon it to satisfy your need.

    The same method could probably be used with normal text, using ExecJS with a small script that calls the measureText method, although it would prove twice the challenge.

  • You got it right. Retrieving multiple UIDs in the Array's "action context" is impossible. You simply have to add a "for each LandingPod" under the "spawnType = 0" condition.

  • It seems to me that your are filtering the family ("Blocks") by doing a pick by evaluate on the objects ("Block"). Your name variable isn't a family variable is it ? If I understand correctly, your condition pick all family instances since at least one "block" has its Name variable set to "RED".

  • Could it linked to pixel rounding ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I know about them not using more space after export, but I don't know about the memory usage at runtime, I'd have to do some profiling. However, unless your tileset is huge, I don't see how it could become a problem.