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 07-03-2002, 11:21 AM
Artificial_Sweetener Artificial_Sweetener is offline
Registered User
Artificial_Sweetener's Avatar
Join Date: Mar 2002
Posts: 758
Artificial_Sweetener is on a distinguished road
Simple question

Sorry uh.. I just need one simple command for a script i'm working on.. I'll delete this thread as soon as someone replies =)

Anyway, let me think of an example..

Just take like a light switch for an example, I need to figure out how to make it so if the player touches it once it will activate and if it touches it agian it will deactivate. I don't need this script exactly just the idea in general so I could finish up a script I'm working on.. Thanks alot
__________________
OOC: Scarlett (Head Auctioneer)
IC: Queen Arianna Durime of (Inra)
Reply With Quote
  #2  
Old 07-03-2002, 11:26 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
well, something like this would work, for database npc

NPC Code:

if (playertouchsme) {
setstring this.onoff,#v(abs(strtofloat(#s(this.onoff))-1));
}





then have it read the flag, and if its 1 then on, 0 = off

=D
__________________
[signature]insert here[/signature]
Reply With Quote
  #3  
Old 07-03-2002, 11:38 AM
Artificial_Sweetener Artificial_Sweetener is offline
Registered User
Artificial_Sweetener's Avatar
Join Date: Mar 2002
Posts: 758
Artificial_Sweetener is on a distinguished road
Um could you explain it a bit?
So I could take it a part, understand how it works, and make it something else.. Please
__________________
OOC: Scarlett (Head Auctioneer)
IC: Queen Arianna Durime of (Inra)
Reply With Quote
  #4  
Old 07-03-2002, 12:11 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
well, since there is only two possible flags, on or off, i just use variables 0 and 1

take the current status of the light, lets say off (off=0) and then just take the absolute value of the status -1, so
0-1 = -1
|-1| = 1

turns from off (0), to on (1)

same way around
1-1 = 0
|0| = 0

turns from on (1), to off (0)
__________________
[signature]insert here[/signature]
Reply With Quote
  #5  
Old 07-04-2002, 02:51 AM
Knight_Vincent Knight_Vincent is offline
Registered User
Knight_Vincent's Avatar
Join Date: Aug 2001
Location: Troy, MI
Posts: 682
Knight_Vincent is on a distinguished road
Send a message via ICQ to Knight_Vincent Send a message via AIM to Knight_Vincent Send a message via Yahoo to Knight_Vincent
Just wondering, would that work the same if it was

if (weaponfired)

?
__________________
"Did you write the Book of Love And do you have faith in God above If the Bible tells you so Do you believe in rock 'n roll Can music save your mortal soul And can you teach me how to dance real slow Well, I know that you're in love with him 'Cause I saw you dancin' in the gym You both kicked off your shoes Man, I dig those rhythm and blues I was a lonely teenage broncin' buck With a pink carnation and a pickup truck But I knew I was out of luck The day the music died" --Don McLean 'American Pie'
Reply With Quote
  #6  
Old 07-04-2002, 02:55 AM
user13-xo user13-xo is offline
Registered User
Join Date: Nov 2001
Location: California
Posts: 297
user13-xo is on a distinguished road
Send a message via AIM to user13-xo
Quote:
Originally posted by Knight_Vincent
Just wondering, would that work the same if it was

if (weaponfired)

?
Yes
Reply With Quote
  #7  
Old 07-04-2002, 02:58 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
it would work in any flag that is true

playerenters, playerchats, etc, etc
__________________
[signature]insert here[/signature]
Reply With Quote
  #8  
Old 07-04-2002, 03:16 AM
Knight_Vincent Knight_Vincent is offline
Registered User
Knight_Vincent's Avatar
Join Date: Aug 2001
Location: Troy, MI
Posts: 682
Knight_Vincent is on a distinguished road
Send a message via ICQ to Knight_Vincent Send a message via AIM to Knight_Vincent Send a message via Yahoo to Knight_Vincent
Ahh, thank you .
__________________
"Did you write the Book of Love And do you have faith in God above If the Bible tells you so Do you believe in rock 'n roll Can music save your mortal soul And can you teach me how to dance real slow Well, I know that you're in love with him 'Cause I saw you dancin' in the gym You both kicked off your shoes Man, I dig those rhythm and blues I was a lonely teenage broncin' buck With a pink carnation and a pickup truck But I knew I was out of luck The day the music died" --Don McLean 'American Pie'
Reply With Quote
  #9  
Old 07-04-2002, 03:32 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
no problem, thats what im here for



and remember if you have any other questions, dont be afraid to ask
__________________
[signature]insert here[/signature]
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 10:26 PM.


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