• ✨ 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

[0.28.2]Moves that still don't work properly

Status
Not open for further replies.

Darkfire

Administrator
Administrator
P3D Developer
Ah
and so we can either make a .dat or a .lua?
and it will run either of them properly?
 

DracoHouston

Kolben Developer
Contributor
Ah
and so we can either make a .dat or a .lua?
and it will run either of them properly?
the way i had it was it would look for a lua file, if one didnt exist it looked for a dat file, if one didnt exist it freaks out and crashes like it does now if the dat doesnt exist :p
 

Darkfire

Administrator
Administrator
P3D Developer
ah thats cool.
Is there a way in Lua to set up functions withing functions?
so we would type Textdisp(stuff) and it would read for the line seperators like it does now?
 

DracoHouston

Kolben Developer
Contributor
ah thats cool.
Is there a way in Lua to set up functions withing functions?
so we would type Textdisp(stuff) and it would read for the line seperators like it does now?
yep

Code:
function ATTACKS_ROCK_ANCIENTPOWER_ATTACKING_ANIMATION()
    if Attacks_Store == "1" then
        AnimationSequenceBegin()
            DoStatChanceAnimation(5, 0.0)
        AnimationSequenceEnd()
        Attacks_SetStore("0")
    end
end
Code:
-- the p3d stat change animation, play during attack when you are going to gain stats, in hit when the target will.
-- does not include the start and end sequence calls, so it can be chained
-- change determines what animation you get and how many particles spawn
-- negative values will produce red particles that go down
-- positive values will produce blue particles that go up
-- the amount of particles spawned is based on change, 40 * change particles will be spawned. 
-- start delay is the time in seconds it takes to start. 
-- each update tick is 0.1 seconds so times more granular than 0.1 seconds will be in effect rounded up or down to the nearest 0.1 second
function DoStatChanceAnimation(Change, startDelay)
    local T = ""
    local StartX = 0.0
    local StartY = 0.0
    local StartZ = 0.0
    local DestX = 0.0
    local DestY = 0.0
    local DestZ = 0.0
    local PX = 0.0
    local PZ = 0.0
    local Delay = 0.0
    if Change > 0 then
        T = "Textures\\Battle\\StatChange\\statUp"
        DestY = 0.8
        StartY = -0.45
    else
        T = "Textures\\Battle\\StatChange\\statDown"
        StartY = 0.8
        DestY = -0.45
        Change = Change - (Change * 2)
    end
    for i = 0, 40 * Change, 1 do
            PX = (math.random() - 0.5) * 1.5
            PZ = (math.random() - 0.5) * 1.5
            StartX = PX
            StartZ = PZ
            DestX = PX
            DestZ = PZ
            Delay = math.random() * 7.0
            AttacksSpawnMovingAnimation(StartX,StartY,StartZ,T, 0.1, 0.1, 0.1, DestX, DestY, DestZ, 0.05, false, true, Delay + startDelay, 0.0)
        end
end
so i don't have to type all that out for every attack that has a stat change animation
 

DracoHouston

Kolben Developer
Contributor
in fact, is waiting for input is something i wrote to simplify checking for 2 kinds of waiting for input
Code:
--check to see if the player is in a text box or pokemon image
function IsWaitingForInput()
    if (TextBoxShowing == true) then
        return true
    end
    if (PokemonViewBoxShowing == true) then
        return true
    end
    return false
end
 

DracoHouston

Kolben Developer
Contributor
its possible to make functions that arent global too like
Code:
SomeTable = {}
SomeTable["somemethod"] = function(i, j) return i + j end
local i = SomeTable.somemethod(1, 1)
Text("The result is " .. tostring(i))
would make a text box saying 'The result is 2', i think, i havent had to use it yet lol
 

Darkfire

Administrator
Administrator
P3D Developer
While we are talking about this how do Achievements work currently?
same with the @Achievements command?
'@Achievements:{2}|' works
what is the point of the (optional) string. AFAIK it does nothing...
 

DracoHouston

Kolben Developer
Contributor
While we are talking about this how do Achievements work currently?
same with the @Achievements command?
'@Achievements:{2}|' works
what is the point of the (optional) string. AFAIK it does nothing...
no idea, i didnt make that.
 

Darkfire

Administrator
Administrator
P3D Developer
so I was just bug fixing the Leech life script
It was atempting to use decimals after dividing by half
and it fully healed my charizard
what did i do wrong?
Code:
local drain = math.ceil(Attacks_DamageDealt / 2)
was what i changed it to
I added math.ceil(...)
any reason why charizard gains 230 hp?
 

Darkfire

Administrator
Administrator
P3D Developer
so the function Attacks_DamageDealt does not take into account doing more damage than the HP that an opponent has.....
and so Leech life dealt a ton of damaga(lvl100 charizard vs lvl 1 chickorita...)
 

DracoHouston

Kolben Developer
Contributor
so the function Attacks_DamageDealt does not take into account doing more damage than the HP that an opponent has.....
and so Leech life dealt a ton of damaga(lvl100 charizard vs lvl 1 chickorita...)
yes, this behaviour existed in the old system too. its something that has to be changed in the engine
also, good catch
nilllzz please change that in leechlife.lua
local drain = Attacks_DamageDealt / 2
becomes what darkfire posted
 
Status
Not open for further replies.
Top