Chaos Project

RPG Maker => Event Systems => Topic started by: toni112007 on October 10, 2012, 02:35:27 pm

Title: Oil system and oil item.
Post by: toni112007 on October 10, 2012, 02:35:27 pm
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?
Title: Re: Oil system and oil item.
Post by: Zexion on October 10, 2012, 03:34:06 pm
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.
Title: Re: Oil system and oil item.
Post by: toni112007 on October 11, 2012, 06:18:22 am
I would like that oil drains when im using lantern so that means while L button is pressed.
Title: Re: Oil system and oil item.
Post by: Calintz on October 11, 2012, 03:49:23 pm
i would help if Zexion hadn't come around :P. this is a simple system. good luck you two.
Title: Re: Oil system and oil item.
Post by: Zexion on October 11, 2012, 06:27:32 pm
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 (http://www.gamefront.com/files/22440072/Lantern+Demo.exe).
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.
Title: Re: Oil system and oil item.
Post by: Calintz on October 11, 2012, 11:30:12 pm
if that system works for you, don't forget to power up Zexion. ;)
Title: Re: Oil system and oil item.
Post by: toni112007 on October 12, 2012, 06:52:14 am
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.
Title: Re: Oil system and oil item.
Post by: toni112007 on October 12, 2012, 07:58:05 am
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?
Title: Re: Oil system and oil item.
Post by: diagostimo on October 12, 2012, 08:01:36 am
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