Dealing with unique Sprites.

This forum is currently in read-only mode.
From the Asset Store
Pixel Sprites ala ReactorCore - Builder Hardware - Large pack of sprites!
  • Hello, I'm currently working on a project where I'm developing a system to designate the attacker and the attack then using a formula determine using private variables how much damage is dealt. I have all the formulas and concepts done, I just have no idea how to implement it.

    The problem is:

    I need some way to take Private variables from one unique Sprite and Private Variable from another unique sprite, as well as the distance between the two. then using a formula, subtract the hp from the second one.

    Both Sprites can change throughout the game so ideally I would like it all to taken care of by one event instead of having to write an event for each sprite(since there are going to be around 40 sprites used for this).

    Thanks in advance for anyone who can solve my problem.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • <img src="http://i297.photobucket.com/albums/mm239/darkwoodgames/da.png">

    If you haven't gone through the Ghost Shooter tutorial yet you should, it covers this very topic

  • Hello, I'm currently working on a project where I'm developing a system to designate the attacker and the attack then using a formula determine using private variables how much damage is dealt. I have all the formulas and concepts done, I just have no idea how to implement it.

    The problem is:

    I need some way to take Private variables from one unique Sprite and Private Variable from another unique sprite, as well as the distance between the two. then using a formula, subtract the hp from the second one.

    Both Sprites can change throughout the game so ideally I would like it all to taken care of by one event instead of having to write an event for each sprite(since there are going to be around 40 sprites used for this).

    Thanks in advance for anyone who can solve my problem.

    families

    Also expressions

    Check the wiki. Most of what your doing should be fairly easy to set up.

  • This will not work because I am looking to access the information form two unique sprites (private variables, and xy for one). Like I have said these sprites will be different each time I need to use this event, so I would like to have a system that would allow me to plug in the information from different sprites.

    From what I've seen Families do things globally only, and each unique sprite has its own values, I was thinking of using families to designate Each sprite but I don't know how to do that. (and couldn't find anything on the wiki about it.)

    let me say this again, In my project I will have about 40 sprites that will use this specific event in any combination.

    In case I was not clear by Unique I mean an individual sprite(with a unique id), not just all the same sprites. From what I've seen Currently of construct It will get the unique id of any individual sprite you reference previously in the event, however in this case I need two different sprites that cannot be referenced. (not without making approx 1,500 events, 80 events if I need to reference one of them.)

  • If you pick a family and change the pv all sprites in that family will have their pv changed.

    If you pick an individual sprite, and change its pv the others in that family will stay the same.

    Its all about the picking.

    Btw you can have multiple families, you can have single sprites belong to multiple families, just like you can have multiple instances of the same object have different pv's, as well as multiple pv's.

    Any way post a cap its probably easier to show you than to explain it.

    edit:

    Yep as well as what quasi said. You can pick with multiple conditions as well.

  • <img src="http://i297.photobucket.com/albums/mm239/darkwoodgames/da.png">

    do this except make each sprite you want to be effected part of two families and change the objects in the action i pictured to the families red and blue. BOTH sprites NEED to be part of both families.

    if your event was lets say: red collides with blue. (sprite2 hits sprite or vice versa)

    it will pick the affected sprite in family blue and the effected sprite in family red. and choose the variables for damage associated to those sprites.

    i dont understand what you meant by "From what I've seen Families do things globally only" families are just so that you can pick different objects of the same type (ie sprite) to meet the same conditions as other objects.

  • Ok let me explain what I'm doing... I'm basically making an turn biased Rpg style game. So I have multiple units of the same type(ie multiple copies of the same sprite each with its own numbers) on the field. I'm also going to have a leveling system so the more kills a unit gets the more improved its skills will be.

    What I need is a system of events that I can use for the attack of the units, so that i can click on the attacking unit, it grabs the attacking value, then click on the target,grab its defensive values, and the attack will be calculated then attack.

    The forumula I use for attacking uses the

    power, Accuracy, and weapon Range of the attacking units pv

    defense of the target unit's pv

    It also uses the Distance between the units.

    It also uses a few global variables but those can be added easy...

    I hope that clears things up on what I need. I think long story short I need something that can identify each individual sprite on screen then take the pv or other values from them. something like a Unique Id however I think UID's work only with each sprite.

    about families:from what I understand Families only work on all sprites in the family, meaning they can only retrive/add values to all the sprites in the families.

  • http://dl.getdropbox.com/u/666516/familypicking.cap

    If you hold mouse down and hover over a sprite that sprite will be destroyed.

    If you click on a sprite all sprites will be destroyed.

    You might want to check out the forum more, and try some other stuff before moving into rpg mode.

  • Ah-ha! I see where the train of thought got derailed. I thought any reference to a Family affects all sprites in it, however if you reference a single sprite in a family, much like they do with other sprites. It keep all other family references to that sprite. The wiki entry was really misleading in this..Thanks for the help.

    This was the hardest hurdle to get over for me, I already have the movement added in(using a jerry rigged system to be overhauled with families now ^_^) as well as the know-how to complete the remaining tasks, you may not know this but I've been lurking the forum and wiki off/on for about 4-5 months now.

    Ive already taken the plunge into this project and I'm not to be deterred. I'll drop the link to the project later down the road once I get a working model of it.

  • if your event was lets say: red collides with blue. (sprite2 hits sprite or vice versa)

    it will pick the affected sprite in family blue and the affected sprite in family red. and choose the variables for damage associated to those sprites.

  • I'm working on the families and I want to get some confirmation on third events I made, as the only way I can see them being possible is heavy in jerry-rigging.

    basically how it works currently is (units is the family)

    first event:click on the attacker and it gathers the power and accuracy information as well as x and y position. as well as sets its pv "active" to 1

    second:click on the target takes the information from him and calculates damage and hit chance. and sets the "ready" global value to 1.

    third:constantly check's if there's a unit with active to 1 and the ready global value is 1. once both are 1 it sets the attacker unit's angle and fires the shot.

    This seems highly inefficient and I suspect there's an easier way.

    If not there should be, Like sprite variables/groups or something. something that you can identify a specific sprite for further reference without having to constantly reference it with some random variable.

    Something like:

    first event:click on the attacker and it gathers the power and accuracy information as well as x and y position. as well as sets its pv "active" to 1. Identify the attacker.

    second:click on the target takes the information from him and calculates damage and hit chance. and sets the "ready" global value to 1. sets the attacker unit's angle and fires the shot.

    thanks for the help.

  • the object pairer can do stuff like this

    if I'm understanding you correctly

    i'm about to leave for work

    but if you search the forums you can see some examples of how it works

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)