Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #41  
Old 08-24-2003, 07:56 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
It depends. The name of the game is implicit intentions; personally I don't like searching through endless conditions to understand what somebody is doing. If the conditions are related then yeah, fine, but otherwise it's stupid.
__________________
Reply With Quote
  #42  
Old 08-24-2003, 08:37 AM
TB3 TB3 is offline
Registered User
TB3's Avatar
Join Date: May 2001
Location: US of A State of VA
Posts: 658
TB3 is on a distinguished road
Send a message via Yahoo to TB3
I didnt read all the way to the third page but.....

In order for more people to be in the room playerenters will have to be triggered.... *DUH* you dont need a timeout loop to lag the server any or little just a simple
NPC Code:


if(created) {
this.minplayers=5;
}
if(playerenters) {
if(playerscount>=this.minplayers){
blah();
}
}



THat would be sufficient right or did i miss something?


[edit]
NPC Code:


if(created) {
this.minplayers=5;
this.mode=0;
this.check=0;
}
if(playerenters||playerleaves) {
this.mode=(playerscount>=this.minplayers? 1 : playerscount<this.minplayers? 0 );
if(this.mode!==this.check) {
door();
}

}

function door() {
this.check=this.mode
if(this.mode=1) {//Opening
blah;
}
if(this.mode=0) {//Closing
blah;
}
}



THeres a more complex edit it should work *goez to zleep im tired*
__________________

To the sun of your age, I arise

Last edited by TB3; 08-24-2003 at 08:52 AM..
Reply With Quote
  #43  
Old 08-24-2003, 09:12 AM
Tseng Tseng is offline
Sublime
Tseng's Avatar
Join Date: Jan 2003
Location: California
Posts: 0
Tseng is on a distinguished road
Quote:
Originally posted by Kaimetsu
It depends. The name of the game is implicit intentions; personally I don't like searching through endless conditions to understand what somebody is doing. If the conditions are related then yeah, fine, but otherwise it's stupid.
if (playerchats && strequals(#c,give me pie)) {
//Some cool pie-giving coding
}

I've been arguing related the whole time.
__________________
Funny Things:
Quote:
Originally posted by Stefan
I didn't ban you, I only played a little bit with my RC.
-----
Reply With Quote
  #44  
Old 08-24-2003, 10:15 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by Tseng
I've been arguing related the whole time.
Indeed, but I'm not addressing just you
__________________
Reply With Quote
  #45  
Old 08-24-2003, 11:46 AM
Snakeandy7 Snakeandy7 is offline
"Member ID=2610"
Snakeandy7's Avatar
Join Date: Mar 2003
Posts: 987
Snakeandy7 is on a distinguished road
Quote:
Originally posted by TB3

NPC Code:


if(created) {
this.minplayers=5;
this.mode=0;
this.check=0;
}
if(playerenters||playerleaves) {
this.mode=(playerscount>=this.minplayers? 1 : playerscount<this.minplayers? 0 );
if(this.mode!==this.check) {
door();
}

}

function door() {
this.check=this.mode
if(this.mode=1) {//Opening
blah;
}
if(this.mode=0) {//Closing
blah;
}
}



THeres a more complex edit it should work *goez to zleep im tired*
I'm sorry but, why does your script question it self?...
__________________
"Freedom is best I tell thee
of all things to be won
then never live within the bond
of slavery my son".


Reply With Quote
  #46  
Old 08-24-2003, 06:18 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Quote:
Originally posted by Snakeandy7

I'm sorry but, why does your script question it self?...
its an operand (one of them), basically a quicker way of doing an if else type thing
myvar = (flag? valueiftrue : vlaueiffalse)
and I guess you can layer them... never tried that
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #47  
Old 08-25-2003, 06:40 AM
TB3 TB3 is offline
Registered User
TB3's Avatar
Join Date: May 2001
Location: US of A State of VA
Posts: 658
TB3 is on a distinguished road
Send a message via Yahoo to TB3
Quote:
Originally posted by Snakeandy7

I'm sorry but, why does your script question it self?...
As below an operand its realy good to use in some situations but can be easily messed up if you dont know what your doing.

Quote:
Originally posted by Dach


its an operand (one of them), basically a quicker way of doing an if else type thing
myvar = (flag? valueiftrue : vlaueiffalse)
and I guess you can layer them... never tried that
Yep you can layer them and it does it in order so it can be very helpfull, also if there is no value for false it doesnt set it to anything so it makes it even more helpfull
__________________

To the sun of your age, I arise
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:17 AM.


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