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-30-2005, 07:23 AM
FreakyQueen FreakyQueen is offline
Registered User
Join Date: Aug 2005
Posts: 64
FreakyQueen is on a distinguished road
this.angle

im trying to get a weapon to activate when you click the mouse and fire itself on a path towards your mouse co-ordinates on click. ive seen some mention of this.angle, and i think this is what i need.
tell me,1) how do i use this.angle for angling weapons? 1a)what calculations to i need to make? 1b)how do i move the weapon on the angle? 2)is the angle value of a 360 degree circle?
Reply With Quote
  #2  
Old 11-30-2005, 08:42 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
I am not sure what you mean, correct me if I am wrong.

1) 'this.angle' is not something predefined. You have to give a value to this.angle. I am assuming that you are probably thinking of using 'this.angle' with a shoot command.

1a) There is a 'getangle' command which you can use to 'get' the angle you want:
HTML Code:
getangle(delta x,delta y)
In this case you can use:
HTML Code:
this.angle = getangle(mousex-playerx, mousey-playery);
1b) I am not sure what you mean with that .

2) The graal scripting engines generally uses radians rather than degrees.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #3  
Old 12-01-2005, 05:06 PM
FreakyQueen FreakyQueen is offline
Registered User
Join Date: Aug 2005
Posts: 64
FreakyQueen is on a distinguished road
ah, so its not predefined! thanks. (1b assumed it was predefined) i had seen parts of scripts where this.angle was used, and assumed it was predefined.

this.angle = getangle(mousex-playerx, mousey-playery);

i had tried doing a simliar operation with the 2 seperate variables.. sounds like it was just bad programming not misunderstasnding of the language . thanks for your help.
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 04:24 AM.


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