[ManaServ] Questions about scripting

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

Post Reply
User avatar
strikerbcb
Novice
Novice
Posts: 155
Joined: 15 Apr 2005, 06:42
Location: Brasil
Contact:

[ManaServ] Questions about scripting

Post 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
<<Striker>> - Evolving Ever
Project World of Dragons - Brazilian Total Rework Fork of the TMW and a newer 3D Client/Server
Mundo dos Dragões - http://www.mundodosdragoes.org
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Re: [ManaServ] Questions about scripting

Post 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.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
Jaxad0127
Manasource
Manasource
Posts: 4209
Joined: 01 Nov 2007, 17:35
Location: Internet

Re: [ManaServ] Questions about scripting

Post 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.
Image
User avatar
strikerbcb
Novice
Novice
Posts: 155
Joined: 15 Apr 2005, 06:42
Location: Brasil
Contact:

Re: [ManaServ] Questions about scripting

Post 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.
<<Striker>> - Evolving Ever
Project World of Dragons - Brazilian Total Rework Fork of the TMW and a newer 3D Client/Server
Mundo dos Dragões - http://www.mundodosdragoes.org
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Re: [ManaServ] Questions about scripting

Post 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.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
strikerbcb
Novice
Novice
Posts: 155
Joined: 15 Apr 2005, 06:42
Location: Brasil
Contact:

Re: [ManaServ] Questions about scripting

Post 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 ...
<<Striker>> - Evolving Ever
Project World of Dragons - Brazilian Total Rework Fork of the TMW and a newer 3D Client/Server
Mundo dos Dragões - http://www.mundodosdragoes.org
User avatar
strikerbcb
Novice
Novice
Posts: 155
Joined: 15 Apr 2005, 06:42
Location: Brasil
Contact:

Re: [ManaServ] Questions about scripting

Post by strikerbcb »

more comands needed :

* get actual base level from player
* set level(s) from player
* remove level(s) from player
<<Striker>> - Evolving Ever
Project World of Dragons - Brazilian Total Rework Fork of the TMW and a newer 3D Client/Server
Mundo dos Dragões - http://www.mundodosdragoes.org
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Re: [ManaServ] Questions about scripting

Post 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.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
Jaxad0127
Manasource
Manasource
Posts: 4209
Joined: 01 Nov 2007, 17:35
Location: Internet

Re: [ManaServ] Questions about scripting

Post 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.
Image
Post Reply