Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-27-2010, 05:19 AM
Purez Purez is offline
Registered User
Join Date: Mar 2010
Posts: 11
Purez is an unknown quantity at this point
Request: Car Script

Does anyone want to donate a Car Script and Class, ect. to Cliffside City?
PLEASE ;-) <3
  #2  
Old 11-27-2010, 05:23 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
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.
__________________
Quote:

Last edited by fowlplay4; 11-27-2010 at 05:38 AM..
  #3  
Old 11-27-2010, 05:49 AM
Seeya Seeya is offline
ω
Seeya's Avatar
Join Date: Jul 2007
Location: Seminole, FL
Posts: 1,903
Seeya is a splendid one to beholdSeeya is a splendid one to beholdSeeya is a splendid one to beholdSeeya is a splendid one to beholdSeeya is a splendid one to behold
Send a message via AIM to Seeya
Very high quality script. +rep if I could.
__________________
Kale Vimes

  #4  
Old 11-27-2010, 05:54 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
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.
  #5  
Old 11-27-2010, 06:10 AM
Purez Purez is offline
Registered User
Join Date: Mar 2010
Posts: 11
Purez is an unknown quantity at this point
is there a class needed?
  #6  
Old 11-27-2010, 06:22 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Purez View Post
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.
__________________
Quote:
  #7  
Old 11-27-2010, 06:28 AM
Purez Purez is offline
Registered User
Join Date: Mar 2010
Posts: 11
Purez is an unknown quantity at this point
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!
  #8  
Old 11-27-2010, 06:31 AM
Purez Purez is offline
Registered User
Join Date: Mar 2010
Posts: 11
Purez is an unknown quantity at this point
oh and is this GS1?
  #9  
Old 11-27-2010, 06:39 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by Purez View Post
oh and is this GS1?
Yes, of course it is.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
  #10  
Old 11-27-2010, 06:56 AM
Purez Purez is offline
Registered User
Join Date: Mar 2010
Posts: 11
Purez is an unknown quantity at this point
Dammet, can you tell me how to make it so it will be GS2? Like reformat it for GS2...
  #11  
Old 11-27-2010, 06:57 AM
Seeya Seeya is offline
ω
Seeya's Avatar
Join Date: Jul 2007
Location: Seminole, FL
Posts: 1,903
Seeya is a splendid one to beholdSeeya is a splendid one to beholdSeeya is a splendid one to beholdSeeya is a splendid one to beholdSeeya is a splendid one to behold
Send a message via AIM to Seeya
Quote:
Originally Posted by Purez View Post
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").
__________________
Kale Vimes

  #12  
Old 11-27-2010, 06:59 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
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.
  #13  
Old 11-27-2010, 07:01 AM
Seeya Seeya is offline
ω
Seeya's Avatar
Join Date: Jul 2007
Location: Seminole, FL
Posts: 1,903
Seeya is a splendid one to beholdSeeya is a splendid one to beholdSeeya is a splendid one to beholdSeeya is a splendid one to beholdSeeya is a splendid one to behold
Send a message via AIM to Seeya
Quote:
Originally Posted by WhiteDragon View Post
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
__________________
Kale Vimes

  #14  
Old 11-27-2010, 07:11 AM
Purez Purez is offline
Registered User
Join Date: Mar 2010
Posts: 11
Purez is an unknown quantity at this point
Thanks. Seeya, -rep for you being a noob.
WhiteDragon, thanks. I really appriciate it.
  #15  
Old 11-27-2010, 03:42 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
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.
__________________
Skyld
Closed Thread


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 04:30 PM.


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