here are tha pix
it also give 1 hp damage
✨ 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
iunno nils probably didnt fix something? the script i wrote works perfectly with the code i gave him weeks agoDream eater should only activate if a user is asleep.
Since this isnt the case it seems to be trying to do damage anyways
and because of that will only do minimal damage.
DracoHouston
What do you make of this
iunno nils probably didnt fix something? the script i wrote works perfectly with the code i gave him weeks agoDream eater should only activate if a user is asleep.
Since this isnt the case it seems to be trying to do damage anyways
and because of that will only do minimal damage.
DracoHouston
What do you make of this
SetAttackBaseDamage(138,100)
SetAttackMaxPP(138,15)
SetAttackCategory(138,1)
SetAttackContestCategory(138,1)
SetAttackType(138,13)
SetAttackPriority(138,0)
SetAttackAccuracy(138,255)
SetAttackAttackCategory(138, 2)
SetAttackSpecialAttackDelegate(138, "ATTACKS_PSYCHIC_DREAM_EATER_SPECIAL")
SetAttackPreAttackDelegate(138, "ATTACKS_PSYCHIC_DREAM_EATER_PRE_ATTACK")
no, that is special category, specialdamage attack category. the problem is preattack either isnt happening, the function that checks status effect isn't working, or absolute damage isn't working. the pre attack checks for target for sleep, if the target is not asleep it sets the store string to 0 or 1, it also sets absolute damage to 0 if the target is not asleep, sets it to -1 if it is (-1 means no absolute damage, calculate damage off power, STAB, type, etc)iunno nils probably didnt fix something? the script i wrote works perfectly with the code i gave him weeks agowould the probelm be the seperate attackcatergory's?Code:SetAttackBaseDamage(138,100) SetAttackMaxPP(138,15) SetAttackCategory(138,1) SetAttackContestCategory(138,1) SetAttackType(138,13) SetAttackPriority(138,0) SetAttackAccuracy(138,255) SetAttackAttackCategory(138, 2) SetAttackSpecialAttackDelegate(138, "ATTACKS_PSYCHIC_DREAM_EATER_SPECIAL") SetAttackPreAttackDelegate(138, "ATTACKS_PSYCHIC_DREAM_EATER_PRE_ATTACK")
function ATTACKS_PSYCHIC_DREAM_EATER_PRE_ATTACK()
-- we set the absolute damage and store to tell the battle and special how this check turned out
if Attacks_GetTargetStatusEffect("target") ~= "asleep" then
Attacks_SetStore("0")
-- make it do no damage but still attack, so special attack can trigger
Attacks_SetAbsoluteDamage(0)
else
-- if absolute damage is set to -1 it goes back to calculating based on type, STAB, crit, power etc
Attacks_SetAbsoluteDamage(-1)
Attacks_SetStore("1")
end
end
those would make no difference. ~= means 'not equal' in LUA, <> in BASIC and != in most other thingsisnt it supposed to be = = not ~=Code:function ATTACKS_PSYCHIC_DREAM_EATER_PRE_ATTACK() -- we set the absolute damage and store to tell the battle and special how this check turned out if Attacks_GetTargetStatusEffect("target") ~= "asleep" then Attacks_SetStore("0") -- make it do no damage but still attack, so special attack can trigger Attacks_SetAbsoluteDamage(0) else -- if absolute damage is set to -1 it goes back to calculating based on type, STAB, crit, power etc Attacks_SetAbsoluteDamage(-1) Attacks_SetStore("1") end end
or
should the SetStore("1")
come before the SetAbsoluteDamage
those would make no difference. ~= means 'not equal' in LUA, <> in BASIC and != in most other thingsisnt it supposed to be = = not ~=Code:function ATTACKS_PSYCHIC_DREAM_EATER_PRE_ATTACK() -- we set the absolute damage and store to tell the battle and special how this check turned out if Attacks_GetTargetStatusEffect("target") ~= "asleep" then Attacks_SetStore("0") -- make it do no damage but still attack, so special attack can trigger Attacks_SetAbsoluteDamage(0) else -- if absolute damage is set to -1 it goes back to calculating based on type, STAB, crit, power etc Attacks_SetAbsoluteDamage(-1) Attacks_SetStore("1") end end
or
should the SetStore("1")
come before the SetAbsoluteDamage
SetAttackBaseDamage(138,100)
SetAttackMaxPP(138,15)
SetAttackCategory(138,1)
SetAttackContestCategory(138,1)
SetAttackType(138,13)
SetAttackPriority(138,0)
SetAttackAccuracy(138,255)
SetAttackAttackCategory(138, 2)
SetAttackSpecialAttackDelegate(138, "ATTACKS_PSYCHIC_DREAM_EATER_SPECIAL")
SetAttackPreAttackDelegate(138, "ATTACKS_PSYCHIC_DREAM_EATER_PRE_ATTACK")
no difference, it could go anywherethose would make no difference. ~= means 'not equal' in LUA, <> in BASIC and != in most other thingsshouldnt pre attack come before the special?Code:SetAttackBaseDamage(138,100) SetAttackMaxPP(138,15) SetAttackCategory(138,1) SetAttackContestCategory(138,1) SetAttackType(138,13) SetAttackPriority(138,0) SetAttackAccuracy(138,255) SetAttackAttackCategory(138, 2) SetAttackSpecialAttackDelegate(138, "ATTACKS_PSYCHIC_DREAM_EATER_SPECIAL") SetAttackPreAttackDelegate(138, "ATTACKS_PSYCHIC_DREAM_EATER_PRE_ATTACK")
gahhhhhh! i want to learn how to pick up on these things so i can better help people.no difference, it could go anywhereshouldnt pre attack come before the special?Code:SetAttackBaseDamage(138,100) SetAttackMaxPP(138,15) SetAttackCategory(138,1) SetAttackContestCategory(138,1) SetAttackType(138,13) SetAttackPriority(138,0) SetAttackAccuracy(138,255) SetAttackAttackCategory(138, 2) SetAttackSpecialAttackDelegate(138, "ATTACKS_PSYCHIC_DREAM_EATER_SPECIAL") SetAttackPreAttackDelegate(138, "ATTACKS_PSYCHIC_DREAM_EATER_PRE_ATTACK")
SetAttackBaseDamage(138,100)
SetAttackMaxPP(138,15)
SetAttackCategory(138,1)
SetAttackContestCategory(138,1)
SetAttackType(138,13)
SetAttackPriority(138,0)
SetAttackAccuracy(138,255)
SetAttackAttackCategory(138, 2)
SetAttackSpecialAttackDelegate(138, "ATTACKS_PSYCHIC_DREAM_EATER_SPECIAL")
SetAttackPreAttackDelegate(138, "ATTACKS_PSYCHIC_DREAM_EATER_PRE_ATTACK")
function ATTACKS_PSYCHIC_DREAM_EATER_PRE_ATTACK()
-- we set the absolute damage and store to tell the battle and special how this check turned out
if Attacks_GetTargetStatusEffect("target") ~= "asleep" then
Attacks_SetStore("0")
-- make it do no damage but still attack, so special attack can trigger
Attacks_SetAbsoluteDamage(0)
else
-- if absolute damage is set to -1 it goes back to calculating based on type, STAB, crit, power etc
Attacks_SetAbsoluteDamage(-1)
Attacks_SetStore("1")
end
end
function ATTACKS_PSYCHIC_DREAM_EATER_SPECIAL()
if Attacks_Store == "1" then
--the target was asleep, drain
local restore = math.floor(Attacks_DamageDealt / 2)
if restore <= 0 then
restore = 1
end
Attacks_AddBattleStep("GainHP", Attacks_TargetString .. "|" .. tostring(restore))
Attacks_AddBattleStep("Message", Attacks_PrimaryTargetName .. " dream was eaten!")
else
--the target is awake, do nothing. it also would not have done damage
Attacks_AddBattleStep("Message", "But it failed...")
end
end
function ATTACKS_PSYCHIC_DREAM_EATER_PRE_ATTACK()
--THIS IF MIGHT NOT BE WORKING
-- we set the absolute damage and store to tell the battle and special how this check turned out
if Attacks_GetTargetStatusEffect("target") ~= "asleep" then
--THIS SEEMS TO WORK I THINK
Attacks_SetStore("0")
-- make it do no damage but still attack, so special attack can trigger
--THIS MIGHT NOT BE WORKING
Attacks_SetAbsoluteDamage(0)
else
-- if absolute damage is set to -1 it goes back to calculating based on type, STAB, crit, power etc
Attacks_SetAbsoluteDamage(-1)
Attacks_SetStore("1")
end
end
If target0 = "0" Then
If IsTrainerBattle = False And Basic.Player.DifficultyMode = 0 Then
damage += 1
End If
Else
If IsTrainerBattle = False And Basic.Player.DifficultyMode = 0 Then
damage -= 1
End If
End If