Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-10-2001, 04:48 AM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
playing with inventory

Im trying to make somthing to do with inventory. How would I do this. I want to have NPCs that the player gets and every time they get them i want it to add 1 to the inventory but also to a string or somthing. This way they can get 3 of the NPC and it shows 3 in the inventory but wont allow them to get more until they go to some place and use it up. For example:

On bread baking on 2001, say you could carry 3 things of wheat. It showed 3 wheat symbols in the inventory. Then they had to carry it back to the bread place and they would walk to a table and 1 one disappear from the inventory leaving 2 wheat icons. Then the actions would happen. After making the first bread they had 2 wheats left. They can either go get another to make 3 there or just use up the other 2. How would this work. I dont know how to make it take 1 away from the inventory.
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #2  
Old 09-10-2001, 04:52 AM
Shard_IceFire Shard_IceFire is offline
Registered User
Shard_IceFire's Avatar
Join Date: Jun 2001
Location: Eastern Harkoonia
Posts: 861
Shard_IceFire is on a distinguished road
Well, you could do it so everytime a person gets wheat (or whatever else) it adds to a string.
NPC Code:

this.wheatplus=strtofloat(#s(wheatammt))+1;
setstring wheatammt,#v(this.wheatplus);


Then to read the string you could make it like when you touch an NPC he does this:
NPC Code:

message Your wheat: #s(wheatammt);


I hope that helps =)
If it doesn't IM me, I can help you work it out.
__________________

-=Shard IceFire=-
Reply With Quote
  #3  
Old 09-10-2001, 09:03 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
toinventory flag; is pretty buggy. I wouldn't recommend using it. First off, if you disconnect then reconnect your items don't show up again in your inventory place. Second off, once you unset flag, all the items in your inventory under that flag go bye bye.
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote
  #4  
Old 09-10-2001, 10:10 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~

If you want it to show up multiple times... do like this

toweapons /the-weapon-name;

I believe that works
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #5  
Old 09-10-2001, 10:16 AM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
i think i will just go with shard's idea and use a string and not inventory. The only reason i wanted to use inventory is cuz it actually shows an image of what the player has.
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #6  
Old 09-10-2001, 10:26 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
You could program your own inventory script...
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote
  #7  
Old 09-11-2001, 12:43 PM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~

While in essence making your own inventory script is good, it's not preferable... if it's simply multiple of an item you want, just use toweapons /(item name);

Using that, the item will more or less go to the inventory under the same name multiple times. Handy for stuff like potions...
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #8  
Old 09-11-2001, 12:53 PM
joseyisleet joseyisleet is offline
Registered User
Join Date: Aug 2001
Posts: 378
joseyisleet is on a distinguished road
or...

i was thinkin, i may be wrong but, you could use the set command and while command.
if (playerenters){toweapons test;set 1;}
while (1){setimg 1.gif;}
theres one npc
if (playerenters&&1){toweapons test; set 2; unset 1;}
while (2){setimg 2.gif;}
second one.
and so on and so on.
im half awake so if this doesnt work dont b*tch at me.
__________________
Account used by Josey and Howard.
Ali G: 'Is it cause i Black?'
Reply With Quote
  #9  
Old 09-15-2001, 04:42 AM
SSj_Link SSj_Link is offline
Registered User
Join Date: Jul 2001
Location: i r live in texas
Posts: 244
SSj_Link is on a distinguished road
Send a message via ICQ to SSj_Link Send a message via AIM to SSj_Link
Hmmm
Use flags,
and the toinventory \thing

Like

if (wheat&&!wheat1) {
towhatever \whaterver;
}



I know that probly confused

-Freaky-
__________________
-People with my Password: Me (Boozy), Ghostface Killa, bgraven, Freaky Carnie, Dark Warlock, and SoulReaver.
-So they can all post.-

-I hate my account name -

~Old Names: Link, Darklink, Neo, then Boozy when Bravo died. (So some people will recognize me)~

AIM: boozyneo
ICQ: 116030736
Msn: [email protected]
Email: [email protected]


-DANCE SPAM DANCE!- Dark Warlock
Reply With Quote
  #10  
Old 09-15-2001, 04:58 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~

DO NOT USE FLAGS!
NO NO NO PERIOD!

If you have to use flags for that, then shoot yourself, and stop scripting.

if (playertouchsme){
if (!hasweapon(Wheat 1) && !hasweapon(Wheat 2) && !hasweapon(Wheat 3)){
toweapons Wheat 1;
break;
}
if (hasweapon(Wheat 1)){
toweapons Wheat 2;
break;
}
if (hasweapon(Wheat 2)){
toweapons Wheat 3;
break;
}
}

Would be more efficient than the flags. And that's not much better.

And besides, the toweapons / will add that NPC MULTIPLE times to your inventory ANYWAY.
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)

Last edited by entravial; 09-15-2001 at 05:01 AM..
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:19 AM.


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