Question about Referencing Objects Attributes

Talon
10 Mar 2016, 20:27
I'm working on a little something in my game, the effect I want is when you use/give an item on a character(NPC) for the NPC to reply with something about the item..Sort of like an appraisal

So if I offer an item that has the "Roman" attribute I'd like to get a response like this

Oh good a "Roman" relic, those are quite rare..

How would I have the text response read out the attribute of the item being used/given, is there a way to do it other than just listing all the possible items that can be given. looking for some way to reference the item in question without having to actually use every very similarly named artifact i might have in the game.

HegemonKhan
10 Mar 2016, 22:05
I dont' know if this will be of help to you, but here's a starting point, if you can understand it:

90% of everything/anything that you want to do within your game is done by:

the two SUPER SCRIPTS: (1) the 'set a variable or attribute' Script (2) the 'if' Script
Attributes and If Expression usage

viewtopic.php?f=18&t=5559

I don't have the time to help you step by step, but hopefully others can.

Talon
10 Mar 2016, 22:38
Yeah, already know how to use those, and have done them, it will work I'm looking to see if there is a simpler way to just indicate the object being used than using the name.. some trigger like "This" or the like, maybe i'll look into some of the other options for expressions tongiht

XanMag
10 Mar 2016, 23:43
I'm confused. Don't you use the give/use script for each item anyway and then don't you need to print a message in response? I must misunderstand your question. It's what I do best! :D

HegemonKhan
11 Mar 2016, 06:25
You have to have an "identifier" (an Attribute for you to check via the 'if' Script), as this is how the world works, including in programming.

in real life, let's say there's a bunch of people along with you, and I want to get your attention, I need to identify you out from the rest of the group. The most direct identifier that humans use, is that thing we call, our (first) 'name' that we're given soon after birth, ... "Hey, Talon! It's good to see you!"

other common identifiers:

sex, ethnicity/race/skin color (skin covers our entire body, we use it, as it is such a good-obvious/glaring indentifier), roles/classes/castes, rich/poor, sexuality: tall/short, sexuality: fat/fit, sexuality: sexy-hot/ugly, age/sexuality:young/old, etc etc etc

------------

though, you can shorten up the coding required a bit... for example, using the text processor commands:

http://docs.textadventures.co.uk/quest/ ... essor.html

though, they have some limitations, compared to the normal 'if' block scripting

there's also using lists/dictionaries/object types (quest's groups/classes)/etc, which can be a big improvement in the reduced amount of work/typing/coding you need to do.

there's of course many other better (more efficient) code designs too, depending on how good of a coder/programmer you are, but you can't bypass the state of reality. You can't reduce reality, some things you're just stuck with having to do/use, there's no way of not doing/using them at all.

----------

I too am a bit unclear on what you're asking for as well, laughs. If you could explain or be a bit more descriptive in what you mean and/or are asking about, would help me out, in trying to be more helpful for you.

jaynabonne
11 Mar 2016, 12:15
Talon wrote:Yeah, already know how to use those, and have done them, it will work I'm looking to see if there is a simpler way to just indicate the object being used than using the name.. some trigger like "This" or the like, maybe i'll look into some of the other options for expressions tongiht


Depending on whether the item in question is the one the script is running on or is a parameter, I would think either "this" or "object" or "object2" might be what you want. (Try printing them out.)

Talon
11 Mar 2016, 21:23
can't get to the program at the moment, but will try that out..Though coming to the conclusion i just might have to do alot of copy and pasting of scripts .

Think I might have messed up my own logic in explaining it as well.. not even really sure which would be a more logical way to handle it, Both ways seem to work conceptually, though from an economy of script angle having it on the appraiser(NPC) seems more natural than the objects where i just put the parameter that needs to be read. having it on the item that can just be used with the appraiser would work even with the basic stuff already in the program but would have to be done for each of the objects, and could get complicated if i ever want to use multiple appraisers who offer differing sums for the objects

jaynabonne
11 Mar 2016, 21:33
Feel free to post a sample of some code (or a small game that shows it). I'm curious how you have things set up.

Talon
12 Mar 2016, 14:54
Will try to set up a quick sample game, taking it from the main game is going to be...urgh..messy, much cleaner if i just set up the concept i'm working on in a petri dish of sorts