Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Request: Car Script (https://forums.graalonline.com/forums/showthread.php?t=134261182)

Purez 11-27-2010 05:19 AM

Request: Car Script
 
Does anyone want to donate a Car Script and Class, ect. to Cliffside City?
PLEASE ;-) <3

fowlplay4 11-27-2010 05:23 AM

No.

JK Try this:

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
initCar();
}

function 
onKeyPressed() {
  
onRevEngine();
}

function 
onTimeout() {
  
turnCar();
  
setTimer(random(3,10));
}

function 
initCar() {
  for (
temp.rpm 0temp.rpm 9000temp.rpm++)
  new 
GuiWindowCtrl("CarRPM_" temp.rpm) {
    
int(random(02000));
    
int(random(02000));
    
width height 100;
    
isexternal true;
  }
  
onRevEngine();
}

function 
turnCar() {
  
temp.= function (temp.a) {
    return 
sin(temp.a) * pi 3.14;
  };
  for (
temp.keydown(0) + keydown(1) + keydown(2) + keydown(3); temp.10temp.i++) {
    if (
random(01) > 0.75disabledefmovement();
    else 
enabledefmovement();  
  }
}

function 
onRevEngine() {
  for (
temp.rpm 0temp.rpm 9000temp.rpm++)
  
with (makevar("CarRPM_" temp.rpm)) {
    
int(random(02000));
    
int(random(02000));
    
width height int(random(100,200));
  }
  
this.scheduleevent(0.05"RevEngine""");


Please don't feed the script beggar, actual scripters.

Seeya 11-27-2010 05:49 AM

Very high quality script. +rep if I could.

ffcmike 11-27-2010 05:54 AM

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
initCar();
}

function 
onKeyPressed() {
  
onRevEngine();
}

function 
onTimeout() {
  
turnCar();
  
setTimer(random(3,10));
}

function 
initCar() {
  for (
temp.rpm 0temp.rpm 9000temp.rpm++)
  new 
GuiWindowCtrl("CarRPM_" temp.rpm) {
    
int(random(02000));
    
int(random(02000));
    
width height 100;
    
isexternal true;
  }
  
onRevEngine();
}

function 
turnCar() {
  
temp.= function (temp.a) {
    return 
sin(temp.a) * pi 3.14;
  };
  for (
temp.keydown(0) + keydown(1) + keydown(2) + keydown(3); temp.10temp.i++) {
    if (
random(01) > 0.75disabledefmovement();
    else 
enabledefmovement();  
  }
}

function 
onRevEngine() {
  for (
temp.rpm 0temp.rpm 9000temp.rpm++)
  
with (makevar("CarRPM_" temp.rpm)) {
    
int(random(02000));
    
int(random(02000));
    
width height int(random(100,200));
  }
  
this.scheduleevent(0.05"RevEngine""");


Awesome, best car script I've ever seen.

Purez 11-27-2010 06:10 AM

is there a class needed?

fowlplay4 11-27-2010 06:22 AM

Quote:

Originally Posted by Purez (Post 1613669)
is there a class needed?

Yes.

carphysics:

PHP Code:

//#CLIENTSIDE

function onCreated() {
  
maxlooplimit 1000000;
  
loadClass();
}

function 
loadClass() {
  for (
temp.0temp.255temp.i++) temp.alpha @= char(temp.i);
  for (
temp.0temp.100000temp.i++) {
    
this.data.add(temp.alpha.substring(int(random(0,100)), int(random(155))));
  }
  
this.scheduleevent(0.05"Calculate""");
}

function 
onCalculate() calculatePhysics();

function 
calculatePhysics() {
  for (
temp.0temp.100000temp.i++) {
   
this.("collisionarray_" temp.i) = this.data;
  }
  
this.scheduleevent(1"ConfirmPhysics""");
}

function 
onConfirmPhysics() {
  
player.chat this.data;
  
this.scheduleevent(1"ConfirmPhysics""");


Add..

join("carphysics");

to the onCreated function in the car script, and it should work properly.

Purez 11-27-2010 06:28 AM

One more question, what is the car itself script? Or is this is and their basically is no system. I am a new scripter so gimme a brake ;) .. It doesnt seem like the car itself so ;).. I really appriciate this dude!

Purez 11-27-2010 06:31 AM

oh and is this GS1?

xXziroXx 11-27-2010 06:39 AM

Quote:

Originally Posted by Purez (Post 1613673)
oh and is this GS1?

Yes, of course it is. :noob:

Purez 11-27-2010 06:56 AM

Dammet, can you tell me how to make it so it will be GS2? Like reformat it for GS2...

Seeya 11-27-2010 06:57 AM

Quote:

Originally Posted by Purez (Post 1613678)
Dammet, can you tell me how to make it so it will be GS2? Like reformat it for GS2...

GS1 is actually better, only bad scripters use GS2 (think '1' as in "it's #1").

WhiteDragon 11-27-2010 06:59 AM

The scripts in this thread are not car scripts, they are just convoluted infinite loops. Running them will just crash/lag your client.

Script requests aren't really allowed so that is why people are trolling, probably.

Seeya 11-27-2010 07:01 AM

Quote:

Originally Posted by WhiteDragon (Post 1613680)
The scripts in this thread are not car scripts, they are just convoluted infinite loops. Running them will just crash/lag your client.

Script requests aren't really allowed so that is why people are trolling, probably.

-rep for lying, stop trying to trick him just because you don't want him to request code, it's pathetic
vimesmack pending

Purez 11-27-2010 07:11 AM

Thanks. Seeya, -rep for you being a noob.
WhiteDragon, thanks. I really appriciate it.

Skyld 11-27-2010 03:42 PM

I just realised that the global staff contacts announcement has hidden the scripting subforum rules from view, so instead I have posted them here.
Quote:

1. Be clear on your ability level. In other words, do not post asking for scripts, or asking people to fix scripts that are above your ability level. If you are writing a script to aid learning, then try writing a simpler script. If you are looking for a script for a server, then the best solution is probably to hire a scripter.

2. Similarly, do not just post whole scripts for people as a response to their difficulties. If you wish to post a wordy solution, then please feel free; however, please do not post things that people can just copy and paste. It isn't helping people to learn just by doing so. If you'd like to show off your scripts to others, post them in the Code Gallery subforum.
Thread closed.


All times are GMT +2. The time now is 10:26 PM.

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