Shooting right spell working, but shooting left not

butterbeanbutterbean Member Posts: 4,315
edited November -1 in Working with GS (Mac)
I'm having a bit of trouble with my left spell rule. When walking right, she shoots just fine, but the left spell rule is giving me grief

I'm going to try and upload a screenshot of my rules, and perhaps someone can help, but I used my player's attribute, self.facing left for my left spell rule and placed a rule:

When all conditions are valid: An attribute changes: Self.facingleft is true, and actor receives event: return key is down

Timer: For .5 seconds:

Spawn actor: Spell

Change image to : LeftSpell.png

The right Spell works fine, I just did the opposite with the self.facingleft and made it false

The game crashes when I try to have her walk left and shoot

Any ideas?

Comments

  • KamazarKamazar Member Posts: 287
    Delete the left spell rule. Copy the right spell rule. Change it's direction.

    Got back from the first day of sophomore year. Headache.. ow.
  • butterbeanbutterbean Member Posts: 4,315
    I tried that solution too.... didn't work, sorry to hear bout your first day, sophomore year studying...?

    Also, I have the spell as a separate actor, so should I place the move behavior under the spell, and how do I define that in the spell actor for both shooting left and right?
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    If your "spell" is just an actor that moves create two actors - spell right and spell left. then in the behavior for each use the velocity or move behvaaior and set the appropriate direction and velocity.

    Then in the main player (who shoots the spell) create a rule with two atributes "selffacing" (or whatever you had called it is true) and spell button is down then

    timer spawn actor every (whatever time)

    then do this again but with the other attribute for the other direction
  • butterbeanbutterbean Member Posts: 4,315
    Okay, so I thought of that rule too, I did exactly what you suggested scitunes, but it wouldn't work.

    The game actually froze up, and I even tried mapping right spell and left spell to different keys on the keyboard, but still, no go.

    I think there are other rules possibly interfering... I know Codemonkey is lurking in here ... :)

    I know there's got to be an easy solution to this, I've tried everything!
  • MillerEPMillerEP Member Posts: 22
    Since it looks like you're only doing this as a boolean of "facing right" true or false, than do you have a attribute inside the spell actor that also uses that? Sort of like in the spell have it say "When facing right is false" change animation and move/move to/accelerate/accelerate towards 180 degrees? Then again, maybe I'm misunderstanding the issue?
  • butterbeanbutterbean Member Posts: 4,315
    I've also tried creating the spell's own attribute as well to do this, and it still doesn't work! It must be other rules I have conflicting.....

    I have an attribute for self.facing left for the player so it knows when to stay standing left versus right and not sure if that attribute is conflicting with getting this spell thing to work! I've tried EVERTHING....
  • butterbeanbutterbean Member Posts: 4,315
    Anyone ? I'm thinking the still animation rule that I implemented might be interfering..... with the boolean self.facingright...? Maybe too many rules crossing over??
  • quantumsheepquantumsheep Member Posts: 8,188
    Why not upload a screenie of your rules? That might help us help you :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • butterbeanbutterbean Member Posts: 4,315
    http://img269.imageshack.us/img269/4403/picture1fyi.png

    Link above is a screenshot of the right spell rule for my main character

    http://img36.imageshack.us/img36/8061/picture2imy.png

    Link above is a screenshot of the left spell rule for my character

    http://img194.imageshack.us/img194/3803/picture3jkt.png

    And last, the 3rd link is a screenshot to the rules for the spell actor.

    This is one of the many solutions I have tried, in this case, the spell is casted by the actor facing right, but goes left.

    She won't cast the spell right

    Other solutions I have tried are doing a change velocity to the main character

    ie: if velocity is greater than zero (or greater than or equal to zero), cast spell right

    I even tried creating a global game attribute (both boolean and text) and had both actors check it (both spell actor and main actor) and those solutions didn't work
    I've tried everything I could conjure up, perhaps someone can see a mis-sight and point out my blunder! :)

    Also, in the main actor, I have an attribute for her self.facing left that is used in a rule for the still animation, and I thought maybe that would be interfering, but I've even attempted adding that to the actor's spell left and spell right rule, and that still doesn't solve it.
  • quantumsheepquantumsheep Member Posts: 8,188
    Ok, well having a quick glance I can't see anything *hideously* wrong with that, though I am tired and could be wrong.

    What I would suggest, and this shouldn't be much more than a cut and paste job, is making a new test project that isn't bloated by your whole game. Just make an actor, and the two spells (L&R) and see if you can get it to work like that.

    One of my own games has a spaceship that can face left or right while it flies. Looking at it, I made two seperate actors - one for the spaceship facing right, another for the spaceship facing left.

    I also made two sets of projectile - one left, one right.

    I may have been having the same problems as you, and in my haste came up with the aforementioned solution. It's not perfect, but it does work...

    Hope that helps in some way,

    QS

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • butterbeanbutterbean Member Posts: 4,315
    Update:

    Thanks Quantum! I just cleaned out my game and started over with just the actor on screen, and it worked! I created a second actor for spell so there's both left and right, and it finally worked.... I think just looking at it for so long , I needed a break and then came back to it with a fresh perspective, thanks!

    It's also acting a bit buggy with the left spell which I can't figure out b/c it was working, and now the game freezes... ugh
  • butterbeanbutterbean Member Posts: 4,315
    Update:

    Here's the strange thing.... I have 2 different spell actors, spell left, and spell right.

    I remembered that in the beginning when it worked, my spell left actor had no destroy behavior attached to it, but spell right did

    I kept the destroy behavior after 3 seconds rule for the spell right behavior but didn't include it in the left.

    It's now working.....

    So for constraining the spell, I'm guessing that I will have to do that with just one spell actor, and I'll keep all the attributes with the right spell.

    As for the left spell, I'll just add a move behavior and leave it at that....

    After all this.... it's finally working... and over a fluke chance that I left out a destroy behavior in one spell actor... never would have known that otherwise!
  • quantumsheepquantumsheep Member Posts: 8,188
    Glad you got it sorted!

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

Sign In or Register to comment.