Create manaBar
How to create a manaBar below healthBar without changing the source code?
I already did it, close it
Maybe some more people can have the same doubt, you can always share work and help the community.
i was going to post the sam @stayxtru3 stayxtru post how you did it
As far as I know it is not possible to do without changing the source, so much that I can only put changing it.
Note: Google Translate
It's quite easy in reality, just a few changes on the server and client, just use healthPercent as an example, in the drawInformation function, go hunting for variables and functions and seeing what they do
It's pretty simple, I even made a loading bar for spells, see!
http://giphy.com/gifs/LvCCXBYxuZ9qU
yes i know is simple once you know how to do it please post what you did ... to enable it.... everything is simple once learned
Follows prints of the changes I had to make.
Creature.cpp -> http://imgur.com/a/qPJNV Creature.h -> http://imgur.com/a/imvQg Protocolgameparse.cpp -> http://imgur.com/a/bfSdf
Missing the server part of the connection, to receive the mana and refresh
In tfs source change this:
Creature.cpp ->http://imgur.com/Z2m6iqJ Game.cpp -> http://imgur.com/R3KqbiN Game.h -> http://imgur.com/pX6Jtrc Player.h -> http://imgur.com/8D9tk6I Protocolgame.cpp -> http://imgur.com/g979CZn
@Tonin96 my protocolgameparse.cpp is different can you help me ?
im having troubles with all lines lines that i must in otclient sources im using the most new otclient sources `1>..\src\client\creature.cpp(254): error C2065: 'RectbackGroundManaRect': undeclared identifier 1>..\src\client\creature.cpp(255): error C2065: 'backGroundManaRect': undeclared identifier 1>..\src\client\creature.cpp(255): error C2228: left of '.bind' must have class/struct/union 1> ..\src\client\creature.cpp(255): note: type is 'unknown-type' 1>..\src\client\creature.cpp(257): error C2065: 'backGroundManaRect': undeclared identifier 1>..\src\client\creature.cpp(257): error C2228: left of '.top' must have class/struct/union 1> ..\src\client\creature.cpp(257): note: type is 'unknown-type' 1>..\src\client\creature.cpp(258): error C2065: 'bacGroundManaRect': undeclared identifier 1>..\src\client\creature.cpp(258): error C2228: left of '.moveTop' must have class/struct/union 1> ..\src\client\creature.cpp(258): note: type is 'unknown-type' 1>..\src\client\creature.cpp(261): error C2065: 'backGroundManaRect': undeclared identifier 1>..\src\client\creature.cpp(261): error C2228: left of '.expanded' must have class/struct/union 1> ..\src\client\creature.cpp(261): note: type is 'unknown-type' 1>..\src\client\creature.cpp(262): error C2065: 'manaRect': undeclared identifier 1>..\src\client\creature.cpp(262): error C2228: left of '.setWidth' must have class/struct/union 1> ..\src\client\creature.cpp(262): note: type is 'unknown-type' 1>..\src\client\creature.cpp(262): error C2065: 'm_manapercent': undeclared identifier 1>..\src\client\creature.cpp(277): error C2065: 'backGroungManaRect': undeclared identifier 1>..\src\client\creature.cpp(314): error C2065: 'm_manaPerent': undeclared identifier 1>..\src\client\creature.cpp(317): error C2601: 'Creature::turn': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(327): error C2601: 'Creature::walk': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(357): error C2601: 'Creature::stopWalk': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(366): error C2601: 'Creature::jump': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(378): error C2601: 'Creature::updateJump': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(418): error C2601: 'Creature::onPositionChange': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(423): error C2601: 'Creature::onAppear': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(449): error C2601: 'Creature::onDisappear': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(473): error C2601: 'Creature::onDeath': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(478): error C2601: 'Creature::updateWalkAnimation': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(513): error C2601: 'Creature::updateWalkOffset': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(527): error C2601: 'Creature::updateWalkingTile': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(559): error C2601: 'Creature::nextWalkUpdate': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(578): error C2601: 'Creature::updateWalk': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(596): error C2601: 'Creature::terminateWalk': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(623): error C2601: 'Creature::setName': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(629): error C2601: 'Creature::setHealthPercent': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(651): error C2601: 'Creature::setDirection': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(657): error C2601: 'Creature::setOutfit': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(675): error C2601: 'Creature::setOutfitColor': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(691): error C2601: 'Creature::updateOutfitColor': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(706): error C2601: 'Creature::setSpeed': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(718): error C2601: 'Creature::setBaseSpeed': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(728): error C2601: 'Creature::setSkull': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(734): error C2601: 'Creature::setShield': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(740): error C2601: 'Creature::setEmblem': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(746): error C2601: 'Creature::setIcon': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(752): error C2601: 'Creature::setSkullTexture': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(757): error C2601: 'Creature::setShieldTexture': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(772): error C2601: 'Creature::setEmblemTexture': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(777): error C2601: 'Creature::setIconTexture': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(783): error C2601: 'Creature::setSpeedFormula': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(790): error C2601: 'Creature::hasSpeedFormula': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(796): error C2601: 'Creature::addTimedSquare': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(808): error C2601: 'Creature::updateShield': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(822): error C2601: 'Creature::getDrawOffset': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(837): error C2601: 'Creature::getStepDuration': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(894): error C2601: 'Creature::getDisplacement': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(903): error C2601: 'Creature::getDisplacementX': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(918): error C2601: 'Creature::getDisplacementY': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(933): error C2601: 'Creature::getExactSize': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(955): error C2601: 'Creature::getThingType': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(960): error C2601: 'Creature::rawGetThingType': local function definitions are illegal 1> ..\src\client\creature.cpp(310): note: this line contains a '{' which has not yet been matched 1>..\src\client\creature.cpp(310): fatal error C1075: the left brace '{' was unmatched at the end of the file 1> houses.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\creatures.cpp) 1> item.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\game.cpp) 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\effect.cpp) 1> itemtype.cpp 1> lightview.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\houses.cpp) 1> localplayer.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\item.cpp) 1> luafunctions.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\itemtype.cpp) 1> luavaluecasts.cpp 1> map.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\localplayer.cpp) 1> mapio.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\luafunctions.cpp) 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\luavaluecasts.cpp) 1> mapview.cpp 1> minimap.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\map.cpp) 1> missile.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\mapio.cpp) 1> outfit.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\mapview.cpp) 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\minimap.cpp) 1> player.cpp 1> protocolcodes.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\missile.cpp) 1> protocolgame.cpp 1> protocolgameparse.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\player.cpp) 1> protocolgamesend.cpp 1> shadermanager.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\protocolgame.cpp) 1> spritemanager.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\protocolgameparse.cpp) 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\protocolgamesend.cpp) 1> statictext.cpp 1>..\src\client\protocolgameparse.cpp(189): error C2039: 'GameServerCreatureMana': is not a member of 'Proto' 1> c:\users\raquel\desktop\otclient772-master\src\client\protocolcodes.h(28): note: see declaration of 'Proto' 1>..\src\client\protocolgameparse.cpp(189): error C2065: 'GameServerCreatureMana': undeclared identifier 1>..\src\client\protocolgameparse.cpp(189): error C2131: expression did not evaluate to a constant 1> ..\src\client\protocolgameparse.cpp(189): note: failure was caused by non-constant arguments or reference to a non-constant symbol 1> ..\src\client\protocolgameparse.cpp(189): note: see usage of 'GameServerCreatureMana' 1>..\src\client\protocolgameparse.cpp(190): error C3861: 'parseCreatureMana': identifier not found 1>..\src\client\protocolgameparse.cpp(189): error C2051: case expression not constant 1>..\src\client\protocolgameparse.cpp(1175): error C2039: 'parseCreatureMana': is not a member of 'ProtocolGame' 1> c:\users\raquel\desktop\otclient772-master\src\client\protocolgame.h(31): note: see declaration of 'ProtocolGame' 1>..\src\client\protocolgameparse.cpp(1388): error C2039: 'GameDoubleMana': is not a member of 'Otc' 1> c:\users\raquel\desktop\otclient772-master\src\client\const.h(26): note: see declaration of 'Otc' 1>..\src\client\protocolgameparse.cpp(1388): error C2065: 'GameDoubleMana': undeclared identifier 1>..\src\client\protocolgameparse.cpp(2276): error C2374: 'direction': redefinition; multiple initialization 1> ..\src\client\protocolgameparse.cpp(2272): note: see declaration of 'direction' 1>..\src\client\protocolgameparse.cpp(2277): error C2374: 'outfit': redefinition; multiple initialization 1> ..\src\client\protocolgameparse.cpp(2273): note: see declaration of 'outfit' 1>..\src\client\protocolgameparse.cpp(2279): error C2146: syntax error: missing ';' before identifier 'Light' 1> thing.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\spritemanager.cpp) 1> thingtype.cpp 1> thingtypemanager.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\statictext.cpp) 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\thing.cpp) 1> tile.cpp 1> towns.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\thingtype.cpp) 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\thingtypemanager.cpp) 1> uicreature.cpp 1> uiitem.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\tile.cpp) 1> uimap.cpp 1> uimapanchorlayout.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\uicreature.cpp) 1> uiminimap.cpp 1> uiprogressrect.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\uimap.cpp) 1> uisprite.cpp 1>c:\users\raquel\desktop\otclient772-master\src\client\creature.h(83): error C2065: 'm_manaPerccent': undeclared identifier (compiling source file ..\src\client\uiminimap.cpp) ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
pls help i really want this manabar `
I used TFS 1.0, which one are you using?
im using tfs 0.4 but im having error compiling otclient everything was okey but the protocolgameparse.cpp file from otclient mine is a little bit different than yours im using the lastest rev from otclient
You don't need to edit the server sources to add a mana bar.
@Tonin96 my protocolgameparse.cpp is different can you help me ?
@EmersonHenriique are you using tfs 0.3.7? because im having the same trouble @Tonin96 help :3rd_place_medal: us pls also i just pure compile the just for client but mana bar doesn't appear i need some script or something a module? @TwistedScorpio can you help me? i made the changes in otclient side but mana doesnt appear regards
@Felipe1993 OTX But this is not the problem, there is something missing from "onChangeManaPercent" that does not work
@EmersonHenriique did you solved the issue man?? can u help me please :(