![]() |
Script?
:confused: What is the Script for the light going in circles
|
this is the levels forum
|
If your not talented enough to create that, than whatever project your working on is not gonna happen.
|
Quote:
|
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
|
Re: Script?
Quote:
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... |
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; |
Move this thread
|
Quote:
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.. ^_^ |
:confused: But what if you want it to go really fast
|
-=Josey=-
Look at the code, break it apart, then use your brain. |
here and next time post in scripting
NPC Code:if (playerenters) timeout=.05; |
Quote:
This ".1 " is the speed.. Quote:
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.