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
  #1  
Old 08-21-2003, 03:36 PM
bashjgovers bashjgovers is offline
Registered User
Join Date: Aug 2003
Posts: 31
bashjgovers is on a distinguished road
players in room

hey i wanna make a event house where the people dont need ET to play events. I wanna make the doors will open automatic when there are enough players in the room. Can anyone help me with this?
Reply With Quote
  #2  
Old 08-21-2003, 03:48 PM
Neoreno Neoreno is offline
Cerebrate
Neoreno's Avatar
Join Date: Aug 2001
Location: England
Posts: 1,663
Neoreno is on a distinguished road
Send a message via AIM to Neoreno
Use a for loop and the playercount variable.
__________________

Quote:
Exitus Acta Probat: The Outcome Justifies the Deed.
Reply With Quote
  #3  
Old 08-21-2003, 04:28 PM
Snakeandy7 Snakeandy7 is offline
"Member ID=2610"
Snakeandy7's Avatar
Join Date: Mar 2003
Posts: 987
Snakeandy7 is on a distinguished road
Wasnt there a command like
if (playerscount == 2){..}
Bla, But i'd listen to kiirar, the loop is the best direction to go
__________________
"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
  #4  
Old 08-21-2003, 04:44 PM
Knuckles Knuckles is offline
Registered User
Join Date: Sep 2002
Location: New York
Posts: 580
Knuckles is on a distinguished road
Send a message via AIM to Knuckles
Quote:
Originally posted by Snakeandy7
Wasnt there a command like
if (playerscount == 2){..}
Bla, But i'd listen to kiirar, the loop is the best direction to go
...That's close to what Kirrar's saying.
Quote:
Use a for loop and the playercount variable.
And you mean a timeout loop?
__________________
Knuckles
"They say 60% of the time, it works everytime!"
Reply With Quote
  #5  
Old 08-21-2003, 05:00 PM
Neoreno Neoreno is offline
Cerebrate
Neoreno's Avatar
Join Date: Aug 2001
Location: England
Posts: 1,663
Neoreno is on a distinguished road
Send a message via AIM to Neoreno
No. I mean a for loop.


Edit: I re-read what they wanted, a timeout loop would be more useful in this case.
__________________

Quote:
Exitus Acta Probat: The Outcome Justifies the Deed.

Last edited by Neoreno; 08-21-2003 at 06:12 PM..
Reply With Quote
  #6  
Old 08-21-2003, 06:27 PM
marcoR marcoR is offline
Registered User
Join Date: Jul 2003
Posts: 1,349
marcoR is on a distinguished road
ok... i'm no scripting genius, heck, i can barelly make a door

but wouldn't it look like this?
NPC Code:

timeout=0.5;

if (timeout && playercount>5){
do something;
timeout=0.5;
}



but I don't know, i've never used player count, and heck, i suck at scripting..
__________________
If this is your account, contact me.
- loriel
email, jabber: [email protected]
icq: 67530805
aim: lorielvictrix
Reply With Quote
  #7  
Old 08-21-2003, 06:32 PM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
Quote:
Originally posted by marcoR
ok... i'm no scripting genius, heck, i can barelly make a door

but wouldn't it look like this?
NPC Code:

timeout=0.5;

if (timeout && playercount>5){
do something;
timeout=0.5;
}



but I don't know, i've never used player count, and heck, i suck at scripting..
Don't declare flags/variables etc. outside of code blocks. In addition, do not have an event check and a conditional check in the same if (statement). I suggest defining timeout in playerenters.
Reply With Quote
  #8  
Old 08-21-2003, 06:33 PM
Neoreno Neoreno is offline
Cerebrate
Neoreno's Avatar
Join Date: Aug 2001
Location: England
Posts: 1,663
Neoreno is on a distinguished road
Send a message via AIM to Neoreno
Well. The timeout is too infrequent. A timeout of 0.05 would do.
The variable is playerscount I believe. Not to mention it doesn't conform to KSI-GS standards.
__________________

Quote:
Exitus Acta Probat: The Outcome Justifies the Deed.
Reply With Quote
  #9  
Old 08-21-2003, 06:38 PM
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 protagonist


In addition, do not have an event check and a conditional check in the same if (statement).
The logic behind this is...?
__________________
Funny Things:
Quote:
Originally posted by Stefan
I didn't ban you, I only played a little bit with my RC.
-----
Reply With Quote
  #10  
Old 08-21-2003, 06:40 PM
marcoR marcoR is offline
Registered User
Join Date: Jul 2003
Posts: 1,349
marcoR is on a distinguished road
not the standards!? NO!!! *cuts hand off* it was an example, sheesh, and what's wrong with doing that? (give me a good reason and i'll never do it again)

[edit]
sorry about the timeout I always do that.. I don't even know why, I meant 0.05 tho.
[/edit]
__________________
If this is your account, contact me.
- loriel
email, jabber: [email protected]
icq: 67530805
aim: lorielvictrix
Reply With Quote
  #11  
Old 08-21-2003, 06:50 PM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
Quote:
Originally posted by Tseng


The logic behind this is...?

It is neater. Read KSI-GS standards thread.
Reply With Quote
  #12  
Old 08-21-2003, 06:58 PM
marcoR marcoR is offline
Registered User
Join Date: Jul 2003
Posts: 1,349
marcoR is on a distinguished road
meh, I guess I'll fall to the wrain of kai...

so would it be like this?

NPC Code:


timeout=0.05;

if (timeout){
if(playerscount>5){
do something, please!;
}
timeout=0.05;
}



atleast that's how I understood it...
__________________
If this is your account, contact me.
- loriel
email, jabber: [email protected]
icq: 67530805
aim: lorielvictrix
Reply With Quote
  #13  
Old 08-21-2003, 06:59 PM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
Quote:
Originally posted by marcoR
meh, I guess I'll fall to the wrain of kai...

so would it be like this?

NPC Code:


timeout=0.05;

if (timeout){
if(playerscount>5){
do something, please!;
}
timeout=0.05;
}



atleast that's how I understood it...
You should still need to define timeout in a code block.
Reply With Quote
  #14  
Old 08-21-2003, 07:00 PM
marcoR marcoR is offline
Registered User
Join Date: Jul 2003
Posts: 1,349
marcoR is on a distinguished road
than like this!?

NPC Code:


if (created){
timeout=0.05;
}

if (timeout){
if(playerscount>5){
do something, please!;
}
timeout=0.05;
}




!?
__________________
If this is your account, contact me.
- loriel
email, jabber: [email protected]
icq: 67530805
aim: lorielvictrix
Reply With Quote
  #15  
Old 08-21-2003, 07:27 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally posted by marcoR
than like this!?

NPC Code:


if (created){
timeout=0.05;
}

if (timeout){
if(playerscount>5){
do something, please!;
}
timeout=0.05;
}




!?
Yes.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
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 02:27 PM.


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