New LUA Function: SetPlayerLevel
Moderator: Team Members
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
-
patrikpatrik
- Posts: 16
- Joined: Wed Aug 03, 2016 8:43 am
Re: New LUA Function: SetPlayerLevel
Hi Jabantiz,
Thanks for the 3 functions, the Addcoin() and RemoveCoin() works great but for SetPlayerLevel() I'm getting LUA SetPlayerLevel command error: new level can't be 0.
I tried SetPlayerLevel(Spawn, 50) but for some reason level thinks its still 0. In *.cpp I'm looking at line 8373
Is this the culprit?
Thanks for the 3 functions, the Addcoin() and RemoveCoin() works great but for SetPlayerLevel() I'm getting LUA SetPlayerLevel command error: new level can't be 0.
I tried SetPlayerLevel(Spawn, 50) but for some reason level thinks its still 0. In *.cpp I'm looking at line 8373
Code: Select all
if (level == 0) {
lua_interface->LogError("LUA SetPlayerLevel command error: new level can't be 0");
return 0;
}
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: New LUA Function: SetPlayerLevel
That is a safety check to make sure correct values are being set, the issue is where level is set
that 1 should actually be a 2
Basically I screwed up because I am so use to starting at 0 and counting up where in lua it starts at 1, sorry about that.
Code: Select all
int8 level = lua_interface->GetInt8Value(state, 1);
Code: Select all
int8 level = lua_interface->GetInt8Value(state, 2);
-
patrikpatrik
- Posts: 16
- Joined: Wed Aug 03, 2016 8:43 am
Re: New LUA Function: SetPlayerLevel
No problem, recompiled it and works fine now thanks!
Btw, just out of curiosity, is there a way to make the voiceover functions to play one after another instead of all jumbled at once?
Btw, just out of curiosity, is there a way to make the voiceover functions to play one after another instead of all jumbled at once?
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: New LUA Function: SetPlayerLevel
You would play one then you would need to set a timer for the duration of that voice over and in the callback play the next.
-
patrikpatrik
- Posts: 16
- Joined: Wed Aug 03, 2016 8:43 am
Re: New LUA Function: SetPlayerLevel
Of course! That did it, thx!
- Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
Re: New LUA Function: SetPlayerLevel
There are many I think we need.
#castspell
#damage
#aggrozone
#finditem
#mana
Those should be super simple to code. I am not sure why we do not have #damage. That one seems like one everyone would need. You want to aggro something across the way that you have targeted, but you do not want to kill it. #damage 1 would do that. #aggrozone would be something to really help test performance or even pathing for that matter.
#castspell
#damage
#aggrozone
#finditem
#mana
Those should be super simple to code. I am not sure why we do not have #damage. That one seems like one everyone would need. You want to aggro something across the way that you have targeted, but you do not want to kill it. #damage 1 would do that. #aggrozone would be something to really help test performance or even pathing for that matter.
Resident Dirty Hippy
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: New LUA Function: SetPlayerLevel
All LUA Functions
CastSpell
SpellDamage, ProcDamage, ModifyHP, for just agro use AddHate or Attack
Nothing to agro a whole zone, more of a dev thing any way
GetItemByID
Not sure what you intend mana to do but there are various functions for modifying power.
CastSpell
SpellDamage, ProcDamage, ModifyHP, for just agro use AddHate or Attack
Nothing to agro a whole zone, more of a dev thing any way
GetItemByID
Not sure what you intend mana to do but there are various functions for modifying power.
Who is online
Users browsing this forum: No registered users and 1 guest