Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-25-2007, 05:46 PM
Remlin34 Remlin34 is offline
Reminator
Join Date: Feb 2006
Posts: 6
Remlin34 is on a distinguished road
Send a message via AIM to Remlin34
Gravity Script.

I need a gravity script. Its for a race.
Reply With Quote
  #2  
Old 06-25-2007, 06:15 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
You shouldnt request full scripts here. Kthxbye.
Reply With Quote
  #3  
Old 06-26-2007, 08:02 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
search the forums theres already few out there. >_>
__________________
Deep into the Darkness peering...
Reply With Quote
  #4  
Old 06-27-2007, 03:35 AM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
Here you go its not my scritp, infact i have no idea why i have it xD
PHP Code:
//#CLIENTSIDE
if (playerenters) {
hide;
playerx=int(playerx);
playery=int(playery);
playerdir=3;
timeout=0.05;
theHAWKER.isKickAss true;
}
if (
timeout) {
if (!
antigravity) {
if (
keydown(0)&&playersprite>=1&&playersprite<=8playery+=0.5;
if (
playerdir==0||playerdir==2playerdir=gravdir;
if (
onwall(playerx+0.5,playery+3)||onwall(playerx+1.5,playery+3)) {
velocity=0;
playery=int(playery);
if (
keydown(6)) velocity=-2;

}
else if (
keydown(2)&&playersprite>=1&&playersprite<=8playery-=0.5;
if (
onwall(playerx+0.5,playery-0.1)||onwall(playerx+0.5,playery)||onwall(playerx+1.5,playery)||onwall(playerx+1.5,playery-0.1)) velocity=0.1;
else {
if (
velocity>-0.1&&velocity<=0velocity=0.1;
if (
velocity>3velocity=3;
}
if (
abs(velocity)>0) {
playery+=velocity/6;
if ((
velocity>0&&(onwall(playerx+0.5,playery+3)||onwall(playerx+1.5,playery+3)))||(velocity<0&&(onwall(playerx+0.5,playery)||onwall(playerx+1.5,playery)))) playery=int(playery);
else 
playery+=velocity/6;
if ((
velocity>0&&(onwall(playerx+0.5,playery+3)||onwall(playerx+1.5,playery+3)))||(velocity<0&&(onwall(playerx+0.5,playery)||onwall(playerx+1.5,playery)))) playery=int(playery);
else 
playery+=velocity/6;
if ((
velocity>0&&(onwall(playerx+0.5,playery+3)||onwall(playerx+1.5,playery+3)))||(velocity<0&&(onwall(playerx+0.5,playery)||onwall(playerx+1.5,playery)))) playery=int(playery);
else 
playery+=velocity/6;
if ((
velocity>0&&(onwall(playerx+0.5,playery+3)||onwall(playerx+1.5,playery+3)))||(velocity<0&&(onwall(playerx+0.5,playery)||onwall(playerx+1.5,playery)))) playery=int(playery);
else 
playery+=velocity/6;
if ((
velocity>0&&(onwall(playerx+0.5,playery+3)||onwall(playerx+1.5,playery+3)))||(velocity<0&&(onwall(playerx+0.5,playery)||onwall(playerx+1.5,playery)))) playery=int(playery);
else 
playery+=velocity/6;
}
velocity+=abs(velocity/4);
if (
this.shot==9) {
hideimg 345;
this.shot=0;
}
if (
this.shot>0) {
if (
this.sd==1this.sx-=0.75;
if (
this.sd==3this.sx+=0.75;
showimg 345,busterl2d#v(this.sd).gif,this.sx,this.sy;
if (this.sd==1) {
if (
testplayer(this.sx,this.sy)>-2hitplayer testplayer(this.sx,this.sy),2,playerx,playery;
if (
testnpc(this.sx,this.sy)>-2hitnpc testnpc(this.sx,this.sy),2,playerx,playery;
if (
testcompu(this.sx,this.sy)>-2hitcompu testcompu(this.sx,this.sy),2,playerx,playery;
}
if (
this.sd==3) {
if (
testplayer(this.sx+1,this.sy)>-2hitplayer testplayer(this.sx+1,this.sy),2,playerx,playery;
if (
testnpc(this.sx+1,this.sy)>-2hitnpc testnpc(this.sx+1,this.sy),2,playerx,playery;
if (
testcompu(this.sx+1,this.sy)>-2hitcompu testcompu(this.sx+1,this.sy),2,playerx,playery;
}
this.shot++;
}
if (
playersprite==11&&playerhearts==playerfullhearts) {
this.shot=1;
this.sd=playerdir;
if (
this.sd==1) {
this.sx=playerx-2;
this.sy=playery+1;
}
if (
this.sd==3) {
this.sx=playerx+2;
this.sy=playery+1;
}
showimg 345,busterl2d#v(this.sd).gif,this.sx,this.sy;
}
if ((
keydown(0)||keydown(2))&&!(keydown(1)||keydown(3))) playersprite=0;
if (
keydown(1)&&!keydown(3)) playerdir=1;
if (
keydown(3)&&!keydown(1)) playerdir=3;
gravdir=playerdir;
}
timeout=0.05;
}
if (
created) {
if (
keydown(6)) {setani jumpnrun,;}

but its in gs1 :P
__________________
**FLIP OUT**
Reply With Quote
  #5  
Old 06-27-2007, 08:25 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Gravity never seemed like a hard thing to script, to me, but then again I've never tried.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #6  
Old 06-27-2007, 08:47 AM
TheJames TheJames is offline
Atrius Manager
TheJames's Avatar
Join Date: Dec 2004
Posts: 581
TheJames can only hope to improve
Era's gravity.

Quote:
#CLIENTSIDE
if (created) {
this.gravspeed = 0.45; //Fall Speed
this.jumpheight = 1.5; //Jump height to reach
this.jumpspeed = 0.4; //Raise Speed in jump
this.jumpdelay = 0.6; //Jump interval (S)
}
if (playerenters || timeout) {
if (!onwall(playerx+0.5,playery+3+this.gravspeed) && !onwall(playerx+1.5,playery+3+this.gravspeed)) playery+=this.gravspeed;
else {
for (i=10;i>0;i-=1 {
if (!onwall(playerx+0.5,playery+3+((this.gravspeed/10)*i)) && !onwall(playerx+1.5,playery+3+((this.gravspeed/10)*i))) {
playery+=(this.gravspeed/10)*i;
break;
}
}
}
if (keydown(6) && this.jump==false && playerz==0 && this.jumptick==0) {
this.jump=true;
for (this.i=0;this.i<=this.jumpheight;this.i+=this.jum pspeed {
playerz+=this.jumpspeed;
setplayerprop #c,Y: #v(this.i);
sleep 0.05;
}
this.jump=false;
this.jumptick=this.jumpdelay;
}
if (playerz>0) playerz-=this.gravspeed;
else playerz=0;
if (this.jumptick>0) this.jumptick-=0.05;
timeout=0.05;
}
Era's gravity script. Enjoy! The 's = ; ) put together.
__________________
Contact me on Skype: "skype.sam.lorenz"

James,
Manager of Atrius
Reply With Quote
  #7  
Old 06-27-2007, 06:45 PM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
Quote:
Originally Posted by TheJames View Post
Era's gravity script. Enjoy! The 's = ; ) put together.
yet its in gs1 again...
__________________
**FLIP OUT**
Reply With Quote
  #8  
Old 06-27-2007, 08:31 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Hmm, the first one is just old... unoptimized and long. The first one... doesn't work very well. The 'physics' are bad, and you can't really jump up, so it's only good for if you stay on the platform.
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 09:32 PM.


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