• 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!

C++ Add "space" to Animatedtext on source

Zell

Intermediate OT User
Joined
Oct 23, 2010
Messages
214
Reaction score
117
Hi everyone, i have a problem with a simple c++ code, I'm trying to send a Animatedtext to player when it takes damage but appears at the same time the Red numbers of the dmg and they mix on the screen.

So i try to give to the others letters space, for see something like: 50 (damage taked) -25 (my animated text)

here is the lines of the buffer/animated text functions:

Code:
 if((int32_t)damageChange != 0)
                    {
                        damage -= (int32_t)damageChange + 1;
              
                        char buffer2[150];
                   
      
   HERE I NEED SPACE!!                ----->      // sprintf(buffer2, "     -%d");
                       
                     
             ----->       //    target->getPlayer()->sendAnimatedText(targetPos, 15, buffer2);
                
                         
                    }
                }
 
doSendAnimatedText only supports 9 characters thru the original client and im not sure if it supports spaces? I remember trying something with spaces and it didn't work. Dont quote me tho.. OTC im sure its possible?

Could try one of the alt spaces? So put these in the sendAnimatedText before the (-25)?
alt+32
alt+255
alt+0160

You can do somethin like this to delay the message slightly?

Code:
addEvent(function()
doSendAnimatedText(getCreaturePosition~
end, 200)

Hope this helps GL.
 
doSendAnimatedText only supports 9 characters thru the original client and im not sure if it supports spaces? I remember trying something with spaces and it didn't work. Dont quote me tho.. OTC im sure its possible?

Could try one of the alt spaces? So put these in the sendAnimatedText before the (-25)?
alt+32
alt+255
alt+0160

You can do somethin like this to delay the message slightly?

Code:
addEvent(function()
doSendAnimatedText(getCreaturePosition~
end, 200)

Hope this helps GL.

Thanks for help, but I can't make spaces with ALT+..
and i try make with addevent, but i can't (i think im retarded i have no enought idea about c++)

Code:
    addEvent(function()
                                         
                                           doSendAnimatedText(getCreaturePosition(cid),"     -".. buffer2, 15)
                                           end, 200)

3990 C:\game.cpp `function' was not declared in this scope
and the same for event, and end..
 
No no use the add Event code in the Lua script I should have specified sry. if there is a lua script im assuming since your calling doSendAnimated~?

if you want the c++ code for animatedText go into your luascript.cpp and search for doSendAnimatedText.

If you want to know how to delay the function call go to AddEvent in luascript as well.. something like g_scheduler.addEvent(createSchedulerTask((delay, ~

but yea you can delay in lua script instead not c+

On ma phone otherwise can help more later
 
Last edited:
No no use the add Event code in the Lua script I should have specified sry. if there is a lua script im assuming since your calling doSendAnimated~?

if you want the c++ code for animatedText go into your luascript.cpp and search for doSendAnimatedText.

If you want to know how to delay the function call go to AddEvent in luascript as well.. something like g_scheduler.addEvent(createSchedulerTask((delay, ~

but yea you can delay in lua script instead not c+

On ma phone otherwise can help more later

Thx anyway, i'll fix it!

but now I have another problem with a function.

I want to use GetdistanceTo, for use in spells, I try copy/pasting the code for npc and changing some lines but i can't make it.

Do you know any way for check if the target are in <= range from me? and checking if target is on pztile and so on..?
 
Back
Top