How to commit or test an added script?
How to commit or test an added script?
Pretty simple question, I probably just missed it somewhere...
So I created blade_bash.lua (this wasn't in the abilities folder). Trying to test it on my test server, but keeps says "Unable to use job ability."
I put it in </scripts/globals/abilities/>, then used TortoiseSVN to 'add' the file. Now it has a blue + in the bottom left corner of the file icon. Tried to commit, but it gives me an error. Did I miss something, or am I just completely stupid?
Thanks,
K.
So I created blade_bash.lua (this wasn't in the abilities folder). Trying to test it on my test server, but keeps says "Unable to use job ability."
I put it in </scripts/globals/abilities/>, then used TortoiseSVN to 'add' the file. Now it has a blue + in the bottom left corner of the file icon. Tried to commit, but it gives me an error. Did I miss something, or am I just completely stupid?
Thanks,
K.
Re: How to commit or test an added script?
committing is adding it to the central repository so everyone else can get it - only the developers can do that
if the script is just in the right folder with the right name, it'll be read by the game server. my guess is there's an error in the script somewhere, you can check what the DSGameServer spits out when you try to use it
if the script is just in the right folder with the right name, it'll be read by the game server. my guess is there's an error in the script somewhere, you can check what the DSGameServer spits out when you try to use it
Re: How to commit or test an added script?
It's in the right folder, but still giving me this message...GameServer says PERFORMING ACTION 09.
I delete the file, and it says the same thing...but when I delete another ability, such as konzen-ittai.lua, is gives an error message saying it can't find the file.
I delete the file, and it says the same thing...but when I delete another ability, such as konzen-ittai.lua, is gives an error message saying it can't find the file.
Re: How to commit or test an added script?
hmm.. do you have merit points in it?
Re: How to commit or test an added script?
Yes, one. Was trying to implement the plague duration based on level as well. I commented out the addStatusEffect, though, and it still doesnt workkjLotus wrote:hmm.. do you have merit points in it?
Code: Select all
function OnAbilityCheck(player,target,ability)
if (not player:isWeaponTwoHanded()) then
return MSGBASIC_NEEDS_2H_WEAPON,0;
else
return 0,0;
end
end;
function OnUseAbility(player, target, ability)
-- Stun rate
if(math.random()*100 < 99) then
target:addStatusEffect(EFFECT_STUN,1,0,6);
end
-- Blade Bash does not deal damage. -- Source: http://wiki.bluegartr.com/bg/Blade_Bash
local damage = 0;
-- Applying Plague based on merit level.
-- target:addStatusEffect(EFFECT_PLAGUE,1,0,30 + (20 * player:getMerit(MERIT_BLADE_BASH)));
target:delHP(damage);
target:updateEnmityFromDamage(player,damage);
return damage;
end;
Re: How to commit or test an added script?
not supposed to have to... let me see what happens on mineVolgin wrote:Do I have to edit another file along with this, like ai_char_normal.cpp?
edit: ok.. it had the wrong validTargets listed in the db. if you update and rerun abilities.sql it should try to grab the script now. I didn't change the message (defaults to "x uses y. z takes # damage.") so you'll probably want to change that in the DB as well
Re: How to commit or test an added script?
That worked, thanks!kjLotus wrote:not supposed to have to... let me see what happens on mineVolgin wrote:Do I have to edit another file along with this, like ai_char_normal.cpp?
edit: ok.. it had the wrong validTargets listed in the db. if you update and rerun abilities.sql it should try to grab the script now. I didn't change the message (defaults to "x uses y. z takes # damage.") so you'll probably want to change that in the DB as well
If I may ask one more question...
Code: Select all
player:getMerit(MERIT_BLADE_BASH)
I tried:
Code: Select all
player:getMerit(MERIT_BLADE_BASH,0)
player:getMerit(MERIT_BLADE_BASH,player)
player:getMerit(2754)
Re: How to commit or test an added script?
lua_State is just the current state of the entire lua interpreter. When you call getMerit, anything you passed in gets pushed on to the stack. Then, in the c++ lua function, anything you passed in can get popped with lua_toxxx (in the case of getMerit, lua_tointeger) which takes the state and the position on the stack as the parameter. Then, when you're done, you push return values back on to the stack, and return the number of values you pushed on to return (so that the lua side knows how many there were). in the case of getMerit
is taking the first parameter passed in, calling GetMeritValue with is, and then passing what that returns back to the lua function that requested it
long story short, it's just getMerit(MERIT_TYPE), and it returns "value" (from database, merit table) times the number of points put in.
when you say "it doesn't work", what is happening specifically?
Code: Select all
lua_pushinteger(L, PChar->PMeritPoints->GetMeritValue((MERIT_TYPE)lua_tointeger(L,1), PChar));
long story short, it's just getMerit(MERIT_TYPE), and it returns "value" (from database, merit table) times the number of points put in.
when you say "it doesn't work", what is happening specifically?
Re: How to commit or test an added script?
When I just use the default duration at:
It wears off in 30 seconds, like it should. However, when I add:
Plague doesn't come off. Being impatient with it, I changed it to EFFECT_BIND, and it wore off in 150seconds...meaning it got the value 7 from getMerit(MERIT_BLADE_BASH), when I only have it at 1 merit....and I don't think that's correct lol. With the above, it should give an extra 20 seconds per merit level, starting at 30seconds.
Code: Select all
target:addStatusEffect(EFFECT_PLAGUE,1,0,30);
Code: Select all
target:addStatusEffect(EFFECT_PLAGUE,1,0,10 + (20 * player:getMerit(MERIT_BLADE_BASH) ));
kjLotus wrote: when you say "it doesn't work", what is happening specifically?
Re: How to commit or test an added script?
you can print it and it'll come to the console