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 03-15-2002, 12:03 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
? and :

My friend had sent me a script that was like this:
NPC Code:

if (playertouchsme){
playerdarts = (playerdarts>=70? 99: playerdarts+30);
}



Could someone please explain what each part of that does like the ? and the 99: and how to use it? I think it has something to do with rounding numbers down but I couldn't figure out how it worked, any help would be greatly appreciated
Reply With Quote
  #2  
Old 03-15-2002, 02:09 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by Kaimetsu
http://forums.graal2001.com/forums/s...threadid=25639
yeah, thats probably the best place, however if that was not enough explaining, I could explain more on aim or something.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #3  
Old 03-16-2002, 09:03 PM
mikepg mikepg is offline
Registered User
Join Date: Nov 2001
Location: VA, USA
Posts: 501
mikepg is on a distinguished road
Send a message via AIM to mikepg Send a message via Yahoo to mikepg
ok

Incase this wasnt answered on aim, or if anyone else is still confused after reading the other post...
NPC Code:

playerdarts = (playerdarts>=70 ? 99 : playerdarts+30);
1. 2. 3. 4.


the part before the ? is the conditional statement playerdarts>=70, so the NPC checks to see if the player has 70 or more arrows. If the player does, the NPC makes the dart count to 99, if not the dart count increases by 30.

another example could be this:

You want to say, if the player has 3 or less hearts, the NPC should make their current heart count 5 (assuming that is within their fullheart length), and if they have more than 3, make it so they have 1 more heart.
NPC Code:

playerhearts = (playerhearts>=3 ? 5 : playerhearts+1);
1. 2. 3. 4.



so....
1 : what you want to change
2 : what you are checking
3 : what you are checking is true, the variable gets that value (ie 1<2 would be true)
4 : what you are checking is false, the variable gets that value (ie 1>2 would be false)
__________________
~War Lord Mpg2
Bravo Online's Asst. Staff Manager

"Sittin by the tree, sippin eggnog, waitin on christmas gifts"
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 06:55 PM.


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