Flying NPC's

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Tharon
Novice Poster
Posts: 44
Joined: Fri May 15, 2009 2:27 am

Flying NPC's

Post 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
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: Flying NPC's

Post 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.
Tharon
Novice Poster
Posts: 44
Joined: Fri May 15, 2009 2:27 am

Re: Flying NPC's

Post 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.
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: Flying NPC's

Post 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.
User avatar
Damien White
Journeyman Poster
Posts: 68
Joined: Tue Aug 18, 2009 6:34 pm

Re: Flying NPC's

Post 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.
Tharon
Novice Poster
Posts: 44
Joined: Fri May 15, 2009 2:27 am

Re: Flying NPC's

Post 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 .
Tharon
Novice Poster
Posts: 44
Joined: Fri May 15, 2009 2:27 am

Re: Flying NPC's

Post 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.
Gnafu
Grandmaster Poster
Posts: 136
Joined: Thu Feb 02, 2006 7:29 am

Re: Flying NPC's

Post 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.
Tharon
Novice Poster
Posts: 44
Joined: Fri May 15, 2009 2:27 am

Re: Flying NPC's

Post 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?
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: Flying NPC's

Post by Turley »

pol99 is opensource try to script the code with escript.
Gnafu
Grandmaster Poster
Posts: 136
Joined: Thu Feb 02, 2006 7:29 am

Re: Flying NPC's

Post 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.
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: Flying NPC's

Post 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.
Post Reply