Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Refering item from string
Author Message
Arcer
Apprentice
*

Posts: 20
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Mar 2013
Reputation: 0



Post: #1
Refering item from string
Hi,
I've a function like this:

Code:
[function f_craft_list]
serv.list.craftList.ADD <args>

[function f_craft_list_show]
say <<serv.list.craftList.0>.NAME>

with the first make a list of items defname like :i_alchemical_dust,i_gold, etc etc

and it's ok, but with the second i found a console error like :
ERROR:(customItems.scp,17)Can't resolve <"i_chemical_dust".NAME>

serv.list.craftList.0 return me i_alchemical_dust, but how can i retrive item object from a string?


thank you
10-06-2014 10:55 PM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #2
RE: Refering item from string
perhaps doin this?

<serv.itemdef.<serv.list.craftlist.0>.name>

i dont really understand what you get from the string but if you are returning the item you want exactly as you wrote it with the " " on it, you might need to remove them
<serv.itemdef.<strsub 1 <EVAL STRLEN(<serv.list.craftlist.0>)-2> <serv.list.craftlist.0>>.name>

PD:
cant find the serv.list command, did you softcored it or it actually exists?
(This post was last modified: 10-07-2014 03:10 AM by kn4tseb.)
10-07-2014 02:53 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 246
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #3
RE: Refering item from string
The list command is for implementing list Tongue

http://wiki.sphere.torfo.org/index.php/LIST
10-07-2014 04:44 AM
Find all posts by this user Like Post Quote this message in a reply
Arcer
Apprentice
*

Posts: 20
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Mar 2013
Reputation: 0



Post: #4
RE: Refering item from string
(10-06-2014 10:55 PM)Arcer Wrote:  Hi,
I've a function like this:

Code:
[function f_craft_list]
serv.list.craftList.ADD <args>

[function f_craft_list_show]
say <<serv.list.craftList.0>.NAME>

with the first make a list of items defname like :i_alchemical_dust,i_gold, etc etc

and it's ok, but with the second i found a console error like :
ERROR:(customItems.scp,17)Can't resolve <"i_chemical_dust".NAME>

serv.list.craftList.0 return me i_alchemical_dust, but how can i retrive item object from a string?


thank you
GOOOOOOD OK Smile

What I want to make is a container where player put some resourcers (like mineral,logs, reagents) and in the player's backpack appear an item....but how can i test if the resources in the container are enough to make the item?
10-07-2014 07:50 AM
Find all posts by this user Like Post Quote this message in a reply
Arcer
Apprentice
*

Posts: 20
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Mar 2013
Reputation: 0



Post: #5
Refering item from string
Restest is my friend! Task accomplished [GRINNING FACE WITH SMILING EYES]
10-07-2014 08:57 AM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #6
RE: Refering item from string
good job ^^
10-07-2014 09:52 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)