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-13-2002, 05:48 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Flag problem thing

NPC Code:

else if (playerchats&&strequals(#c,rent mine 1)&&playergralats=>5&&mine.onea=0&&ownsmine){
say2 You already have a mine!;
}



The bolded part is a flag. The only problem is that even when the flag is set, it won't give the message "You already have a mine!"
__________________
Reply With Quote
  #2  
Old 04-13-2002, 05:49 AM
Spanko Spanko is offline
Squeaker of Soles
Spanko's Avatar
Join Date: Nov 2001
Location: The Netherworl...lands
Posts: 1,366
Spanko is on a distinguished road
Send a message via ICQ to Spanko Send a message via AIM to Spanko Send a message via Yahoo to Spanko
You've got the playergralats thing again.
__________________

ICQ: 125283920
MSN: [email protected]
AIM: Squeax0r
Squeaker seems unable to access the forum using this account.. tis a sad day.
Now with occasional Asuka flavour! Ooops a bit too much...
Asuka should be king of Dustari!

"Y'know, some days even my lucky rocketship underpants don't even help."
Reply With Quote
  #3  
Old 04-13-2002, 05:52 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally posted by Spanko
You've got the playergralats thing again.
Oh, thanks, I fixed that, but that didn't fix the problem.
__________________
Reply With Quote
  #4  
Old 04-13-2002, 10:04 AM
Gohan43331 Gohan43331 is offline
Registered User
Join Date: Jan 2002
Posts: 87
Gohan43331 is on a distinguished road
Send a message via AIM to Gohan43331
Go in at each point and check the variables:

1. Do you have 5 gralats?
2. Is mine.onea == 0 ?
3. Did you type 'rent mine 1' correctly?

These may seem like quite stupid questions, but usually that's how I would debug something :P
Reply With Quote
  #5  
Old 04-13-2002, 10:27 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Yes
Yes
Yes

My guess is that for some reason it doesn't check for the flag

Oh well...

*Waits for a 1337 scripter like Kai or Archaon to show up*
__________________
Reply With Quote
  #6  
Old 04-13-2002, 11:36 AM
Kadar Kadar is offline
Registered User
Join Date: Jan 2002
Posts: 636
Kadar is on a distinguished road
if (playerchats&&strequals(#c,rent mine 1)){
if (playerrupees=>5 && mine.onea=0 && ownsmine){
say2 You already have a mine!;
}
}

make sure mine.onea=0 and that you have more then 5 rupees and ownsmine is set..
__________________
Reply With Quote
  #7  
Old 04-13-2002, 11:55 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally posted by Kadar
if (playerchats&&strequals(#c,rent mine 1)){
if (playerrupees=>5 && mine.onea=0 && ownsmine){
say2 You already have a mine!;
}
}

make sure mine.onea=0 and that you have more then 5 rupees and ownsmine is set..
Gah, nope, still lets me rent more then one mine
__________________
Reply With Quote
  #8  
Old 04-13-2002, 12:17 PM
Dustey Dustey is offline
Registered User
Join Date: Nov 2001
Location: Do You Think I Know?
Posts: 193
Dustey is on a distinguished road
Send a message via AIM to Dustey
lets see the first if that comes before that that actually rents out the mine if it isnt ownsmine
__________________
And Yes I work For.... Renegade
Reply With Quote
  #9  
Old 04-13-2002, 08:25 PM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Thanks, still have the flag problem though
__________________
Reply With Quote
  #10  
Old 04-13-2002, 09:02 PM
Slaktmaster Slaktmaster is offline
man with the mastahplan
Slaktmaster's Avatar
Join Date: Apr 2001
Location: Half-way over the river styx
Posts: 4,422
Slaktmaster is an unknown quantity at this point
Send a message via ICQ to Slaktmaster Send a message via AIM to Slaktmaster
Quote:
Originally posted by Kaimetsu
"playergralats=>5"

No sir!

"playergralats>=5" is your friend.

And Archaon is a LAT more than he is a NAT :-/
I'm quite good at scripting clientside stuff.
Reply With Quote
  #11  
Old 04-13-2002, 11:26 PM
mhermher mhermher is offline
galase galase!
mhermher's Avatar
Join Date: Jun 2001
Location: Sweden, Stockholm.
Posts: 2,012
mhermher is on a distinguished road
Send a message via ICQ to mhermher Send a message via AIM to mhermher Send a message via Yahoo to mhermher
Quote:
Originally posted by Googi
Yes
Yes
Yes

My guess is that for some reason it doesn't check for the flag

Oh well...

*Waits for a 1337 scripter like Kai or Archaon to show up*
dont use flags, they suck
use


client.mineowned=1;
and if (client.mineowned==1) {

}
__________________
Donate money for my trip to Germany

Adiarde Manager
Reply With Quote
  #12  
Old 04-14-2002, 02:03 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
You mean like this?

NPC Code:

else if (playerchats&&strequals(#c,rent mine 1)){
if (playerrupees>=5){
if (ownsmine){
if (mine.onea=0){
say2 You already have a mine!;
}
}
}
}



Because that still doesn't work
__________________
Reply With Quote
  #13  
Old 04-14-2002, 02:26 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally posted by Kaimetsu
place breakpoints
Umm...how?
__________________
Reply With Quote
  #14  
Old 04-14-2002, 04:07 AM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
NPC Code:

set ownsmine;
if (playerchats && strequals(#c,rent mine 1) && playerrupees>=5) {
if (mine.onea==0 && ownsmine){
say2 You already have a mine!;
}
}



Tada, this works.. just need to put "else" in front of the if and remove the set ownsmine; line.
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #15  
Old 04-14-2002, 07:04 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally posted by konidias
NPC Code:

set ownsmine;
if (playerchats && strequals(#c,rent mine 1) && playerrupees>=5) {
if (mine.onea==0 && ownsmine){
say2 You already have a mine!;
}
}



Tada, this works.. just need to put "else" in front of the if and remove the set ownsmine; line.
Nope, doesn't work.

As for the debugger, I used Koni's script, put it into the debugger, put the breaks beside them and then here's what happened.

Well, first it pauses the game, then in the dubugger it had the first line blue, I hit next, and the 2nd line turned blue, then I hit next again and the 5th line turned blue.
__________________
Reply With Quote
  #16  
Old 04-14-2002, 03:54 PM
mhermher mhermher is offline
galase galase!
mhermher's Avatar
Join Date: Jun 2001
Location: Sweden, Stockholm.
Posts: 2,012
mhermher is on a distinguished road
Send a message via ICQ to mhermher Send a message via AIM to mhermher Send a message via Yahoo to mhermher
Quote:
Originally posted by Kaimetsu


Uh...? No such thing as client variables, and even if there were, flags work perfectly fine.
ya but vars is better
__________________
Donate money for my trip to Germany

Adiarde Manager
Reply With Quote
  #17  
Old 04-14-2002, 06:27 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
I have a few things to say, one to googi:
The best way to get better with scripting is to start with smaller things, like for example, do bars and menus. Also I would suggest trying to have some more advanced scripters give you their showoffs, perhaps search the Scripting Forum for some showoffs. Another things to experiment with would be things like string manipulation, try playing with things like strlen, startswith, and stuff like that, my favorite is #e().
The next thing to Kai:
Debugger owns... I cannot tell you how many times debugger has saved me from countless hours of playing "find the error". Also wouldn't it be cool if there were a online debugger...woah...*goes to Future Improvements Forum even tho none of the improvements actually ever happen*.
__________________

!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
  #18  
Old 04-14-2002, 06:53 PM
mhermher mhermher is offline
galase galase!
mhermher's Avatar
Join Date: Jun 2001
Location: Sweden, Stockholm.
Posts: 2,012
mhermher is on a distinguished road
Send a message via ICQ to mhermher Send a message via AIM to mhermher Send a message via Yahoo to mhermher
Quote:
Originally posted by Kaimetsu


Except that there's no such thing as a client.var, and they're not better.
for me they work better
__________________
Donate money for my trip to Germany

Adiarde Manager
Reply With Quote
  #19  
Old 04-14-2002, 07:26 PM
Zelgadis_Geywords Zelgadis_Geywords is offline
RUBIX CUBE TEAM.
Zelgadis_Geywords's Avatar
Join Date: Nov 2001
Location: Insanity
Posts: 1,474
Zelgadis_Geywords is on a distinguished road
Send a message via AIM to Zelgadis_Geywords
Quote:
Originally posted by Kaimetsu


THEY DON'T EXIST.
Trying to get that point across seems as pointless as talking to a wall.
__________________
Hi. I'm Cyn.
Reply With Quote
  #20  
Old 04-14-2002, 07:49 PM
mhermher mhermher is offline
galase galase!
mhermher's Avatar
Join Date: Jun 2001
Location: Sweden, Stockholm.
Posts: 2,012
mhermher is on a distinguished road
Send a message via ICQ to mhermher Send a message via AIM to mhermher Send a message via Yahoo to mhermher
Quote:
Originally posted by Kaimetsu


THEY DON'T EXIST.
ehh... you mean you cant use

client.ownsmine=1;
and if (client.ownsmine==1) {
}

then youre wrong
:/
__________________
Donate money for my trip to Germany

Adiarde Manager
Reply With Quote
  #21  
Old 04-14-2002, 09:59 PM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally posted by Saga2001
Also I would suggest trying to have some more advanced scripters give you their showoffs.
Unless someone decides to "showoff" the crafting table, gralat crafting table, or Glyco script (Which I have already searched the forums for), then that's not much use.
__________________
Reply With Quote
  #22  
Old 04-14-2002, 10:01 PM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally posted by Kaimetsu


When they turn blue, it means that the engine has reached that line. If it didn't go to the third line then it must mean that the if statement on the second line wasn't evaluating true. Which line is that?
The second line was...
NPC Code:

if (mine.onea==0 && ownsmine){

__________________
Reply With Quote
  #23  
Old 04-15-2002, 01:56 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally posted by Googi


Unless someone decides to "showoff" the crafting table, gralat crafting table, or Glyco script (Which I have already searched the forums for), then that's not much use.
...The irony of this is that someone did O_o
__________________
Reply With Quote
  #24  
Old 04-15-2002, 06:09 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Well, now the script is this...
NPC Code:

else if (playerchats&&strequals(#c,rent mine 1)) {
if (ownsmine) {
say2 You already own a mine
}
}



And of course, it doesn't work

On the debugger, all the red lines turn blue (in sequence with the hitting of the run button of course)
__________________
Reply With Quote
  #25  
Old 04-15-2002, 06:12 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally posted by Kaimetsu


Summary: ownsmine is not set.
Gah, I made a mistake in the debugger thing. As I just edited the post to say, all the lines turn blue.
__________________
Reply With Quote
  #26  
Old 04-15-2002, 06:15 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally posted by Kaimetsu


On the code that you posted, you didn't put a semi-colon at the end of the say2 command.
Oh

*checks script*

It's there on the script, just not on the post

EDIT: Just noticed this, but when I try to rent the SAME mine TWICE it comes up with the message "you already own a mine"
__________________
Reply With Quote
  #27  
Old 04-15-2002, 07:58 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
No, I want it to stop you from renting more then one mine.
__________________
Reply With Quote
  #28  
Old 04-15-2002, 08:20 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Yeah, it doesn't do that.
__________________
Reply With Quote
  #29  
Old 04-15-2002, 08:28 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally posted by Kaimetsu


When you rent a mine twice, you get the message. That's the scenario I described.
Umm..no, it's like this.

The player says "rent mine 1"

They get the mine

THe player says "rent mine 1" again (while they still own the mine)

The message comes up "You already have a mine!"

But if they say "rent mine 1"

They get the mine

Then they say "rent mine 2"

They get mine 2 aswell.
__________________
Reply With Quote
  #30  
Old 04-15-2002, 08:39 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Done
__________________
Reply With Quote
  #31  
Old 04-17-2002, 03:46 AM
Gohan43331 Gohan43331 is offline
Registered User
Join Date: Jan 2002
Posts: 87
Gohan43331 is on a distinguished road
Send a message via AIM to Gohan43331
Quote:
Originally posted by Kaimetsu


Uh...? No such thing as client variables, and even if there were, flags work perfectly fine.
So let me get this straight:
- Client.blah = 100
- setstring client.blah,Muahah;

So the first one won't stay with the player, and the second one will...

Good...now all i have to do is go through 100000 lines of code and fix them :grrr: :grrr: :grrr:
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 12:33 AM.


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