Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   this.angle (https://forums.graalonline.com/forums/showthread.php?t=62580)

FreakyQueen 11-30-2005 07:23 AM

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?

napo_p2p 11-30-2005 08:42 AM

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 :frown:.

2) The graal scripting engines generally uses radians rather than degrees.

FreakyQueen 12-01-2005 05:06 PM

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.


All times are GMT +2. The time now is 11:22 PM.

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