Author Topic: Oil system and oil item.  (Read 1926 times)

Offline toni112007

  • Trained Member
  • *
  • Posts: 20
  • LV: 0
    • View Profile
Oil system and oil item.
« on: October 10, 2012, 08: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?

Offline Zexion

  • Addicted to LoL
  • Chaos User
  • ******
  • Posts: 1509
  • LV: 69
  • Gender: Male
  • My anaconda don't...jk it does
    • View Profile
Re: Oil system and oil item.
« Reply #1 on: October 10, 2012, 09: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.

Offline toni112007

  • Trained Member
  • *
  • Posts: 20
  • LV: 0
    • View Profile
Re: Oil system and oil item.
« Reply #2 on: October 11, 2012, 12:18:22 PM »
I would like that oil drains when im using lantern so that means while L button is pressed.

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
Re: Oil system and oil item.
« Reply #3 on: October 11, 2012, 09:49:23 PM »
i would help if Zexion hadn't come around :P. this is a simple system. good luck you two.

Offline Zexion

  • Addicted to LoL
  • Chaos User
  • ******
  • Posts: 1509
  • LV: 69
  • Gender: Male
  • My anaconda don't...jk it does
    • View Profile
Re: Oil system and oil item.
« Reply #4 on: October 12, 2012, 12:27:32 AM »
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.
« Last Edit: October 12, 2012, 02:05:38 AM by Zexion »

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
Re: Oil system and oil item.
« Reply #5 on: October 12, 2012, 05:30:12 AM »
if that system works for you, don't forget to power up Zexion. ;)

Offline toni112007

  • Trained Member
  • *
  • Posts: 20
  • LV: 0
    • View Profile
Re: Oil system and oil item.
« Reply #6 on: October 12, 2012, 12:52:14 PM »
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.

Offline toni112007

  • Trained Member
  • *
  • Posts: 20
  • LV: 0
    • View Profile
Re: Oil system and oil item.
« Reply #7 on: October 12, 2012, 01:58:05 PM »
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?

Offline diagostimo

  • Ethereal Devastator
  • ****
  • Posts: 257
  • LV: 20
    • View Profile
Re: Oil system and oil item.
« Reply #8 on: October 12, 2012, 02:01:36 PM »
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