Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Easy walker (https://forums.graalonline.com/forums/showthread.php?t=39084)

screen_name 10-09-2002 08:01 PM

Easy walker
 
Here is something I was playing with a few days ago, possibly for Cira Baen, not sure yet.


Instructions:

Left-click on the npc you want to move to select it (name turns blue), then right click somewhere to move to
You can also use the arrow keys to move the character, but if you use them while you are walking, it will cancel the clicked spot
Left-click on another NPC, on the current NPC, or left-click off of the NPC to deselect it
Move the mouse cursor to the edge of the game screen to move the camera

I know there isn't any onwall or pathfinding, but it's just a demo for the staff to decide if they would like it or maybe even a RTS server.

screen_name 10-09-2002 08:02 PM

1 Attachment(s)
****

(and no i didn't curse, i just used *s) :)

Goboom 10-10-2002 12:26 AM

FUN STUFFINS!...and sure screenie...you didnt cuss...gotcha ;)

Com013 10-10-2002 12:42 AM

I didn't download it, but your description reminds me at a soldier I once made (not published though).
You could command it around using the mouse and it would attack other players. It could even walk around simple obstacles.

Graal2001_NAT 10-10-2002 07:53 AM

I like your way but why not do something like
NPC Code:

if (created) {
showcharacter;
}
if (mousedown){
dx = mousex-x;
dy = mousey-y;
dist=(dx^2+dy^2)^.5;
dir = (abs(dx)>abs(dy)? (dx>0? 3 : 1) : (dy>0? 2 : 0));
xinc = dx/dist;
yinc = dy/dist;
for(i=0;i<dist;i++){
x+=xinc;
y+=yinc;
setcharani walk,;
sleep .05;
}
setcharani idle,;
}


yes, no onwalls either

osrs 10-10-2002 08:01 AM

Nice Idea...

screen_name 10-10-2002 10:54 AM

Quote:

Originally posted by Graal2001_NAT
I like your way but why not do something like
NPC Code:

if (created) {
showcharacter;
}
if (mousedown){
dx = mousex-x;
dy = mousey-y;
dist=(dx^2+dy^2)^.5;
dir = (abs(dx)>abs(dy)? (dx>0? 3 : 1) : (dy>0? 2 : 0));
xinc = dx/dist;
yinc = dy/dist;
for(i=0;i<dist;i++){
x+=xinc;
y+=yinc;
setcharani walk,;
sleep .05;
}
setcharani idle,;
}


yes, no onwalls either


This was just a quick demo for the staff, so I just put it together real quick.

HEALER101 10-11-2002 02:25 AM

*feel special*, where are u tho screen?

Goboom 10-11-2002 04:45 AM

Quote:

Originally posted by HEALER101
*feel special*, where are u tho screen?
I saw him yesterday...

prozac424242 10-17-2002 07:47 AM

cool!
 
Nice work!

More effiient: instead of checkign x any y to get there
do a getangle and take the shortest route to the end point

Mykel 11-03-2002 09:33 AM

Re: Re: cool!
 
Quote:

Originally posted by Kaimetsu


You'd probably be right if you weren't actually hideously wrong. Getangle is extremely inefficient and completely unnecessary if you have even the most basic understanding of mathematics.

ok man, noone can deny your skill, but stop putting other people down because they may not be as good ok? it is not BASIC math...

R0bin 11-03-2002 10:33 AM

Re: Re: cool!
 
Quote:

Originally posted by Kaimetsu


You'd probably be right if you weren't actually hideously wrong. Getangle is extremely inefficient and completely unnecessary if you have even the most basic understanding of mathematics.

pld

R0bin 11-03-2002 01:25 PM

<3

prozac424242 11-08-2002 06:24 AM

eh
 
alsi kai just plain dosent like me, he has made that clear a while ago.

if people dont like who i am, its their loss.

davidpsy 11-08-2002 06:28 AM

Re: eh
 
Quote:

Originally posted by prozac424242
alsi kai just plain dosent like me, he has made that clear a while ago.

if people dont like who i am, its their loss.

Dont worry prozac buddy ill stoop down to their level for you :)


All times are GMT +2. The time now is 06:49 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.