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

Simulate walking creatures

Bakasura

Active Member
Joined
Jan 20, 2019
Messages
20
Solutions
1
Reaction score
26
Hey!
I need some help with making my module more dynamic. I made the tasks presentation module with creatures displayed using UICreature styles.
Now I want to make them move but I don't have any idea how to do this.
First I've tried to set some event for changing the direction using
Lua:
outfit:getCreature():setDirection(3)
but it doesn't change anything.
The aim is to simulate the walk of creatures in different directions just like normal monsters on map.

Can someone give me some tips how to make them more dynamic?

37305
 
Hey!
I need some help with making my module more dynamic. I made the tasks presentation module with creatures displayed using UICreature styles.
Now I want to make them move but I don't have any idea how to do this.
First I've tried to set some event for changing the direction using
Lua:
outfit:getCreature():setDirection(3)
but it doesn't change anything.
The aim is to simulate the walk of creatures in different directions just like normal monsters on map.

Can someone give me some tips how to make them more dynamic?

View attachment 37305
to use animations instead of sprites without object builder?
 
It can't be made without changes in client source.
UICreature use "drawSelf " function which call "Creature::drawOutfit":
Code:
void Creature::drawOutfit(const Rect& destRect, bool resize)
You have lines:
Code:
internalDrawOutfit(Point(frameSize - Otc::TILE_PIXELS, frameSize - Otc::TILE_PIXELS) + getDisplacement(), 1, false, true, Otc::South);
...
internalDrawOutfit(dest, scaleFactor, false, true, Otc::South);
Function "internalDrawOutfit" has params:
Code:
void Creature::internalDrawOutfit(Point dest, float scaleFactor, bool animateWalk, bool animateIdle, Otc::Direction direction, LightView *lightView)
Which means animateWalk is always false and direction is always South.
You have to change "drawOutfit" in source or you can use "apng" files instead.
 
Instead of changing he can duplicate the functions Creature::drawOutfit inside creature.cpp and UICreature::drawSelf inside uicreature.cpp and then change duplicated Creature::drawOutfit.
So he will be able to call function which he needs at a time - animated or static.
 
Back
Top