Shooting right spell working, but shooting left not
butterbean
Member Posts: 4,315
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?
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
Got back from the first day of sophomore year. Headache.. ow.
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?
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
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!
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....
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
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.
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
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
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!
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io