• ✨ ARCHIVE MODE ✨
    The forum has now been set to read-only mode, no new posts, resources, replies etc will not be possible.
    We recommend you join our Discord server to get real-time response: Discord Invite Link

Not a bug [0.28.2] Magnitude issue + possible fix

Status
Not open for further replies.

SpectreAA

Starting Trainer
I was somewhat disappointed when I found that Magnitude was bugged/unfinished as it's one of my favorite moves for my Geodude. I found that it was only hitting for 2-3 damage and not reporting what magnitude the move was hitting for (Magnitude !).

Now I know barely anything about coding or programming so I was more like a laymen with a scalpel in my attempts to fix the move... but after several hours of trying different ideas I finally have it hitting for variable damage and reporting the magnitude of the hit (without crashing the game!). The first few uses are still not correct, but after the 3rd use it seems to be correct pretty much every time. I found that the line "SetAttackPreAttackDelegate" was not working so I added both functions into a single function.

Here's a copy of my fixed Magnitude file if anyone wants to test it out:

SetAttackBaseDamage(222,10)
SetAttackMaxPP(222,30)
SetAttackCategory(222,0)
SetAttackCategory(222,1)
SetAttackContestCategory(222,0)
SetAttackType(222,4)
SetAttackPriority(222,0)
SetAttackAccuracy(222,255)
SetAttackSpecialAttackDelegate(222, "ATTACKS_GROUND_MAGNITUDE_PRE_ATTACK")

function ATTACKS_GROUND_MAGNITUDE_PRE_ATTACK()
local chance = math.random(0,100)
if chance < 5 then
Attacks_SetBaseDamage(10)
Attacks_AddBattleStep("Message", "Magnitude 4!")
elseif chance >= 5 and chance < 15 then
Attacks_SetBaseDamage(30)
Attacks_AddBattleStep("Message", "Magnitude 5!")
elseif chance >= 15 and chance < 35 then
Attacks_SetBaseDamage(50)
Attacks_AddBattleStep("Message", "Magnitude 6!")
elseif chance >= 35 and chance < 65 then
Attacks_SetBaseDamage(70)
Attacks_AddBattleStep("Message", "Magnitude 7!")
elseif chance >= 65 and chance < 85 then
Attacks_SetBaseDamage(90)
Attacks_AddBattleStep("Message", "Magnitude 8!")
elseif chance >= 85 and chance < 95 then
Attacks_SetBaseDamage(110)
Attacks_AddBattleStep("Message", "Magnitude 9!")
else
Attacks_SetBaseDamage(150)
Attacks_AddBattleStep("Message", "Magnitude 10!")
end
end

P.S. Spaces aren't showing so make sure to indent the lines with 4 spaces before the local, if chance, elseif, and else lines (and the 1st end). 8 spaces after each "if chance" and "elseif" lines, and 12 spaces for every "Attacks_AddBattleStep" line.
 

snoe

Active Member
Magnitude isn't implemented yet. It's just a placeholder right now so it won't work.

Please report to this thread in the future about moves that don't work. It also links to our wiki page that shows all implemented moves.

http://pokemon3d.net/threads/2354/

Also DracoHouston
If players can fix code and get it working. Maybe we can make a thread for people to contribute towards the development on the vanilla game. This could make work a little easier. Just wondering
 

SpectreAA

Starting Trainer
Aye I thought that it maybe wasn't implemented yet and I appologise for not appending it to the current thread, but this was more to inform that I "fixed" it for now.

My code does work pretty well but you may want to doublecheck and alter/trim as necessary. I know only a very basic amount about code so most of it is splicing and copying from other similar files and trying to fill in the gaps as I learn what each thing does. This one really had nothing much to copy from so I tried using logic as to getting the functions to operate. It may work wonderfully as-is once a line is put in to activate the command SetAttackPreAttackDelegate later (seems to have no parent, while SetAttackSpecialAttackDelegate does), as right now it won't run that line at all.

I figure if we can help out and get things working (even temporarily) it would be a major help in the playability and allow more focus on content over repairs and coding moves. If you guys wanted to have a thread for player codes I'd be happy to contribute whenever I get chance. I'd love to see a breakdown of the codes (nothing too detailed, just the basics of how to code a move and why the lines are used) to aid us helping faster. It gets a bit frustrating when your only way of finding out the legal commands are through continual crashes. A forum would also allow us to pose coding questions (like "What's the name of the Teleport ability in the game so I can link Abra's action to it?") so we can solve things we don't have access to.

e.g. (Line-by-line guide)
SetAttackBaseDamage (222, 10) - sets the attack base damage (move #, power)

function ##########
.......Attacks_SetBaseDamage - Overwites base damage with (move#, power)
.......end - ends the "Attacks_Set" line
etc...

Things I'd like to know are what commands I can use for:
Attacks_AddBattleStep (" ?????? ") - Just "Message"?
Base Commands (Set########) and uses
 

DracoHouston

Kolben Developer
Contributor
Magnitude isn't implemented yet. It's just a placeholder right now so it won't work.

Please report to this thread in the future about moves that don't work. It also links to our wiki page that shows all implemented moves.

http://pokemon3d.net/threads/2354/

Also DracoHouston
If players can fix code and get it working. Maybe we can make a thread for people to contribute towards the development on the vanilla game. This could make work a little easier. Just wondering
that was a big reason why i got it working at all. when i was just a modder not being able to play with this stuff annoyed me.
 

DracoHouston

Kolben Developer
Contributor
I was somewhat disappointed when I found that Magnitude was bugged/unfinished as it's one of my favorite moves for my Geodude. I found that it was only hitting for 2-3 damage and not reporting what magnitude the move was hitting for (Magnitude !).

Now I know barely anything about coding or programming so I was more like a laymen with a scalpel in my attempts to fix the move... but after several hours of trying different ideas I finally have it hitting for variable damage and reporting the magnitude of the hit (without crashing the game!). The first few uses are still not correct, but after the 3rd use it seems to be correct pretty much every time. I found that the line "SetAttackPreAttackDelegate" was not working so I added both functions into a single function.

Here's a copy of my fixed Magnitude file if anyone wants to test it out:

SetAttackBaseDamage(222,10)
SetAttackMaxPP(222,30)
SetAttackCategory(222,0)
SetAttackCategory(222,1)
SetAttackContestCategory(222,0)
SetAttackType(222,4)
SetAttackPriority(222,0)
SetAttackAccuracy(222,255)
SetAttackSpecialAttackDelegate(222, "ATTACKS_GROUND_MAGNITUDE_PRE_ATTACK")

function ATTACKS_GROUND_MAGNITUDE_PRE_ATTACK()
local chance = math.random(0,100)
if chance < 5 then
Attacks_SetBaseDamage(10)
Attacks_AddBattleStep("Message", "Magnitude 4!")
elseif chance >= 5 and chance < 15 then
Attacks_SetBaseDamage(30)
Attacks_AddBattleStep("Message", "Magnitude 5!")
elseif chance >= 15 and chance < 35 then
Attacks_SetBaseDamage(50)
Attacks_AddBattleStep("Message", "Magnitude 6!")
elseif chance >= 35 and chance < 65 then
Attacks_SetBaseDamage(70)
Attacks_AddBattleStep("Message", "Magnitude 7!")
elseif chance >= 65 and chance < 85 then
Attacks_SetBaseDamage(90)
Attacks_AddBattleStep("Message", "Magnitude 8!")
elseif chance >= 85 and chance < 95 then
Attacks_SetBaseDamage(110)
Attacks_AddBattleStep("Message", "Magnitude 9!")
else
Attacks_SetBaseDamage(150)
Attacks_AddBattleStep("Message", "Magnitude 10!")
end
end

P.S. Spaces aren't showing so make sure to indent the lines with 4 spaces before the local, if chance, elseif, and else lines (and the 1st end). 8 spaces after each "if chance" and "elseif" lines, and 12 spaces for every "Attacks_AddBattleStep" line.
thats a bug, preattack should trigger for all attacks before attack :|
Aye I thought that it maybe wasn't implemented yet and I appologise for not appending it to the current thread, but this was more to inform that I "fixed" it for now.

My code does work pretty well but you may want to doublecheck and alter/trim as necessary. I know only a very basic amount about code so most of it is splicing and copying from other similar files and trying to fill in the gaps as I learn what each thing does. This one really had nothing much to copy from so I tried using logic as to getting the functions to operate. It may work wonderfully as-is once a line is put in to activate the command SetAttackPreAttackDelegate later (seems to have no parent, while SetAttackSpecialAttackDelegate does), as right now it won't run that line at all.

I figure if we can help out and get things working (even temporarily) it would be a major help in the playability and allow more focus on content over repairs and coding moves. If you guys wanted to have a thread for player codes I'd be happy to contribute whenever I get chance. I'd love to see a breakdown of the codes (nothing too detailed, just the basics of how to code a move and why the lines are used) to aid us helping faster. It gets a bit frustrating when your only way of finding out the legal commands are through continual crashes. A forum would also allow us to pose coding questions (like "What's the name of the Teleport ability in the game so I can link Abra's action to it?") so we can solve things we don't have access to.

e.g. (Line-by-line guide)
SetAttackBaseDamage (222, 10) - sets the attack base damage (move #, power)

function ##########
.......Attacks_SetBaseDamage - Overwites base damage with (move#, power)
.......end - ends the "Attacks_Set" line
etc...

Things I'd like to know are what commands I can use for:
Attacks_AddBattleStep (" ?????? ") - Just "Message"?
Base Commands (Set########) and uses
we already have that forum lol

its sooooooo late right now the sun will be up so i cant elaborate on what you can do with battle steps, but basically everything. it puts a step in the queue so attacks are mostly queueing up a battle step to do something on hit

i'll update the wiki page (yes, theres a wiki page http://pokemon3d.net/wiki/index.php?title=Attacks_API i posted it in the forum you suggested we should have) some time soon
 
Status
Not open for further replies.
Top