currypuff's Forum Posts

  • Thank you so much, IT WORKS!!!

    This is going to make a huge difference to my game and i hope you realise that, hopefully, as well i will be able to better understand this and eventually help other people.

    One more time, thank you.

  • drive.google.com/file/d/0B6FgXCrZ1bnZZ2k5NFdNcHJLekk/view?usp=sharing

    That is the capx for my project, it has enough info on it, if anyone can solve it please tell me or better, repost it solved.

    just put the http:// infront of the thing, because of my limited reputation i cant technically post them.

  • Thanks for the help, but I'm not understanding how this will work, I've made a little demo capx with just 4 weapons but it will have all the proper features. I'll post it later and it will contain all the info needed for you to understand my side.

  • This looks like it could work but how do you change UIDs and will changing them effect the game?

  • The problem with that though is that I want the weapons to have clips, ammo and be able to be reloaded, these weapons don't just spawn in and get deleted they need their info saved and altered, so that's why I can't transfer the info into a 'template', I need to take it directly from the original data holder. Like every time you empty a clip it subtracts that amount from the overall ammo and stuff like that. So this is why I need to figure out how to only use variables from an 'object'. I might eventually put up a simple capx that better describes this later.

  • The problem with that is that I want to have about 100 weapons and this method would be very time consuming my way of having all the variables in a family and setting one weapon active and only choosing the stats from the active weapon would be the easiest and smallest way, only if I could figure out how to use the stats from the active object.

  • Thanks but the instance variables on the weapons which I think your talking about wont work because of two reasons, instance variables reset when their object is deleted and the stats will change throughout the game.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In the game I'm making the player will get many different weapons. The easiest way to manage a lot of weapons with minimal coding is to put something to use as an object that will not be deleted in a family and give the family instance variables like; damage, clip, ammo, fire rate, reloading, active, etc.

    What happens is when you select a weapon it deletes all the weapon sprites and spawns in the selected sprite and sets the "data holding objects" active variable to 1 and all others to 0. Then I can just use 1 template for all the weapons but it needs to detect which weapons is active and use its stats.

    I have done this before but I deleted it, now I need it again and I can't work it out.

    Shortened: test for which weapon is active and use its variables. But it needs to select one from multiple objects with the same instance variables by seeing which one is 'active'.

    Thank you to anyone who can help me, or anyone who can figure out an easier way.

  • The problem with that is I need to do a set of code for each weapon, I cant just substitute it in and use a template for firing or reloading. But I still have limited knowledge of construct 2 so if anyone does know how to do something like this please let me know.

  • Hi everyone,

    I am working on a project where the player will get multiple guns throughout the game, if I put all the guns under a family and give the family instance variables like; clip, ammo, fire rate, damage, etc. then I can delete the guns family and then spawn the one I want, then I can subtract clip and ammo and use the fire rate and damage variables from the family, and because only one weapon is active it will use its variable. This all works fine and potentially I could add hundreds of weapons and expand the game really easily.

    I have tested it and it is by far the simplest way to do this. But, when the object is deleted and respawned it resets all its variables, this is bad. This is the neatest, fastest and simplest way to handle hundreds of weapons with minimal coding since I only need to substitute the weapons variables in to one template and It will work for all the weapons, firing, reloading, damage, etc.

    If anyone knows how to solve this or another way that it is kind of the same but could still handle multiple weapons please let me know.

    Thanks in advance for anyones help.