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 04-17-2003, 10:48 PM
slimchance11 slimchance11 is offline
Registered User
Join Date: Mar 2003
Posts: 31
slimchance11 is on a distinguished road
Talking Some Trouble with Flags

I'm having some trouble with flags... once I set them (or unset them) they aren't really set or unset until I press F4 and run the level again.

Like lets say when I said hi then the guy would say "Hello There!" and if I said bye then he would say "See you later!"

Except for me, if i was to say hi nothing would happen, i would have to press f4 and play the level again then he would be saying "Hello There!" The same goes for unsetting flags.

Is this normal? What's wrong?
__________________
I came... I saw... I PWNED!!!
Reply With Quote
  #2  
Old 04-17-2003, 11:12 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
There is a mistake in your script.
Reply With Quote
  #3  
Old 04-17-2003, 11:22 PM
Pokilty Pokilty is offline
Registered User
Join Date: Nov 2002
Posts: 101
Pokilty is on a distinguished road
if you post part of the script that gives you problems it would be easier to see how to fix it.
__________________
"I have not failed. I've just found 10,000 ways that won't work."
"Logic is in the eye of the logician."
Reply With Quote
  #4  
Old 04-18-2003, 04:34 AM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
then you probably have like:
NPC Code:

if (flag)
{ action;}


but because that is not an event in itself, it only calls when it reads the script for the first time (if created basically);
---Shifter
__________________
Who has time for life these days?
Reply With Quote
  #5  
Old 04-20-2003, 01:52 PM
Spark910 Spark910 is offline
Ex-Graal Global
Spark910's Avatar
Join Date: Oct 2001
Location: England
Posts: 10,892
Spark910 has a spectacular aura about
It depends what you trying to do, but you could either run a loop to check for the flag, so the action happenes when you get the flag. Or you could set the timeout in the NPC you recive the flag from.
__________________
--Spark911
Reply With Quote
  #6  
Old 04-20-2003, 02:29 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
Quote:
Originally posted by Spark910
It depends what you trying to do, but you could either run a loop to check for the flag, so the action happenes when you get the flag. Or you could set the timeout in the NPC you recive the flag from.

Preferably he would use if (playerchats)..........
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #7  
Old 04-20-2003, 04:41 PM
Spark910 Spark910 is offline
Ex-Graal Global
Spark910's Avatar
Join Date: Oct 2001
Location: England
Posts: 10,892
Spark910 has a spectacular aura about
Quote:
Originally posted by adam



Preferably he would use if (playerchats)..........
ahh. yes! I only read title and other peoples comments.
__________________
--Spark911
Reply With Quote
  #8  
Old 04-20-2003, 05:14 PM
Mykel Mykel is offline
:o
Mykel's Avatar
Join Date: May 2002
Location: Canton, Ohio.
Posts: 5,526
Mykel has a spectacular aura about
Send a message via AIM to Mykel Send a message via MSN to Mykel
bear with me, i suck at scripting:

NPC Code:
if (playerchats && strequals{#c,hi})
message Hello There!;



not sure if that is correct, but oh well.
__________________
(Married to Skyld)
Reply With Quote
  #9  
Old 04-20-2003, 05:16 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
NPC Code:

if (playerchats && strequals(#c,hi))
message Blah;



A little fix to that.
__________________

Quote:
Exitus Acta Probat: The Outcome Justifies the Deed.
Reply With Quote
  #10  
Old 04-20-2003, 05:19 PM
Mykel Mykel is offline
:o
Mykel's Avatar
Join Date: May 2002
Location: Canton, Ohio.
Posts: 5,526
Mykel has a spectacular aura about
Send a message via AIM to Mykel Send a message via MSN to Mykel
Quote:
Originally posted by Neoreno
NPC Code:

if (playerchats && strequals(#c,hi))
message Blah;



A little fix to that.
ahh, wasnt sure if it was )('s or }{'s around the #c,hi
__________________
(Married to Skyld)
Reply With Quote
  #11  
Old 04-20-2003, 07:44 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 Neoreno
NPC Code:

if (playerchats && strequals(#c,hi))
message Blah;



A little fix to that.

Another little fix to that..

if(playerchats && strequals(#c,hi)){
message Blah;
}
__________________
"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
  #12  
Old 04-21-2003, 12:44 AM
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
Quote:
Originally posted by osrs



Another little fix to that..

if(playerchats && strequals(#c,hi)){
message Blah;
}
You don't have to put the {} down if there is only one command after the event.
__________________

Quote:
Exitus Acta Probat: The Outcome Justifies the Deed.
Reply With Quote
  #13  
Old 04-21-2003, 01:22 AM
PrinceDark PrinceDark is offline
Criminal X
PrinceDark's Avatar
Join Date: Feb 2003
Location: Miami, Florida
Posts: 662
PrinceDark will become famous soon enough
Question

Why?
__________________
- Criminal X: certified nut case
Reply With Quote
  #14  
Old 04-21-2003, 02:04 AM
Jeff Jeff is offline
Registered User
Join Date: Oct 2002
Location: Nebraska, USA
Posts: 707
Jeff is on a distinguished road
Using braces tends to make the code more legible.
__________________
Jeff, the Archduke of Dustari
Member of the LAT on Graal The Adventure
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GO d+ s++:+ !a C++ UL+(UL+++)@ P+ L+(++)>+++ E---- W++@ N- !o ?K w(w--) !O !M@ !V PS- PE+ Y PGP t+ 5 X R tv(tv+) b++(b+)>b++++ DI(DI+) D-- G e->e++++ h! !r y
------END GEEK CODE BLOCK------
Reply With Quote
  #15  
Old 04-21-2003, 08:58 AM
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 Neoreno


You don't have to put the {} down if there is only one command after the event.
Listen to what Jeff said..

Quote:
Originally posted by Jeff
Using braces tends to make the code more legible.
__________________
"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
  #16  
Old 04-21-2003, 04:35 PM
Falados Falados is offline
Cucumber NPC
Falados's Avatar
Join Date: Jan 2003
Posts: 141
Falados is on a distinguished road
Send a message via ICQ to Falados Send a message via AIM to Falados
Its a matter of preference, I myself like to put things in braces, but only if they are legitimately complex commands. Braces are just grouping a series of commands together so a conditional statement knows it needs to execute all of the following commands, instead of just the one that follows it. Putting a brace around 1 command is legitimate, but it’s like making an array with 1 element, I don’t think it makes the script more legible (unless you start wildly using white space, or the reverse, lack white space)
__________________

subliminal message: 1+1=3
Reply With Quote
  #17  
Old 04-21-2003, 05:21 PM
Dude6252000 Dude6252000 is offline
More often known as Karsh
Dude6252000's Avatar
Join Date: May 2002
Location: USA.
Posts: 2,603
Dude6252000 is on a distinguished road
Send a message via AIM to Dude6252000
braces 4 lyf

I honestly didn't know you didn't need them for one command since about a week ago. o.o They're still my friend.
__________________
BEING AWAY FROM THE FORUMS RULES

http://www.livejournal.com/users/karsheth/
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:46 AM.


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