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 11-14-2002, 12:14 AM
CloudRubeus CloudRubeus is offline
l33t k33p3r
Join Date: Nov 2002
Posts: 13
CloudRubeus is on a distinguished road
Send a message via AIM to CloudRubeus
Smile Mouse System :D

I was checking out the new commands one day, I seen those nice mousex and mousescreenx commands.

I suddenly wondered what a type of mouse control for Graal would be like, lol... So I scripted a Mouse Mode npc. I haven't added onwall or any attacking commands yet.
Though, you click where you want to go. Your character walks there, the directional turns seem to work fine.

One problem I've noticed, it doesn't seem to work well with that new gani thats on offline mode.. The g2k2 looking guy.
Its made for the normal sprites and uses playersprite=(playersprite%8)+1 to change sprites around. Well, I could use some feedback on the npc, maybe giving me more ideas about it or even saying how worthless it might be.
Attached Files
File Type: zip mousemode.zip (720 Bytes, 295 views)
Reply With Quote
  #2  
Old 11-14-2002, 12:30 AM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Sprites are not to be used since the release of 2k1, I think. Use ganis
Reply With Quote
  #3  
Old 11-14-2002, 12:33 AM
CloudRubeus CloudRubeus is offline
l33t k33p3r
Join Date: Nov 2002
Posts: 13
CloudRubeus is on a distinguished road
Send a message via AIM to CloudRubeus
Hm, really? I wasn't ever that fond of gani's, probably because I've never been good at making them.. lol
For the longest time I would always script out the attacks and all that. Oh well
Reply With Quote
  #4  
Old 11-14-2002, 01:34 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
for the direction, calculate the x and y distance between the player and the point you click at then use the function stefan added (getdir) to change the players direction

dx = mousex-playerx;
dy = mousey-playery;
playerdir=getdir(dx,dy);
Reply With Quote
  #5  
Old 11-15-2002, 02:49 AM
CloudRubeus CloudRubeus is offline
l33t k33p3r
Join Date: Nov 2002
Posts: 13
CloudRubeus is on a distinguished road
Send a message via AIM to CloudRubeus
I didn't realized he added that function, I'm more used to the older commands.
Anyone have any suggestions to add to the Mouse system?
I was thinking of adding a sword attack or a basic attack for the right mouse button.
Perhaps scroll through your weapons and or items with the middle mouse button.
Reply With Quote
  #6  
Old 11-15-2002, 12:29 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
Quote:
Originally posted by Python523
for the direction, calculate the x and y distance between the player and the point you click at then use the function stefan added (getdir) to change the players direction

dx = mousex-playerx;
dy = mousey-playery;
playerdir=getdir(dx,dy);
Why not just do playerdir = getdir(mousex-playerx,mousey-playery);??
__________________
[signature]insert here[/signature]
Reply With Quote
  #7  
Old 11-15-2002, 07:11 PM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Quote:
Originally posted by CloudRubeus
Anyone have any suggestions to add to the Mouse system?
I was thinking of adding a sword attack or a basic attack for the right mouse button.
Or you could define an attack which fires when you click with your normal mouse-button (I haven't downloaded it, but I guess you are using the left mouse button for moving) on a player or an NPC.
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote
  #8  
Old 11-15-2002, 10:28 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
In the movement I scripted, I made the position of the mouse override the key-controlled movement when the right button is pressed. I find it easier ot walk that way, if I am lazy or whatever.
Reply With Quote
  #9  
Old 11-15-2002, 10:49 PM
CloudRubeus CloudRubeus is offline
l33t k33p3r
Join Date: Nov 2002
Posts: 13
CloudRubeus is on a distinguished road
Send a message via AIM to CloudRubeus
Yeah, I was originaly going to replace certain keydowns and change basicly all the normal key controls.

Right was going to be used for movement but the issue of the player's profile popping up everytime you clicked over a player was presented. Now that you can remove the profiles, I'm going to swich movement to the right button and action to the left mouse button.
Thanks for the getdir commands btw, it saves alot of scripting.

When I originaly scripted the mouse mode, you had to hold your mouse button down the entire time you wanted your player to walk. Though, my friend recommended me changing it to click and your player moves there.

I actualy like both npcs, maybe I'll put them both up for DL when I add in the getdir and change some code around
Reply With Quote
  #10  
Old 11-16-2002, 01:34 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
Quote:
Originally posted by Kaimetsu


He needs to use dx and dy anyway so there's no reason to calculate them twice.
So he uses dx and dy later in the script?
__________________
[signature]insert here[/signature]
Reply With Quote
  #11  
Old 11-16-2002, 01:45 PM
CloudRubeus CloudRubeus is offline
l33t k33p3r
Join Date: Nov 2002
Posts: 13
CloudRubeus is on a distinguished road
Send a message via AIM to CloudRubeus
yeah...
Though, lol... anyone want to give me any example of how to use it? The newfeatures txt file didn't give any explinations on how to use it
Reply With Quote
  #12  
Old 11-17-2002, 08:55 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally posted by CloudRubeus
yeah...
Though, lol... anyone want to give me any example of how to use it? The newfeatures txt file didn't give any explinations on how to use it
...of course you cant, its not a feature, it's a math formula
Reply With Quote
  #13  
Old 11-19-2002, 04:41 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
nice

Very nice script.

I took the liberty of adding onwall. Its a bit generous
in that the player is still one blick away from the wall
but it works.
Attached Files
File Type: nw mousemode test.nw (10.2 KB, 193 views)
__________________

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
  #14  
Old 11-19-2002, 09:53 AM
CloudRubeus CloudRubeus is offline
l33t k33p3r
Join Date: Nov 2002
Posts: 13
CloudRubeus is on a distinguished road
Send a message via AIM to CloudRubeus
Well thats cool. Thanks Prozac, saves me some time.
This was basicly an idea I had a while ago, I didn't put much effort into it. If I did I probably wouldn't have posted it for everyone to download lol..
Thanks again for the onwall
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 11:06 PM.


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