Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Angelman's Light Tutorial

TLarch

Member

Darn.  Thanks for looking at it though Angelman.

Does anyone know of a way I could accomplish walking with a lantern?
 

TLarch

Member

No no.  I'm trying to get a light source that may be turned off and on in any location, including the dark mines where he is now, preferably by an item.

I'm still poking around with no avail.
 

TLarch

Member

Now this is frustrating.  I put an Add 1 gold right next to the move picture command to see if it was looping the move picture.  My gold skyrockets, but the picture still does not work.
 
TLarch, try this method. I used it in my last game and it works without a problem.

You have to use 3 common events, which I named "Lantern", "Light ON", and "Hero Screen X/Y".

"Lantern", Trigger "None" (called from the inventory)
Code:
@>Conditional Branch: Switch [0001: Light ON] == ON
   @>Control Switches: [0001: Light ON] = OFF
   @>Erase Picture: 1
 : Else
   @>Control Switches: [0001: Light ON] = ON
   @>Show Picture: 1, 'light', Center (Variable [0003][0004]), (100%,100%), 0, Add
 : Branch End

"Light ON", Trigger "Parallel", Condition switch [0001: Light ON]
Code:
@>Move Picture: 1, @1, Center (Variable[0003][0004]), (300%,300%), 150, Add
@>Wait: 1 frame(s)


"Hero Screen X/Y", Trigger "Parallel", Condition switch [0002: Lantern] (turn on this switch when you receive the lantern)
Code:
@>Control Variables: [0003: LanternX] = Player's Screen X
@>Control Variables: [0004: LanternY] = Player's Screen Y

Of course, the switch and variable IDs may be different from yours, but otherwise it should be the same. I put the "control variables" in a separate common event that's always on, which might help fix your problem.
 

TLarch

Member

Thank you Regi, but I have discovered my problem.  I tried the light in a new file and it works perfectly.

The problem is in the my battle script.  Something about Blizz-ABS script interferes with the picture commands. Very uncool, but I guess I'd rather have the ABS battle system than the lantern.

I'd have to figure out how to do it without the pictures I guess, but as for now, I'll write it out of my game, although it is an awesome addition to any game.

Thank you both,
~Trevor
 
TLarch: Well it's good you found the solution to your problem. It's unfortunate though, that you had to choose, but I would have picked the ABS too. :P Good luck in your future endeavors.
 

Jason

Awesome Bro

So both NemanjaT and Gary 10000k have Necroposted, by almost a year, and then by 3-4 months...

Necroposting is bad, don't do it.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top