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-13-2003, 06:36 AM
alarid0 alarid0 is offline
~~Paul
alarid0's Avatar
Join Date: Jan 2003
Location: Wisconsin, USA
Posts: 1,060
alarid0 will become famous soon enough
Send a message via AIM to alarid0 Send a message via MSN to alarid0
changing variables of class scripts

I made a NPC that drops tickets. You can drop multiple amounts into the ticket, that works fine. Where I'm having trouble is, if i drop another ticket ontop of a ticket, how would i merge the two together as well as the count?
__________________
Reply With Quote
  #2  
Old 03-13-2003, 06:47 AM
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
Well, I can think of one way, would be to, upon creation of an item, have it search around itself for items of the exact same type, and if it finds some, then make it increase its own count and delete the item it found.
__________________

subliminal message: 1+1=3
Reply With Quote
  #3  
Old 03-14-2003, 01:53 AM
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
Yea... Get the X and Y infront of player, whichever way hes facing; then check for a npc infront of it using:

NPC Code:

npcs[index].x
npcs[index].y



... If found, then do what he says ^_^.
__________________
Knuckles
"They say 60% of the time, it works everytime!"
Reply With Quote
  #4  
Old 03-14-2003, 04:57 AM
alarid0 alarid0 is offline
~~Paul
alarid0's Avatar
Join Date: Jan 2003
Location: Wisconsin, USA
Posts: 1,060
alarid0 will become famous soon enough
Send a message via AIM to alarid0 Send a message via MSN to alarid0
Yeah, but how would i check if that NPC is a ticket NPC, and how would i get the variables held within it?
__________________
Reply With Quote
  #5  
Old 03-14-2003, 05:08 AM
Soul-Blade Soul-Blade is offline
US Marine
Soul-Blade's Avatar
Join Date: Jul 2001
Location: Coeur d'Alene, ID
Posts: 945
Soul-Blade is an unknown quantity at this point
Send a message via AIM to Soul-Blade
One way would be to use a NPCs save variable, maybe assign a number to ID the type of item. When a item is placed, if checks all NPCs and if a NPC has a x/y within the radius of the potential x/y of the new item, then it checks the save, if the save is the same type as the save the current item has, then it destroys itself. Of course, another save could be used to store the data for quantity of a item, but there are a variety of ways to store that.
Reply With Quote
  #6  
Old 03-14-2003, 05:19 AM
alarid0 alarid0 is offline
~~Paul
alarid0's Avatar
Join Date: Jan 2003
Location: Wisconsin, USA
Posts: 1,060
alarid0 will become famous soon enough
Send a message via AIM to alarid0 Send a message via MSN to alarid0
Yeah, I've thought about using save variables, but for the quantity, that would help since i think save varaibles have a limit of 200++ something.
__________________
Reply With Quote
  #7  
Old 03-14-2003, 03:05 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
run a for loop and maybe check via with(npcs[index]) if it matches the current item, it doesnt sound too difficult
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:39 AM.


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