• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Question about lua and C++ // TFS 1.1

darkshin

New old member
Joined
Dec 14, 2010
Messages
231
Reaction score
21
Hello Guys,

I'm trying to make a function that creates a monster, like the command /m. But within the sources, and I've tried almost all the functions inside of it and always debug. I wanted to use the /m function to make it easier, but it's a Lua Script function, there's any way to call it inside other C++ file ?
 
Hi guys, thanks for replying :D

I'm trying to create a source response for NPC's that have a key when they are attacked. That response should be creating a monster where the NPC is. But the server is getting debugged with the functions "createMonster", "internalPlaceMonster" or "placeMonster". But, the createMonster luaFunction from luascript.cpp is already set up and working correctly. So I thought, why I shouldn't call it directly instead of the other functions that are bugging? Then I just failed calling it.

Any ideas?

or just Game.createMonster("name", pos)
That's the luaFunction I'm talking about. The Monster::createMonster(string) don't have a pos. So, I'm asking if I can call this luaFunction inside the code sources.

Yes, but what is it that you want to do? Why use the source?

Ignazio
I want to do it at sources because I think I suck in Lua, I'm getting more accomplishments in sources than in lua. Look one of my failures here: https://otland.net/threads/guard-npc-v0-1-1-0-should-work-for-0-3-x.210589/page-2#post-2251344 >.<
 
Back
Top