Age
43
Gender
Male
Location
ireland
hi i want my charcter to enter shop
1 move mouse pointer over shop items display item and price
2 player has 100 coins buy item money decreases until no money left
i have looked at the rpg inventory tutorial way to complicated for what i need.
i need something simple could you help?
thanks
this is great sorry for the delay in replying. no time at the minute but ill try this later on.
thanks
oh and what is a global counter and how to i set one up i havent done anything like this before so i need your help.
thanks again for your patience.
A global counter is a special type of counter because it keeps its value throughout frames. Normal counters may be useful in the first frame, but in the second frame there is no need for them.
For example, if you got money on Level 1 it might set your global counter to 100. Then on Level 3 you could spend some of the money you earned in level 1. So, a global counter can be a part of more than 1 frame.
To make a global counter you put a normal counter into a frame. If you click on it you see its properties. Under RunTime Options there is a box for "Global Object". If you check the box your counter will become a global counter.
Once you have your global counter you can copy (ctrl + c) and paste (ctrl + v) the counter into all of the frames that need it. If you set the counter to 20 in Frame 1, it will still be 20 in Frame 2.
thamks now i understand. im wondering i was planing on not showing score or level instead i plan on having a seperate frame and this frame would be a stats frame coins collected score secerts found.
i think now i will need a global counter to do this too?
one other thing. i have used this my enemys all have the varible health which is set to a different amount for each of them :
enemy alt varible health = 0 destroy enemy
last enemy has been destroyied add to score 150.
and most times mmf did not catch this so i added:
always
enemy alt varible health = 0 destroy enemy this helped but some slipped through.
how do i make sure that every time the enemys health = 0 the enemy stays dead. would a fastloop help?
You could use a global value instead of a global counter. Yes, use a global values for your first question. If you want it to be a pause screen, then I would advise use of a modal sub-application from a different frame.
I don't know what's happening in your second problem, but always won't help. Are there any other conditions? And where do you set the value? Try saying if the enemies health is less than or equal to zero.
Yup, less than or equal to zero would work. The enemy's health isn't zero; it's a negative number. Say that the enemy has 150 health. If each attack does 50 damage 3 attacks kill it. But if the enemy has 140 health 3 attacks will give it -10 health.
Another option is whenever the enemy has less than 0 health you could set the health to 0.
Yes, that's what I thought. I made that error countless times.
thanks watermelon problem solved
1.)
First you have to make a box for the price. Like, a small box that tells you the price. This is what the player will see when he wants to buy something. When the mouse pointer is over what you are trying to buy, you have to set the small box to a certain position, like right next to the item. Do this for all of the items, of course, with different boxes for the different prices. When the mouse is not over any of the objects (you need to negate the events in the condition) all of the price boxes should be outside of the frame. So when the mouse goes over one object, the right price will come up. When the mouse is not over an item no price will come up.
2.)
The amount of coins has to be a global counter. Say you have an item that is 40 coins. If the global counter is 40 or more and you click on the item, the item will be added to your inventory. If the global counter is not 40 or more you will not have enough money to buy the item. When you do buy the item one of the items should be to subtract 40 from the global counter, or however much the item costs.
If anything is unclear I can make an example.