Page 1 of 1

Flying NPC's

Posted: Sun Oct 25, 2009 12:11 pm
by Tharon
how can i setup the z coordinate, i only found "RunTowardLocation( x, y )" but there is no z coordinate.

http://nemmelheim.de/wendelwelt/drachenflug.php

Re: Flying NPC's

Posted: Sun Oct 25, 2009 1:53 pm
by Tomi
There is more to this than just that z coordinate. If you want to change the z for now just use mobile.z := whatever integer you want;

http://forums.polserver.com/tracker.php?p=6&t=15 <---- there is my post into the feature tracker requesting this thing.

Re: Flying NPC's

Posted: Mon Oct 26, 2009 7:27 am
by Tharon
Hmm i only can change the z coordinate with moveobjtolocation(npc,
npc.x+i,npc.y,npc.z+50);?i want to script a traveling system with a dragon like in the link i posted.

Re: Flying NPC's

Posted: Mon Oct 26, 2009 10:25 am
by Tomi
yes for that needs to be done more than just the z coordinate to moving functions, because now if you force the z value to be higher, the npc will get down to the worldheight z again on next move, that why Pol should ignore the z when npc has movetype A ( Air ) so it doesnt look like jumping to ground and back up again.

I still wonder how they have made the player follow with that drake.

Re: Flying NPC's

Posted: Mon Oct 26, 2009 5:36 pm
by Damien White
Would it not work to have a tile created at a higher Z level, and set the tile to be invisible? Kinda like the old swimming command? Where a player would then walk across the invisible tiles.

Re: Flying NPC's

Posted: Tue Oct 27, 2009 12:06 am
by Tharon
Damien White wrote:Would it not work to have a tile created at a higher Z level, and set the tile to be invisible? Kinda like the old swimming command? Where a player would then walk across the invisible tiles.
I will test it, but i do it in another way. I create the dragon as an animated item with the height of 65 in the tiledata. Then i give the char an invisible graphic, now i can use it with MoveObjToLocation .

Re: Flying NPC's

Posted: Wed Oct 28, 2009 5:33 am
by Tharon
Is it possible to move a charakter with a script(pol97), like if i double-click the right mouse button(pathfinding)? i know that it is possble with pol99.

Re: Flying NPC's

Posted: Thu Oct 29, 2009 10:16 am
by Gnafu
Just thinking, I'm not sure if it can be done, or if it is simple to do.

Simply move the pc and use the packethook to send a dragon graphic to the client.
The client should add the moving effect with the new graphic on its own, maybe a graphic-packet refresh is needed periodically.

Re: Flying NPC's

Posted: Sat Oct 31, 2009 2:02 pm
by Tharon
Gnafu wrote:Just thinking, I'm not sure if it can be done, or if it is simple to do.

Simply move the pc and use the packethook to send a dragon graphic to the client.
The client should add the moving effect with the new graphic on its own, maybe a graphic-packet refresh is needed periodically.
Hmm this was my question, I want to move a pc. In pol99 I can do it with "CanWalk(movemode, x1, y1, z1, x2_or_dir, y2 := -1, realm := _DEFAULT_REALM)" but how can I do it on pol97?

Re: Flying NPC's

Posted: Fri Nov 13, 2009 6:13 am
by Turley
pol99 is opensource try to script the code with escript.

Re: Flying NPC's

Posted: Sat Nov 14, 2009 9:23 am
by Gnafu
CanWalk does not move the char, simply checks IF the char can move in that direction and, if the char can it gives you the new z.

If you move the char with MoveObjectToLocation() in the direction the char is facing, you will see the walking animation.

I discovered that the chars have .movemode prop but is r/o.

Re: Flying NPC's

Posted: Wed Nov 18, 2009 4:50 am
by Tomi
npcs have the movemode in npcdesc, and for playing characters its of no use because player characters can only walk on land anyway.