Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - barefoot

#421
Hi Dualnames

I agree with you but its like I've already said... but at least i have learnt a few options... it just got a little confusing... but i will certainly copy your code above and keep it along with Khri's for reference....getting to a final solution is very relieving as you yourself know and i did not intend to shake the bees nest.

thanks again to those that contributed

barefoot

#422
Hi Khris

None taken...

Things can get a little daunting and my scripting inexperience can make things confusing at times.

Unfortunately i lost all my written codes so i have to try and remember them or search/ask here.

It's like you know what you want but don't know how to achieve or implement it..

I really appreciate your help/advice.. maybe i did not choose the best method first time...

If i had known how to add a score/points system then there would not have been a problem.. But i've learnt and implemented a score/point system that does what i was aiming for but never knew how to do it..

In the end I achieved what i was looking for and i will be more specific next time maybe after a long think about it first.

Cheers Khris

Les






#423
Cheers Khris

I will amend and  recopy the code and stick it in notepad... thanks

I have decided to have a points ($) system. When an inv item is collected it adds an amount to the total etc..  It seems to work ok.

So far so good.

barefoot
#424
Many many thanks Gilbet

Done the $ done in display.. Works..

I will have to do a full research of var and operators..

I'm assuming my solution find is almost there?

cheers

barefoot

#425
Hi

Update

after creating a variable called Total (Total, int, value 0) I use this to add to it ($50):

 Total = (Total + 50);
 Display("You have $50");
 Display("Total: %d", Total);

I do this for every inventory collected.. so it totals up as each inventory item is found.

Is there a way to Display $50 rather than just 50?

I just need help with the <>= .. any help would be appreciated.

Plus if score=this or that then display this..

Am I on the right track?

I shall persevere

cheers for any assistance on this matter

barefoot








#426
Hi

The script dualnames gave seems to accept the following:

Code: ags

function cfence_Talk()
{
cfence.Say("Let's see what you got!");
 if (invCustomInv.ItemCount==0) {
     cfence.Say("You got nothing.");
 }
 


But not this bit:

Code: ags

else {
 int i; totalvalue, itemid;
  while (i!= inventorywindow.ItemCount) {
    itemid=inventorywindow.ItemAtIndex[i].ID;
    totalvalue=+inventory[itemid].GetProperty("moneyvalue");
    i++;
  }
cfence.Say("Total value is %d $", totalvalue;);
}
 }


Error:
Failed to save room room1.crm; details below
room1.asc(152): Error (line 152): PE04: parse error at 'totalvalue'

But has accepted this amended script in compiling but error in game:
Code: ags

else {
 int i= totalvalue, itemid;
  while (i!= invCustomInv.ItemCount) {
    itemid=invCustomInv.ItemAtIndex[i].ID;
    totalvalue=inventory[itemid].GetProperty("moneyvalue");
    i++;
  }
cfence.Say("Total value is %d $", totalvalue);
}
 }


  Error: totalvalue=inventory[itemid].GetProperty("moneyvalue");


When this script is correct all i need to do is add to score when a new item is added to inventory..  when you reach the end a condition will check how many points you have and display appropriate text display.

I have created variables called 'moneyvalue and 'totalvalue' and the inventory window name is invCustomInv if that's any use.

cheers for any further help with this

barefoot




#427
Hi Khris,

i understand what you are saying...

This is a new script thing for me and i'm having a little trouble putting it in..

i clicked on the inv window and it says invCustomInv would this be the control dualnames spoke of?

I know its a pain but i don't intend to give in until a solution is found.. and i do thank you for your comments khris.

I will endeavour NOT use different posts.

regards

barefoot
















#428
cheers dualnames

not sure how do the gui controls as suggested and i have put it where the fence talks as per script.

I get:

GlobalScript.asc(1019): Error (line 1019): '.ItemCount' is not a public member of 'GUI'. Are you sure you spelt it correctly (remember, capital letters are important)?

Maybe  im  missing something..

maybe you could elaborate.

cheers dualnames

barefoot

#429
Hi

cheers Dualnames

I have created a global variable called moneyvalue and have set it to Int with value of 0..  I need to work from there...?

I use gInventory as my Inventory window.

Your code does give a bit of an error:

GlobalScript.asc(1018): Error (line 1018): '.ItemCount' is not a public member of 'GUI'. Are you sure you spelt it correctly (remember, capital letters are important)?

Code: ags

function cfence_Talk()
{
cfence.Say("Let's see what you got !");
 if (gInventory.ItemCount==0) {
     cfence.Say("You got nothing.");
 }
 
else {
 int i; totalvalue, itemid;
  while (i!= inventorywindow.ItemCount) {
    itemid=inventorywindow.ItemAtIndex[i].ID;
    totalvalue=+inventory[itemid].GetProperty("moneyvalue");
    i++;
  }
cfence.Say("Total value is %d $", totalvalue;);
}
 }



cheers

barefoot


#430
Cheers skuttleman

every little helps as they say....

Hopefully this topic will be expanded until i get a full result and can implement it into my game..

cheers

barefoot

#431
Hi

I am desperately trying to find a way to resolve a game problem I am having.

I've looked at various ways within my knowledge but not to much avail at the moment.

I still need a way to determine what inventory items the player has and then give the player a total price for what he has... This is done in the Fence Room...

Whatever items the player has the fence will say what he has and give a total price.

Its an 'add up' and a message solution i'm looking for.

Example if the players has Wallet, Credit cards, CD player then the fence may say (after checking what you have) "You have Wallet, Credit cards, CD player" "I'll give you $300"


Could the be done through a points system with each item having  a points value then in the fence room the fence will say something depending on your points total?

Hope you understand and can help me with a solution that is easy to integrate.

cheers for any help

barefoot







 
#432
Cheers Loney Childress

:=

barefoot
#433
Hi

New screenshot (I have tried to get the shadows right.. well, tried)

You enter an arcade hoping to win some money, but beware the bouncer!


Trying to win some cash!



barefoot
#434
WOW great graphics zyndikate...

I could eat my socks... :-\

I'de give my toes to be able to draw/colour like that!!!

Looks a good game...

barefoot

#435
Hi

I am currently in production of: Boy in da hood: Give me the money! Give me the money!

About a young, tough kid setting out to win a $100,000 prize in a grifters contest.

Steal, con and mug your way around town locations to win the prize... But you only have 2 hours!!

** This game is timed!

Can you win?

Grifters contest


Looking to con, steal and mug along Maple Avenue (scroll scene)


Release Expected: April


barefoot

#436
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


#437
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





#438
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


#439
Hi

UPDATE.. No one needed now...

I need a brilliant code scripter to compose and incorporate some script for me.

The game is underway and I need help with the following:

The player goes around getting cash and goods then checksout (can checkout at anytime but only once).

SUMMERY
The ability to check player's inventory, give a price depending on what they have and finally have a final price for what they have... This is all done in the checkout room.

So its a type of Add-up game..

ie

Inv credit cards worth $100
Inv travel ticket worth $100
Inv pearl necklace worth  $500

and so fourth...

I will send a list of items that can be got along with its price for you to add to the script..

Full credit will be given.

cheers for any offers.

barefoot

#440
Hi Khris

I'm a  little stuck with your code.. I do get the gist of it... have you got an easier way of explaining it?

I do have an alternative way, a bit long winded though.

cheers

barefoot
SMF spam blocked by CleanTalk