j0hnbane's Forum Posts

  • korbaach That is an awesome example! I've been wanting to have an excuse to try lerp out. Thank you for that applicable example for me to use.

    bladedpenguin Trying that out now!

    Thank you for the responses.

  • danuyos Bad wording on my part. I meant going up the y axis, which a negative value.

    korbaach Thank you, I will definitely check it in the morning. (In bed on my iPad now)

  • I'd like to attach an object to a player's image point and stay with the player as it moves left and right.. but I want the y object to move in a negative motion. Giving the illusion of it floating up. I've gone through several attempts and have gotten the object to spawn, set itself to the player, and move up.. but only keeping the initial x position that it started.

    Any help would be appreciated.

  • So, now when I use the ID in the first column, then select the next column over to retrieve the name "Longsword" it is returning a value of 0 and not the string. My variable is set up for a string, and I know I'm calling it right.

    spr_player -> set currentWeapon to arr_playerWeapons.At(arr_playerWeapons.IndexOf(spr_equipWeapon.AnimationName), 1)

    currentWeapon is a string variable.

    What am I doing wrong here?

  • Nice lists there, jourdan .

  • That answered it, beufreecasse, thank you yet again!

  • Beautiful. Thank you beufreecasse so much for having the patience to help us here.

  • Ok, the problem I'm having is when I attempt to replace the ("your string") portion with another text variable. Is there a way to apply the quotations after?

    I guess to better explain, I'm trying to use ("sprite.AnimationName") there, but placing the quotations makes it search for sprite.AnimationName. When place it without the "" I get a return of -1 of the final variable.

  • vybr I'm glad I'm not the only one, lol.

    beufreecasse replied again to my other post with specific questions about the command here:

    https://www.scirra.com/forum/viewtopic.php?f=147&t=126834&p=897819#p897819

    beufreecasse Thank you again so much for taking the time to respond.

  • I've looked around through the forums and tutorials for something specific to this and I cannot find it. I'm needing some guidance for the following three steps:

    1) Search for a string in an array and identifying its index.

    2) Using that index locate another index by adding or subtracting from the y or x.

    3) Taking the value placed in the new index and applying it to an instanced variable.

    Thank you for your time.

  • Ok, It looks like my biggest issues are:

    1) Searching for a string in an array and identifying its index.

    2) Using that index to locate another index by adding or subtracting from the y or x.

    3) Taking the value placed in the new index and applying it to an instanced variable.

  • You trigger is affecting them all. If one hits the ground, it turns them all off. I believe the replay you're getting is when the center man falls on his side and triggers it again while already touching the ground.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I made a quick example, that pretty much encompasses what I'm attempting to accomplish.

    After loading the JSON, the player clicks on the item.

    Trying to set the instance variable "ATK" on the player to the animation, "ID_1", over one spot to the value of "10".

  • Thank you for your response, beufreecasse.

    I've entered that for my variable value, but I'm getting a return of '0' when its updated.

    This is what I have entered on my event sheet using the array I posted earlier.

    https://www.dropbox.com/s/jsezcqmlxqi0isk/function.png?dl=0

    This is pulling from the array I linked prior.

    Am I doing something wrong?

  • I'm having a problem trying to figure how to pull a value from a y column picked by the x of a string in an array.

    Here is my array.

    {
    "c2array":true,
    "size":[3,4,1],
    "data":[
    [
    ["weapon"],["Anim_Name"],["ATK_Mel_Max"],["ATK_Mel_Min"]
    ],[
    ["Longsword"],["ID_1"],["10"],["4"]
    ],[
    ["Axe"],["ID_2"],["9"],["6"]
    
    ]]
    }[/code:18h7gpyd]
    
    I have an object that has different animations(different weapons). They are identified by "ID_0" and so on. When a player equips a weapon, I want to pull from an array the stats of the weapon by its animation identifier, In this case "ID_1" or "ID_2", and place the needed integers in the character's variables. In this case "ATK_Mel_Max" and "ATK_Mel_Min".
    
    I've been reading on 'For' and 'token' the past two days, thinking that something needs to happen there, and really haven't figured out a way to get this done. I've done several tutorials on loops, but haven't really found an application here.
    
    Thank you for your time.