CJacobsSA's Recent Forum Activity

  • Haha, wow, don't I feel stupid. I was putting it in the wrong place. Thanks a bunch!

  • Hi there, I'm mostly here to look for help on using Construct 2 because I'm a total noob at it, but if I see anything interesting to post about elsewhere I'll probably contribute.

  • After doing some bug testing it appears that a_shotgun_x is the culprit. When this line is enabled in the code:

    the shotgun does the angle thing it was doing above because:

    a_shotgun_x does not reset to 0. If I set it to reset to 0 in the action where the gun fires, it will only shoot 1 pellet for god knows what reason. I've officially given up on trying to explain why this is in words so here, I'll just upload my dev .capx and let you guys play around with it if anyone's interested in finding out what's wrong and/or want to explain how to fix it.

    After doing some bug testing it appears that a_shotgun_x is the culprit. When this line is enabled in the code:

    the shotgun does the angle thing it was doing above because:

    a_shotgun_x does not reset to 0. If I set it to reset to 0 in the action where the gun fires, it will only shoot 1 pellet for god knows what reason. I've officially given up on trying to explain why this is in words so here, I'll just upload my dev .capx and let you guys play around with it if anyone's interested in finding out what's wrong and/or want to explain how to fix it.

  • Based on post from nimos, I assumed you implemented it, LocalVariable always reset to it's default value, while StaticVariable does not, so you need to reset those variable in the For loop action to make it behave similarly to your old version.

    This does sound like it would work, but I'm not sure I understand what I need to do to reset the variable to what it was before and still have the gun be upgrade-able. If you could go a bit more in-depth I'd appreciate it.

    If you made more than one "codebox_shotgun_stats" you need to pick the correct one first. Note, you don't need the "Group is active" test as that code can only be reach IF the group is active!

    Thanks for the tip, redundancy removed!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Update: Now that I've made the changeover and re-written the code, other things have broken! Previously the shotgun fired straight out of the barrel at the angle I set:

    (old code method)

    But now when I fire, this happens:

    (new code method)

    I can't tell at a glance what has changed or what I did wrong in the crossover, so I'll post both the new and old shotgun fire code and let people more experienced than me take a look at it (you'll probably have to open them in a new tab to view them in full, they're big and I don't have enough posts to use URLs yet).

    (old code, note the variables being part of the group)

    (new code, variables are a part of a sprite called 'codebox_shotgun_stats')

  • Ahh, that does seem like a clever way of doing things. I'll try that. Thank you for the quick reply!

  • EDIT: THE ISSUE IN THIS POST HAS BEEN SOLVED. SEE A COUPLE POSTS DOWN FOR THE NEW ONE I'M HAVING. (didn't want to make a whole new thread)

    I'm making a game where you can upgrade the various statistics of your weapons, and to organize it better and make things work consistently I have organized the weapons' stats and firing patterns into groups:

    (ignore the names and stuff, this is just from my early dev file)

    Inside each group are a bunch of variables that pertain to the stats of each weapon as well as the math that determines what they do:

    (the player will be able to upgrade or change each of these numbers)

    If I place a button inside the group I can change the number, but all of my upgrade buttons and my pause menu are in a separate group because they have to be in order to be usable. So, is it possible to change a global number that is inside a different group, or will I have to do some reorganizing? If it isn't possible, how would you recommend I go about fixing/reorganizing it?

CJacobsSA's avatar

CJacobsSA

Member since 26 Sep, 2014

None one is following CJacobsSA yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies