Oil system and oil item.

Started by toni112007, October 10, 2012, 02:35:27 pm

Previous topic - Next topic

toni112007

This one is hard and i havent found any good tutorial...
so i need for your help
i need Oil system.I have made Lantern system like this:
1).I made Lantern Item which is not consumable but it links to common event Lantern
2).I made common event Lantern which looks like this:
Conditional brancH: L button is being pressed.
@>change actor graphic: (daniel),light,0,,0 -this changes actor graphic to have lantern in hand.
@>Show animation: Player , [light] -this is animation for lantern light
@>wait:17 frames.
: Else
@>wait:5 frames
@>Change actor graphic : (Daniel),107-civillian07,0,,0 -changes back to normal.
Branch end.
3.)I made sound of lanter again as conditional branch
4.)and finnaly i made conditional branch event as parallel process
when lantern is inventory it triggers lantern switch works.

SO from this now i need to make Oil system,someone told me with timer,but i dont know how to do...
I need 2 things:
1.When Lantern is on (while L button pressed) oil is draining
2.Oil item.
can anyone help?

Zexion

This seems easy, but I just have a question before I give it a whirl.
Did you want it so the lantern is:
A) On only while pressing the button.
or
B) On after they press a button (and let go).

Would also have to press the button to stop the process.

toni112007

I would like that oil drains when im using lantern so that means while L button is pressed.

Calintz

i would help if Zexion hadn't come around :P. this is a simple system. good luck you two.

Zexion

October 11, 2012, 06:27:32 pm #4 Last Edit: October 11, 2012, 08:05:38 pm by Zexion
I'm putting together a small demo for you as we speak with lots of comments for you to learn. I'm going to get something to eat real quick and come back and finish it up its about half done.

Edit:
Here's the download.
Just hold the Q button (rmxp's default L button) and pretend that the guy is holding a lantern. (I don't have a graphic, so I just changed his hue.)
It might not look like anything much is happening, but the oil is draining and you will notice the HUD (optional) drain as well.

I thought about problems with an evented system like this, and you might have to turn off the switch during cutscenes so that they cannot press the lantern button (unless you don't mind). Otherwise, everything is highly explain in the event comments.

Calintz

if that system works for you, don't forget to power up Zexion. ;)

toni112007

It rocks! but i wanted to make oil item...so you can have more oil items in item menu
end when you press them or by some key your oil gets replenished.

toni112007

i messed whole my game xD

Now my Lantern sound does not happen,it used to trigger lantern sound when press L button...i had lantern sound in common events
but it does not work now...it only works when lantern oil is out.how to fix this? do you want my whole project to send you on email? to fix it?

diagostimo

that is easy, just get your item to call a common event when used, in the common event get it to set the variable that is the lamps oil back to full, you could also condition it to check if the lamp is full, if its full show text: lamp is full no need to fill it, so something like this:

condition branch: variable[001] == 100 #or whatever variable your using and whatever value is full
 Show text: lamp is full
else
 remove item: lamp oil
 set variable to full
end

then just set the item to non consumable, the event will manage to remove it or not