Hey all, anyone sees the solution for this:
BasGoodboy
Member, PRO Posts: 310
I keep having problems with my Arena scene. This should be the last one to completely fix the scene:
The idea:
You have 3 actions, dagger sword and xbow.
I made the sword action and xbow action with a powerbar, which will go up each second and on release burst extra dps depending on the power in the powerbar.
The opponent:
The opponent spawns randomly on 3 locations, closeby (use dagger), middlefar (use sword), and far away (use xbow)
The problem is, the sword action should only do damage when the opponent is at location 'middlefar'.
The problem:
This all worked, untill I built in the powerbar thingy. Now, when the sword button gets released and the opponent is in the location 'middlefar', it all goes well. When the opponent is on an other location (closeby or far away), the text 'missed' spawns.
All works very smooth. BUT.. when the opponent spawns back at the location middlefar, he still gets a hit from the previous done sword action from maybe a minute ago.
I included a boolean or two to make sure everything resets after the opponent switches locationspawn, but it al won't work.
Here is a small idea of the Arena scene:
I hope you understand what I mean, I tried everything in my power, but don't know how to fix this.
Best regards,
The idea:
You have 3 actions, dagger sword and xbow.
I made the sword action and xbow action with a powerbar, which will go up each second and on release burst extra dps depending on the power in the powerbar.
The opponent:
The opponent spawns randomly on 3 locations, closeby (use dagger), middlefar (use sword), and far away (use xbow)
The problem is, the sword action should only do damage when the opponent is at location 'middlefar'.
The problem:
This all worked, untill I built in the powerbar thingy. Now, when the sword button gets released and the opponent is in the location 'middlefar', it all goes well. When the opponent is on an other location (closeby or far away), the text 'missed' spawns.
All works very smooth. BUT.. when the opponent spawns back at the location middlefar, he still gets a hit from the previous done sword action from maybe a minute ago.
I included a boolean or two to make sure everything resets after the opponent switches locationspawn, but it al won't work.
Here is a small idea of the Arena scene:
I hope you understand what I mean, I tried everything in my power, but don't know how to fix this.
Best regards,
Goodboi Gamestudios | Monster Jumper now on the App Store
Comments
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
@timolapre1998 yes, I constrained the power of the sword with the attribute 'swordpower'. I made all my scene integers visible ingame and they all reset perfect. I am really lost now.
My code looks something like this:
Code of button swordaction:
if touch is inside, spawn actor powerbar.
if touch is released, and when 'enemypositioninteger' =2 (which means middlefar), change attribute 'enemyhealth' to 'enemyhealth'-'swordpower',
change 'enemypositionrandom' (which makes the enemy spawn random away)
change attribute 'swordpowerbar' to 0 (sets swordpowerbar off)
change attribute 'swordpower' to 0 (sets the power integer of the swordpowerbar to 0)
Like I said, all integers reset perfectly after an actions, but the weirdest thing is my enemy will keep getting hit after the action is done and he spawns back to position 2 (middlefar)..
Please someone help.
Goodboi Gamestudios | Monster Jumper now on the App Store
Hi @BasGoodboy In every case where enemypositioninteger is mentioned, i.e here for one in your sword action rules, reset back to zero before the next spawn. Try that, see if that solves it for you.
if touch is released, and when 'enemypositioninteger' =2 (which means middlefar),
change attribute 'enemypositioninteger' to 0
change attribute 'enemyhealth' to 'enemyhealth'-'swordpower',
change 'enemypositionrandom' (which makes the enemy spawn random away)
change attribute 'swordpowerbar' to 0 (sets swordpowerbar off)
change attribute 'swordpower' to 0 (sets the power integer of the swordpowerbar to 0)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I hope you understand what I mean.
Goodboi Gamestudios | Monster Jumper now on the App Store
I see, then why not give it a "neutral" number that isn't linked with a position? So 4, whatever, is just temporary until the next random spawn position of, presumably, 0, 1 or 2...
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Goodboi Gamestudios | Monster Jumper now on the App Store
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Goodboi Gamestudios | Monster Jumper now on the App Store
@FryingBaconStudios I putted a 0.3 second timer on the respawn after the hit, so the codes have enough time to do their work. This makes no difference tho. The changing of attributes to reset the damage on a newly spawned enemy doesnt make difference, because it's not a new enemy, but still the same, only spawned on an other location. It doesn't get destroyed or anything in the meantime just a new locationspawn.
I notice that the damage rule (change attribute 'enemyhealth' to 'enemyhealth'-'swordpower') isn't the problem, since the opponent doesnt lose health anymore after the original action, but I see there's a problem because I also have a rule that the opponent will change colors to red (like bleedy effect) for 0.3 seconds after the touch release of the sword action, and a rule that plays a sword slash sound, also on the release touch on sword action.
Somehow, the bleed effect and the sword slash are still going true automatically every few seconds after the original action.
By the way @FryingBaconStudios all actions reset perfect before the respawn, I see that at the integers which I putted visible on the scene.
Goodboi Gamestudios | Monster Jumper now on the App Store
Reading your Rules again, I'm not understanding the relationship between 'enemypositioninteger' and 'enemypositionrandom' (I thought they might be the same thing)... ok, so try resetting the enemypositionrandom to 4 this time (or any other number not associated with a position) just after it's chosen it's random position number, and it has triggered the necessary Rules in swordactionrules, etc...
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
So basically it's the same thing.
I'm really stuck here. I am gonna check if I can put on a proper screenshot of the rules here.
Goodboi Gamestudios | Monster Jumper now on the App Store
Hmm, are you certain that "swordpowerbar" and sword power" attributes are being reset to 0 then; and if they are perhaps add at the beginning of the sword Rule "and when swordpowerbar <> 0 and sword power <> 0".... see if that does it...
It's basically as @FryingBaconStudios is saying (well, and me!); it's to reset everything before the next random spawn every time, which would surely solve your problem.
I'm still clutching at straw here a bit trying to help because I only half-understand what's going on with your Rules...
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Code of the swordpowerbar:
(spawns when an integer called 'swordpowerbar' = 1 and destroys when 'swordpowerbar' = 0 and every second generates power with an integer called 'swordpower'):
Code of swordbutton:
Goodboi Gamestudios | Monster Jumper now on the App Store
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
But it is still not exactly what I am aiming for. Now, indeed, the weird swordslash sounds and bleed effect won't show up on other spawns, so that's super!
Only now, if you click the swordaction, and the opponent is spawned on an other position then 'middlefar' (closeby or far away), you can build up the sword action bar with energy like it's supposed to, but you can't release it when the opponent gets spawned on the middlefar position, this goes automatically. This makes the difficulty very easy. Also, when the opponent is already spawned at the middlefar position, and you press the sword action button, there is no energy gaining in the sword action bar, it's an automaticaly hit on the lowest energy.
Hope you understand what I mean.
Goodboi Gamestudios | Monster Jumper now on the App Store
Also try (I'm harping on about this aspect.... ;-) ) in that last Rule:
When touch is released ---or pressed as Dave suggested--
When game.Aren...=1
When game.ArenaRandomAction = 3
Change Attribute game.ArenaRandomAction to 0
---etc as you've already got
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Still I have that issue. But now I'm wandering with the option @FryingBaconStudios gave me if it isn't cooler to make the powerbar go up and down very fast and first tap it spawns and second tap it hits.. might be cooler, and I think I know how to do this now!
Goodboi Gamestudios | Monster Jumper now on the App Store
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
I know that vid @FryingBaconStudios. And I know my coding is a bit spread out, I'm a chaotic man but it worked until now. Still am quite a noob in GS but proud on the results so far.
Goodboi Gamestudios | Monster Jumper now on the App Store