Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-25-2001, 12:21 AM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Talking

Yay, I've just made an NPC for making a level pure and utter chaos! And yes I realize that it has probably been done before and that anyone who knows how the board array stuff works could script it. But it's still fun
NPC Code:
//NPC Made by Grim Squeaker
//If you give x1 or y1 a higher value then
//x2 or y2 nothing will happen at all.
if (created) {
this.x1=0; //Leftmost part of chaos
this.x2=64;//Rightmost part of chaos
this.y1=0; //Highest part of chaos
this.y2=64;//Lowest part of chaos
}
if (playerenters||timeout) {
if (isleader) {
for (this.i=this.x1;this.i<this.x2;this.i++) for (this.j=this.y1;this.j<this.y2;this.j++) {
if (this.grassonly==0) {
this.a = int(random(0,15));
this.b = int(random(0,255));
board[this.i+64*this.j] = this.a+this.b*16;
}
}
updateboard this.x1,this.y1,this.x2-this.x1,this.y2-this.y1;
}
timeout=0.05;
timereverywhere;
}

__________________

Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 12:48 PM.


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