Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Level Design (https://forums.graalonline.com/forums/forumdisplay.php?f=6)
-   -   Script? (https://forums.graalonline.com/forums/showthread.php?t=26026)

thrashsoul 03-21-2002 07:10 AM

Script?
 
:confused: What is the Script for the light going in circles

lordhelmut 03-21-2002 07:12 AM

this is the levels forum

SSJVegeta1 03-21-2002 07:51 AM

If your not talented enough to create that, than whatever project your working on is not gonna happen.

SaijinGohan 03-21-2002 09:05 AM

Quote:

If your not talented enough to create that, than whatever project your working on is not gonna happen.
Very good point but you must admit it is a LIL hard.

Jman9912-P2P 03-21-2002 09:31 AM

well u would use cos and sin, its not that hard if u cant get it just reply again and ill help ya i want u to at least try u learn easier

amonrabr 03-21-2002 11:45 AM

Re: Script?
 
Quote:

Originally posted by thrashsoul
:confused: What is the Script for the light going in circles
Its very easy... but u need to know some maths..

1st) Sinus u will use for X
2nd) Cosinus u will use for y

timeout=.05;
this.a=(this.a+.1)%6.2;
showimg 1,light2.png,x+4*sin(this.a),y+4*cos(this.a);
changeimgcolor 1,1,1,1,0.8;

It should work...

Ps. Sinus of a number is something that will becoming big and so it slows...
3.14 is when it change the signal..

"%6.2" U dont need to use this, but so the "this.a" number never will stop.
This way it will back to "0" when "this.a" be equal 6.2(3.14*2 or 360o)

"4*" is the ray of the circle...

I understood now how they made that effects in the start ghost level on Graal2k2, its easy too...

Falcor 03-21-2002 09:45 PM

It is wise to set constants in your scripts so you know WHY you have a number where you have it...

such as

if(created) pi = 3.1415;

so you know instead of having to type 3.1415 every time you want to use pi, just type pi its far more understandable.
And ammon, Why us % (mod) in that way? Itlowers the general efficiency of the script, thx kai for pointing this out...

Its not supose to be used in that way. rather in an if statement.

you sghould just do if(this.a > blah) this.a = 0;

haunter 03-22-2002 12:52 AM

Move this thread

amonrabr 03-22-2002 12:58 AM

Quote:

Originally posted by Falcor
It is wise to set constants in your scripts so you know WHY you have a number where you have it...

such as

if(created) pi = 3.1415;

so you know instead of having to type 3.1415 every time you want to use pi, just type pi its far more understandable.
And ammon, Why us % (mod) in that way? Itlowers the general efficiency of the script, thx kai for pointing this out...

Its not supose to be used in that way. rather in an if statement.

you sghould just do if(this.a > blah) this.a = 0;


my nick is Amon = þ" Lol..
and the "%" is a way that I found to use it, u can test, it will work fine.

I dont like to use " if(this.a > blah)" because I think its big, so I like to use some other way as "this.a=this.a<blah?this.a+=.1:this.a=0;"
or something like.... = þ
but the "%" works fine = ) I tested it online many times..
^_^

thrashsoul 03-22-2002 04:26 AM

:confused: But what if you want it to go really fast

joseyisleet 03-22-2002 11:33 AM

-=Josey=-
Look at the code, break it apart, then use your brain.

la_builder 03-23-2002 02:02 AM

here and next time post in scripting

NPC Code:
if (playerenters) timeout=.05;
if (timeout) {
this.angle=(this.angle+.1)%6.28;
showimg 0.aball.gif,x+6*sin(this.angle),y+6*cos(this.angle );
timeout=.05;
}


amonrabr 03-24-2002 02:59 AM

Quote:

Originally posted by thrashsoul
:confused: But what if you want it to go really fast
this.a=(this.a+.1)%6.2;

This ".1 " is the speed..


Quote:

here and next time post in scripting
if (playerenters) timeout=.05;
if (timeout) {
this.angle=(this.angle+.1)%6.28;
showimg 0.aball.gif,x+6*sin(this.angle),y+6*cos(this.angle );
timeout=.05;
}

timeout=.05;
if (timeout) {
this.angle=(this.angle+.1)%6.28;
showimg 0,aball.gif,x+6*sin(this.angle),y+6*cos(this.angle ); }


All times are GMT +2. The time now is 01:23 PM.

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