![]() |
Hehe trueheat no need for deleting your own
messages :-) With the new Graal version there is the command 'move', which is very powerful when you want to make smoothly moving npcs. Of course you can still move npcs by updating the x and y position, but in most cases you can use 'move' to get better results: - less lag Only the movement delta x, delta y and time the movement takes need to be sent to the player - smoother movement The npc is automatically moved on the client side which the maximum possible 'smoothness': all 0.05 seconds, high resolution instead of the 0.5 tiles resolution when npc positions are send by the npcserver, and at constant speed - faster server The server still moves the npc on server-side (so that playertouchsme etc. work correctly), but the script itself doesn't need to be called, and the positions doesn't need to be sent to the players, so less work The move command should have a maximum compability, e.g. when a player enters the room in the middle of a move then the server sends the half movement so that it is correct, and with each new move the starting position is sent again so that the npc cannot move to a wrong position (when there are sliglthy differences in the resolution of the movement) Here a nice example for a randomly walking npc (when it hits a wall or after some time it changes the direction): NPC Code: You see that the command move is called with random values for delta x and delta y, a movement time based on the distance of the way (8 tiles = 1 second), and the options for stopping when hitting a wall and calling the script again when stopped walking (option 8 -> calls the script with flag 'movementfinished' set). The option '16' is for setting the direction automatically on client-side so that the npc changes the direction in the same moment when the new move starts. This is not really important in this case because it doesn't use caching, but when you use the option '1' for caching then it is better to let the direction automatically be set. For random walking (+option 8) it is better to not use caching since the the npc should change the movement as soon as the server sends a new movement (to anothe direction) and not finish the current movement. Godspeed already suggested to add a new option: +32 for automatically animation change (to idle,walkslow, walk, swim, depending on if the npc moves or swims or so) |
Hmmm, I have been having problems by the "Recording" command you can use and then copy the script from the Levels TXT file it comes in. Anyway, when I copy the script into the Scripting Area the character floats, doesnt walk, and if I make him like pull on something while I record, when I open the level for testing it, he just like goes to the rock or wall.
|
Yes the recording thing needs to be updated...
|
That would be great!
|
I think you should make me an Administrator now Stefan :D
|
Stefan, that sounds great.
I haven't been having any problems using the recording... :o |
I will have to try it. It was about version 2.00 I tried it out. Now, If you don't mind, I am going to go work on my castle for my server.
|
I dont like
I dont like the record thingy...
it just creates a hug file that the users will have to download and makes the levels bigger and lagy. So I always use x-- or y-- (or ++) I mean it might not be as smooth but I dont really care ;-) Well the move command seems like it will help out a lot. |
Re: I dont like
Quote:
|
Godspeed only database npcs can walk
into other levels |
There is already a check for -50/50 now
database npcs: npcs visible in the npc list of a npccontrol |
yes there is.
|
?
You will need the npccontrol |
I better start using move...
---------------------------------------------------- )happy bring back super old posts day( if you hate me and you know it clap your hands --- rogue shadow -tt- *c* (tcn) |
I guess that command would be good could if I knew how to script :D
|
Ever notice whatever forum Stefan goes in to and talks it ends up with like 50 spam messages and 2 real meaages for the starter and Stefan!
|
| All times are GMT +2. The time now is 11:39 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.