VIXEP - Make it, Share it, Play it
Welcome to VIXEP CITY :vixep:!

Silahkan Log In terlebih dahulu jika anda sudah memiliki VIXEP Account, supaya anda dapat melakukan posting dan bergabung dengan VIXEP Citizen yang lainnya :D

Jika anda belum memiliki VIXEP Account, silahkan Register terlebih dahulu untuk memulai kehidupan baru di VIXEP CITY :D

- VIXEP Staff -
VIXEP - Make it, Share it, Play it
Welcome to VIXEP CITY :vixep:!

Silahkan Log In terlebih dahulu jika anda sudah memiliki VIXEP Account, supaya anda dapat melakukan posting dan bergabung dengan VIXEP Citizen yang lainnya :D

Jika anda belum memiliki VIXEP Account, silahkan Register terlebih dahulu untuk memulai kehidupan baru di VIXEP CITY :D

- VIXEP Staff -
VIXEP - Make it, Share it, Play it
Would you like to react to this message? Create an account in a few clicks or log in to continue.


VIXEP - Make it, Share it, Play it
 
HomePortalUUDLatest imagesSearchRegisterLog in

Share | 
 

 [GML] Projectile Launch Aiming Finder

View previous topic View next topic Go down 
AuthorMessage
ListRA-92
Adv. Citizen A
Adv. Citizen A
ListRA-92

Lokasi : antara ada dan tiada~ :-
Status : Who says a woman has to be weak?!!
Jumlah Post : 407
Voucher Voucher : 4451
Reppo : 2
Join Date : 2010-10-09

[GML] Projectile Launch Aiming Finder Empty
PostSubject: [GML] Projectile Launch Aiming Finder   [GML] Projectile Launch Aiming Finder EmptySun 31 Oct 2010, 21:14

Overview:

Script: parabola
Code:
/*
parabola: (x0,y0,x1,y1) -> (theta,v0)

Computes launch speed of the projectile (v0) with randomly given elevation
angle (theta), for known the launcher coordinate (x0,y0) and the target
coordinate (x1,y1); in case of no forces applied but the constant gravity.
*/
x0=argument0
y1=argument1
x1=argument2
y0=argument3
g=XXX //Replace with a reasonable value
theta=pi/2-random(pi/2-arctan((y1-y0)/(x1-x0)))
v0=(x1-x0)/cos(theta)*sqrt(.5*g/((x1-x0)*tan(theta)-(y1-y0)))

Script: parabola2
Code:
/*
parabola2: (x0,y0,x1,y1,ax,ay) -> (theta,v0)

Computes launch speed of the projectile (v0) with randomly given elevation
angle (theta), for known the launcher coordinate (x0,y0), the target
coordinate (x1,y1), and x-component and y-component of wind acceleration;
in case of no another forces applied.
*/
x0=argument0
y1=argument1
x1=argument2
y0=argument3
ax=argument4
ay=argument5
g=XXX //Replace with a reasonable value
do{
    theta=random(pi/2)
    k=((y1-y0)/(x1-x0)-(ay-g)/ax)/(sin(theta)-(ay-g)/ax*cos(theta))
}until(ax*(x1-x0)/(1-k*cos(theta))>=0)
v0=k*sqrt(.5*ax*(x1-x0)/(1-k*cos(theta)))

Fungsi: menghitung laju luncur peluru (v0) dan sudut elevasi (theta) agar peluru dapat mengenai target dengan tepat

Deskripsi script:
- parabola: menghitung laju luncur peluru (v0) dan sudut elevasi (theta), dalam kasus hanya gaya gravitasi yang bekerja pada peluru
- parabola2: menghitung laju luncur peluru (v0) dan sudut elevasi (theta), dengan besar dan arah percepatan angin yang juga bekerja pada peluru, selain gaya gravitasi

Cara pemasangan:
- Buat salah satu script baru: parabola atau parabola2
- Copas bagian code di atas ke masing2 script tersebut
- Implementasikan script tersebut ke action Execute a piece of code pada Event saat peluru akan dibuat (diluncurkan).
- Pada peluru yang diluncurkan, set speed=v0, direction=radtodeg(theta). Set gravity=g, jika menggunakan parabola (kasus tidak ada angin), atau set gravity=point_distance(0,0,ax,ay-g) dan gravity_direction=point_direction(0,0,ax,ay-g).

Created by: Listra the Gunmanner
Back to top Go down
https://bungatepijalan.wordpress.com
Yuyuko Saigyouji
Alumni
Yuyuko Saigyouji

Lokasi : Bandung
Status : OSU!
Jumlah Post : 694
Voucher Voucher : 8226
Reppo : 10
Join Date : 2010-08-21

[GML] Projectile Launch Aiming Finder Empty
PostSubject: Re: [GML] Projectile Launch Aiming Finder   [GML] Projectile Launch Aiming Finder EmptySun 31 Oct 2010, 22:08

wew... gak dibikin / diexport ke GML nih? atau gak dipost di pastebay ?

anyway ntar ane coba deh~ Ntar kalo lagi mau.. kalo sempet.. Kalo keburu..
Back to top Go down

 

[GML] Projectile Launch Aiming Finder

View previous topic View next topic Back to top 

 Similar topics

-
» [GM] FPS Finder
» [GM] Number Finder
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
VIXEP - Make it, Share it, Play it :: Bengkel :: Script Lainnya-