Add to Message.. maybe another way?

Started by barefoot, Wed 19/01/2011 18:06:46

Previous topic - Next topic

barefoot

Hi

I have been looking at Khris's reply to my last post.. but a bit unsure..

I'm using (may not be quite right, not sure):

Code: ags

 String message1 = Room.Messages[1];
 Display("Found $50", message1);


and

Code: ags

 String message2 = Room.Messages[1];
  Display("Credit Cards", message2);


both display a message of item found, one per item.

I really need a way to 'add' to the message as items are added to inventory..

if you got:
Credit cards
Necklace
Wallet

When you get the last one (can be in any order) the message may then read:

Credit cards $100.  Necklace $1000. Wallet $100

etc etc

Also if you can check which message you have at  the end of the game and have it displayed..

Cheers if you can help me with this.

barefoot


I May Not Be Perfect but I Have A Big Heart ..

Khris

To clarify:

My code takes the three mentioned items (or an arbitrary number of other items) and composes a string, in this case:

"You have credit cards, a necklace and a wallet. Ok, I'll give you $1200."

This is what you were asking for in the other thread. I have no clue what your post is supposed to be saying. You have a way of expressing yourself as unclear as possible, sorry.

It sounds like you want to assign a money value to each inventory item and display an overview somewhere.

Also, why are you using Room messages?

barefoot

#2
Hi Khris

I apologise if i come across as unclear.

I am in a situation where I'm not sure what is the best solution.

I think it may be about implementing your script and actually being able to put it in....im unsure..

Im ok putting the items in when talking to guy (fence) (as per your script)
Code: ags

if (player.HasInventory(iCreditCard)) AddToMessage("a credit card", 150);


Think of it this way:

Imagine if you went to an auction and brought some stuff to sell..

when you get home a man comes around and looks at what you have. Depending on what you have he gives you a total price which you have to accept as each item has a $ value anyway..

for example:
credit cards $100
wallet $50
tv $100

He would give you $250

was looking at your code, AddToMessage... This gave me idea about messages... maybe not this way though.

I hope you catch my drift.  Bit of a barn stormer problem this one! Unless there is a much easier, simplified way?

I can use HasInventory for each item and have a Display like "Necklace $50" and then the next display and the next display etc..

It's just getting a total $ that is the hinderence.

cheers

barefoot





I May Not Be Perfect but I Have A Big Heart ..

Khris

Ok, when exactly is the message listing the items and the total value supposed to be displayed?

As far as I understood your previous thread, the player walks around the game, collecting various valuable items.
In one room there's a guy, if you talk to him, he looks at what the player collected, saying e.g. "You have credit cards, a necklace and a wallet. Ok, I'll give you $1200."
The player can accept this offer and will receive 1200 while losing the items.

Now, I need more info to be able to help you.
1. Is the player able to decline this offer?
2. Is the message supposed to be displayed elsewhere? (E.g. is there some kind of "list loot" button that'll inform the player about the total value of what he has collected so far?)

You see, helping others with technical problems is easiest when they either
a) provide code that doesn't work while explaining what they want it to do
or
b) describe what exactly the player's experience is supposed to be so we can turn that into code

You keep mixing up the two, making it hard to provide specific help.

barefoot

#4
Hi Khris, hope the following is understandable,

Quote
when exactly is the message listing the items and the total value supposed to be displayed?

You have a set of Buttons on a GUI (shown below).. one of which is to the Fence.
When you visit the Fence he will see what you have...Possibly after room fadein, Call this the Fence Room. This is where the display and events happen and you will know what total price you have. You can only visit the Fence once (i disable the street/road/fence buttons when you arrive at the Fence room).

In actual fact it's a Grifters competition and there will be others competing. These others will have predetermined goods with a total price.

You have to have the highest amount of $ to win. I could have a 'Random' variety of amounts you have to beat so sometimes you can win with less $ as it were.

EG John: $2000  Bill: $4000 Henry: $6000 Tom: $9000 in which only 1 will be randomly shown.

* It would really be good if I have a SetTimer when the game begins in Room 3, so you have say just 2 hours to get as much as you can and go to the Fence Room before the time runs out and you fail.

GUI:


The idea is to collect as many goods and stuff as you can before you visit the fence.. Done by stealing, coning, mugging and finding stuff etc.

Quote
As far as I understood your previous thread, the player walks around the game, collecting various valuable items.
In one room there's a guy, if you talk to him, he looks at what the player collected, saying e.g. "You have credit cards, a necklace and a wallet. Ok, I'll give you $1200."
The player can accept this offer and will receive 1200 while losing the items.

Yes, that's about it. Of course the player HAS to accept it.. you can't decline.

Quote

Now, I need more info to be able to help you.
1. Is the player able to decline this offer?
2. Is the message supposed to be displayed elsewhere? (E.g. is there some kind of "list loot" button that'll inform the player about the total value of what he has collected so far?)

1, No, you cannot decline any offer
2, I have no list loot button (great idea though!)

I hope this answers your questions and you are able to help me progress.

Sometimes one gets an idea and sometimes its knowing how to do it...

As everything is not in the manual you have to dig deep or ask experienced scripters.

It is fun and I enjoy doing it..

cheers Khris

barefoot


I May Not Be Perfect but I Have A Big Heart ..

SMF spam blocked by CleanTalk