SwatHound's Forum Posts

  • I wan't to set the angle of a bullet to a specific sprite who's variables match up with a specific global variable. is there a way I can control this in a string?

    I have "Bullet angle of motion = (sprite.x, sprite.y) degrees,

    but is there a way I can incorporate a specific sprite?

    What I mean is, in the condition I have

    "System = Pick sprite where sprite = GlobalVarUID" But I assume this does not exactly help, since the bullet angle does not go to the sprite who's UID is equal to the Global Variable UID.

    Is there a way I can type out "sprite.UID=GlobalVarUID.x" or something along those lines?

    https://www.dropbox.com/s/rrljw4fp7ri8y ... .capx?dl=0

  • Select your event (not on top, on left side) right click and choose Make 'Or' block

    Yeah, this definitely is something I wish I knew when I started using C2.

    Clicking the far left has a difference than clicking slightly to the right of the far left.

    Learning that has definitely improved my workflow.

  • Have you done many tutorials before making a game?

    I think if you just have the character finish climbing, and disable controls for half a second after finish climbing, just make his first animation play 'getting up', and then give him regular controls.

  • It would just been easier if you would post the actual capx with a precise explanation of where the issue is instead of "let's say I'm using sheep"...

    With a precise issue and precise code that causes the issue it will be easier to give precise answers.

    Thanks for the response.

    I was more hoping for a "yes this is completely possible, check your code" or a "that is not possible". By the sounds of things it seems that yes, this should be completely possible.

    I'll try and recreate the problem in a fresh capx and if the problem persists, will post said capx where someone will hopefully be kind enough to point out my error.

    I would post the capx I'm working on now but its over 100 events and I'm afraid that my code is held together with duct tape, gum, and rubberbands, so "trimming it" scares me.

    Thank you again, I'll try it in a new capx and will post my findings later.

  • Yes, honestly, I'm not sure, but I would not be surprised if I accidentally jammed something and now it wont ever work until I figure it out...

    But I could not get the system to count all my sheep per each ... oh. wait. You see. the issue is these sheep are not ON THE LAYOUT.

    I have them "stored" in local variables is why. So maybe thats why it would not work? of course if they were on the layout visibly I have no doubt that this would work.

    But my issue is, I'm trying to calculate a local variable that each individual unit has and I want them all updating to the same "total variable". But I had to rely on my janked weird rigging where I hand feed the code +1 and -1 here and there.

    Oh and to be clear - I have no problem of setting the text to the variable, my issue is - I need the sum of all local variables to be added into a global variable, but I can't seem to find a way to automate this process, except by always adding "+1" to the global variable wherever I see fit.

    I was hoping there was a "System, detect change in local variable, adjust as necessary".

  • Ah thank you for your response. I guess it is that easy, but I have an interesting problem.

    My issue is that I have multiple units spawning multiple.. lets say "sheep".

    I have set to every tick, every time a unit produces a sheep, to add to the entire variable.

    The issue with "every tick" is that, I can't seem to "every tick, calculate how many sheep you have IN TOTAL"

    When I tried using every tick in the past, it would only calculate the sheep for the first unit with the lowest id first.

    So I had to resort to "For every unit, add their sheep to the total value"

    So now I had to run around and do, for every sheep loss, minus from the total value.

    But I'll try and make a new capx and see if some thing is mucking up the "every tick - set variable of total sheep"

  • Thank you for your help Colludium, that really clears some things up for me.

    But now I have another question. - Where do I input the OR condition?

    do I type it in as a string? Is it somewhere under the system conditions? I tried typing it in in the "Value" box,

    I wondered if it was an event such as "else" ? - Ah wait, did you mean an "OR block"?

    Ahh I see I understand clearly now.

    For everyone else looking for it - https://www.scirra.com/manual/75/how-events-work

    Thank you very much Colludium, wish I could +1 you or something.

  • Is it possible to have the system "If this variable is EVER ALTERED in any way, update the text that states how much is truly in here"

    Instead of me manually telling the system minus 10, or plus 8, every time something occurs that changes the variable....

    Is there a way to possible have the system be perhaps something of a watch dog?

    For now every time I do something that altars the value I make sure I also tell the system "hey by the way THIS is the true value".

    Just didn't know if I was working hard when I could be working smart.

    I think this might have something to do with "I should probably use a function" is what I'm guessing.

  • I'm using an event - in this event, I have [System - pick sprite where sprite.X DOES NOT EQUAL int(1-5) Would int(1-5), is this actually 1 minus 5? or is this pick 1 through 5? What I WANTED to accomplish was, I wanted the system to pick every sprite that DID NOT HAVE these specific values. Is this possible? For example, if the sprite.HP is NOT 1,2,3,4,5, I would like the system to select those sprites. I read the manual on the math expressions but I think I would understand it better if I had someone really dumb it down for me. Thanks for the help.

  • I'm not sure if this is correct, I'm more trying to give you some sort of idea before an actual professional comes to help you but...

    I think, do you have variables for your character? like "climbing" or some sort of state that controls/tells the game "the player is currently climbing" ?

    Perhaps check if right after he is "done climbing" play the animation of his arms supporting him up.

    Maybe place uhm... imagepoints on your ladders at the required places - and when your sprite collides with them have the animation play out?

    Maybe when the sprite collides with the top of the ladder, set a thing to prepare him for "Getting up" and make the getting up animation play before you can fully move your character?

    I hope I helped, sorry its pretty scatter brained. Here let me fix it a bit...

    Try placing an image point near the top of the ladder, when your player is overlapping it, have the animation play of him getting up.

  • Would this be of any help to you?

  • Thank you guys for replying, I think its working, but to be honest I don't know why.

    I think I just had to make sure I had both local variables and global variables set in place.

    I think I just got ahead of myself before I actually set up the variables. Thanks again guys.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If anyone could point me to a tutorial that does such a thing, I would be greatly appreciative.

    I understand how to move towards an object, but I don't understand what I would need to add as an action to tell said object to

    Face towards object, then face directly away from it and shuffle away.

    I have sprite - Set angle to sprite, but what expression allows me to face AWAY from it?

    "I think I need to use Pick Nth instance on if overlapping, but how do I write sprite.x, sprite.y, - sprite,x, sprite.y if they are the same sprite?

    is there something like (sprite.x, sprite.y)Nth 1 - (sprite.x, sprite.y)Nth 2 ?" <---- Still curious about this too.

  • Could someone point me in the right direction as how I would do this?

    I have a sprite, and this sprite has a variable (Level 1, 2, 3, etc)

    I want to set a global variable = The amount of sprites on screen multiplied by 10, and then altered again by the sprite's variable.

    I want level 1 = 10, 2 = 20, and so on.

    I used = sprite.Count*10*sprite.level but nothing seems to be changing after the 10, no matter what I input, so I'm going to assume I'm doing it wrong.

  • Heres what I have, I don't know how exactly I "rotate away from" an object.

    https://www.dropbox.com/s/2dzufnutmsiy5 ... .capx?dl=0

    I wonder how people shorten URLs in posts to simple words...