Page 1 of 1

[ManaServ] Questions about scripting

Posted: 25 Jan 2010, 14:16
by strikerbcb
hello, i have some more questions about manaserv, in scripting for be more specifc :

1 - Its possible to use multi-line text in npcs ?
ex:
[NPC NAME]
Hello im a npc!
I want to talk all little texts in one
window without the 'next'

2 - It's possible to make little formating stuff in text, like align, italic, bold, alter text colors, etc ?

3 - Its possible to make a multi-function npc, for example:

function NPC(npc, ch)
variable1 =
if ( variable1 == 1) then
-- call other function
CALL2
else
-- closes the npc window
end

function CALL2()
-- function CALL2 called
end

I really appreciate all the help you've given me, if some of this questions its not possible, i want to sugest them to make the game better.

Thanks

Re: [ManaServ] Questions about scripting

Posted: 25 Jan 2010, 14:44
by Crush
1: I can't test it right now but you should be able to add line-breaks to NPC text using \n (or was it /n? I can never remember that...)

2: You can change the color in a message box with the codes ##0 to ##9 in the message. Other markups aren't possible as far as I know.

3. LUA is a full-fledged programming language. Of course it's possible to modularize NPC talk functions by exporting code into sub-functions and call them from the main talk function.

But keep the variable scoping rules in mind. When you need the npc handle or character handle in the sub-function you either have to pass them to the sub-function or you have to declare the sub-function locally inside the function you are calling it from.

Re: [ManaServ] Questions about scripting

Posted: 25 Jan 2010, 15:28
by Jaxad0127
Crush wrote:1: I can't test it right now but you should be able to add line-breaks to NPC text using \n (or was it /n? I can never remember that...)
\n
eAthena supports it too.
Crush wrote:2: You can change the color in a message box with the codes ##0 to ##9 in the message. Other markups aren't possible as far as I know.
Those aren't usable for NPCs.

Re: [ManaServ] Questions about scripting

Posted: 17 Feb 2010, 18:05
by strikerbcb
ok, other question ... How i can handle in scripting for add or remove HP and/or Mana from a character ?, i don´t see anything in the docs about this ...

For example, if i create a inn npc, i need to make the player 100% restored. HP, Mana and Status.

Re: [ManaServ] Questions about scripting

Posted: 17 Feb 2010, 18:23
by Crush
strikerbcb wrote:For example, if i create a inn npc, i need to make the player 100% restored. HP, Mana and Status.
Gotcha, that's something we haven't thought about yet.

But when you want to hurt a player or monster you can do this with mana.being_damage. You can not use this for healing, because manaserv does not allow attacks to cause negative damage.

Re: [ManaServ] Questions about scripting

Posted: 17 Feb 2010, 23:04
by strikerbcb
well i think this, the most complete charsheet and the sell ability ( permit to sell all items the player have in inventory, not only some items ... ) its basic things i think a mmorpg MUST have and have to be a more bigger priority.

one more time, it´s i think ...

Re: [ManaServ] Questions about scripting

Posted: 21 Feb 2010, 14:58
by strikerbcb
more comands needed :

* get actual base level from player
* set level(s) from player
* remove level(s) from player

Re: [ManaServ] Questions about scripting

Posted: 26 Feb 2010, 16:56
by Crush
Regarding the request for healing characters:
We just implemented a script function mana.being_heal for this purpose. For details refer to the documentation on http://wiki.manasource.org/scripting#manabeing_heal

Regarding manipulating character level:
The character level is calculated from the experience points of the character, so manipulating it directly wouldn't make sense. But you can manipulate it indirectly by manipulating the characters experience points with mana.chr_give_exp.
http://wiki.manasource.org/scripting#manachr_give_exp

Regarding manipulating mana points:
The manaserv magic system is a bit different from most games. There are no general purpose magic points. Instead of that every spell has its separate mp pool. Details on http://wiki.themanaworld.org/index.php/Magic_system
The implementation of this system is still incomplete, but when it is finished you can be sure that there will be plenty of script functions to interact with it.

Re: [ManaServ] Questions about scripting

Posted: 27 Feb 2010, 02:01
by Jaxad0127
Crush wrote:(details about manaserv now and planned additions for tmw)
You can of course hack Manaserv to work how you want. In the future, I'd like to make it easier to customize the systems. If you want it to behave roughly like eAthena, go ahead. Just don't copy code from eAthena, it's too messy.