Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-09-2002, 08:01 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
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.
__________________
[signature]insert here[/signature]
Reply With Quote
  #2  
Old 10-09-2002, 08:02 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
****

(and no i didn't curse, i just used *s)
Attached Files
File Type: nw click2.nw (18.0 KB, 306 views)
__________________
[signature]insert here[/signature]
Reply With Quote
  #3  
Old 10-10-2002, 12:26 AM
Goboom Goboom is offline
Pixel Monkey
Goboom's Avatar
Join Date: Dec 2001
Location: Michigan
Posts: 1,702
Goboom is on a distinguished road
Send a message via ICQ to Goboom Send a message via AIM to Goboom Send a message via MSN to Goboom Send a message via Yahoo to Goboom
FUN STUFFINS!...and sure screenie...you didnt cuss...gotcha
__________________
Reply With Quote
  #4  
Old 10-10-2002, 12:42 AM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
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.
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote
  #5  
Old 10-10-2002, 07:53 AM
Graal2001_NAT Graal2001_NAT is offline
Registered User
Join Date: Sep 2002
Posts: 241
Graal2001_NAT is on a distinguished road
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
__________________
GONE, BAI
Reply With Quote
  #6  
Old 10-10-2002, 08:01 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Nice Idea...
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #7  
Old 10-10-2002, 10:54 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
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.
__________________
[signature]insert here[/signature]
Reply With Quote
  #8  
Old 10-11-2002, 02:25 AM
HEALER101 HEALER101 is offline
Registered User
Join Date: Aug 2002
Posts: 97
HEALER101 is on a distinguished road
*feel special*, where are u tho screen?
__________________
Reply With Quote
  #9  
Old 10-11-2002, 04:45 AM
Goboom Goboom is offline
Pixel Monkey
Goboom's Avatar
Join Date: Dec 2001
Location: Michigan
Posts: 1,702
Goboom is on a distinguished road
Send a message via ICQ to Goboom Send a message via AIM to Goboom Send a message via MSN to Goboom Send a message via Yahoo to Goboom
Quote:
Originally posted by HEALER101
*feel special*, where are u tho screen?
I saw him yesterday...
__________________
Reply With Quote
  #10  
Old 10-17-2002, 07:47 AM
prozac424242 prozac424242 is offline
Registered User
prozac424242's Avatar
Join Date: May 2001
Location: Gone crazy: back soon
Posts: 356
prozac424242 is on a distinguished road
Send a message via ICQ to prozac424242 Send a message via AIM to prozac424242
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
__________________

Useful links:
Graal Stats
Client Script Functions-GS1 to GS2
Serverside Script Functions-Gscript page
Particle Engine-Player Attributes
Server Options-Admin rights-Gmaps
Quote:
Originally Posted by Admins
Thanks for developing and improving playerworlds and such
Reply With Quote
  #11  
Old 11-03-2002, 09:33 AM
Mykel Mykel is offline
:o
Mykel's Avatar
Join Date: May 2002
Location: Canton, Ohio.
Posts: 5,526
Mykel has a spectacular aura about
Send a message via AIM to Mykel Send a message via MSN to Mykel
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...
__________________
(Married to Skyld)
Reply With Quote
  #12  
Old 11-03-2002, 10:33 AM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
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
Reply With Quote
  #13  
Old 11-03-2002, 01:25 PM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
<3
Reply With Quote
  #14  
Old 11-08-2002, 06:24 AM
prozac424242 prozac424242 is offline
Registered User
prozac424242's Avatar
Join Date: May 2001
Location: Gone crazy: back soon
Posts: 356
prozac424242 is on a distinguished road
Send a message via ICQ to prozac424242 Send a message via AIM to prozac424242
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.
__________________

Useful links:
Graal Stats
Client Script Functions-GS1 to GS2
Serverside Script Functions-Gscript page
Particle Engine-Player Attributes
Server Options-Admin rights-Gmaps
Quote:
Originally Posted by Admins
Thanks for developing and improving playerworlds and such
Reply With Quote
  #15  
Old 11-08-2002, 06:28 AM
davidpsy davidpsy is offline
Over Nine THOUSAND!!!!!!!
davidpsy's Avatar
Join Date: Mar 2002
Location: Bandiria
Posts: 5,514
davidpsy is on a distinguished road
Send a message via AIM to davidpsy
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
__________________
-Donald Shimoda
Level oo.

Forces greater than your self, can be over come.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:45 AM.


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