Jump to content

Photo

Simple Candle Script


  • Please log in to reply
28 replies to this topic

#1 Jared

Jared

    Bring back what once was mine, what once was mine.

  • Members
  • Real Name:Jared
  • Gender:Male
  • Location:Massachusetts

Posted 29 December 2020 - 02:37 PM

Hi all,

 

I just wanted a simple candle/lantern script where:

 

1. Link uses the candle and it shows up in front of him

2. Only lights the block in front of him (Half of a space between him and the fire so you can see Link using the sprite)

 

Here are the candle sprites at the bottom, up/down and left/right respectively.

 

hRyQsrF.png

 

I can be reached here or on Discord. Jared#1627. If anyone could do this I'd be grateful, thank you!



#2 Mitchfork

Mitchfork

    no fun. not ever.

  • Members
  • Real Name:Mitch
  • Gender:Male
  • Location:Alabama

Posted 29 December 2020 - 02:50 PM

So to be clear - you don't want any kind of flame sprite to appear?  You just want it to look like Link holds out the candle in front of him and if there's a burn trigger 8 pixels away, light it.  Do you want the candle to do damage?

 

I have a candle script that I use where Link actually swipes the candle like a sword.  It does some other things that it sounds like you don't want to do but that would be easy to remove from the script.

 

Do you want a blue candle limitation on uses?



#3 Venrob

Venrob

    Scripter / Dev

  • ZC Developers
  • Real Name:Rob
  • Gender:Male

Posted 29 December 2020 - 03:44 PM

I believe he wants the fire, but, to just appear, 8 pixels away from the front of Link?


  • Jared likes this

#4 Jared

Jared

    Bring back what once was mine, what once was mine.

  • Members
  • Real Name:Jared
  • Gender:Male
  • Location:Massachusetts

Posted 29 December 2020 - 04:39 PM

Yes, I'm sorry if that was unclear! I want the candle effect and sprite to appear like the regular candle built into the engine.

 

Swiping would be cool, but I don't think I need that. No limitations, no.

 

Rob got it right on the dot.



#5 Venrob

Venrob

    Scripter / Dev

  • ZC Developers
  • Real Name:Rob
  • Gender:Male

Posted 29 December 2020 - 04:58 PM

#option HEADER_GUARD on
#include "std.zh"
#include "VenrobMisc.zh"
lweapon script simpleCandle
{
	using namespace Venrob;
	void run()
	{
		this->X = Hero->X + dirX(Hero->Dir) * 24;
		this->Y = Hero->Y + dirY(Hero->Dir) * 24;
		this->Step = 0;
	}
}

Try this. You'll need my VenrobMisc.zh. (you can just put it in your 'include' or 'headers' folder).

To use, just attach the lweapon script to an engine candle. That's it.


  • Jared likes this

#6 Jared

Jared

    Bring back what once was mine, what once was mine.

  • Members
  • Real Name:Jared
  • Gender:Male
  • Location:Massachusetts

Posted 29 December 2020 - 05:44 PM

Looking at the script, does this include the candle sprite I want to show up? Otherwise it looks perfect.



#7 Venrob

Venrob

    Scripter / Dev

  • ZC Developers
  • Real Name:Rob
  • Gender:Male

Posted 29 December 2020 - 06:00 PM

It'd use whatever the engine candle you attach it to is set to use.

In effect, you are just using an engine candle, but it forces the fire to appear where you specified, and sit still.



#8 Jared

Jared

    Bring back what once was mine, what once was mine.

  • Members
  • Real Name:Jared
  • Gender:Male
  • Location:Massachusetts

Posted 29 December 2020 - 06:41 PM

It'd use whatever the engine candle you attach it to is set to use.

In effect, you are just using an engine candle, but it forces the fire to appear where you specified, and sit still.

 

I think you misinterpreted what I meant lol. I want a sprite to appear in front of Link as well, kind of like how you see the sword waved in front of Link.



#9 Mitchfork

Mitchfork

    no fun. not ever.

  • Members
  • Real Name:Mitch
  • Gender:Male
  • Location:Alabama

Posted 29 December 2020 - 07:46 PM

Oh, gotcha - I don't even think you need anything except for Venrob's script then.

 

4cf47c4860.png

 

You can set up these fields with sprites - "Red Candle Stab" would be the second tile on the last row of the tile page in your OP - and the engine will draw the candle for you.  Venrob's script will keep the candle flame from moving.


  • Jared and Bagu like this

#10 Jared

Jared

    Bring back what once was mine, what once was mine.

  • Members
  • Real Name:Jared
  • Gender:Male
  • Location:Massachusetts

Posted 29 December 2020 - 08:09 PM

Oof, I'm a doofus. It worked! Thanks guys :)



#11 Mitchfork

Mitchfork

    no fun. not ever.

  • Members
  • Real Name:Mitch
  • Gender:Male
  • Location:Alabama

Posted 29 December 2020 - 09:38 PM

Oof, I'm a doofus. It worked! Thanks guys :)

No worries - I literally learned about this feature because I looked into it after you posted this topic haha.


  • Jared likes this

#12 Jared

Jared

    Bring back what once was mine, what once was mine.

  • Members
  • Real Name:Jared
  • Gender:Male
  • Location:Massachusetts

Posted 16 February 2021 - 08:42 PM

I figured I'd post this in the same thread, since the request was similar.

 

I want a bow sprite to appear when using the bow, similar to ALttP. It doesn't have to be anything snazzy, but I would like to be able to control the pixels to make it perfectly aligned to his hands, facing all four directions. 

 

I am using 2.55 Beta 85. Any questions please ask me! Thanks so much.


  • Shane likes this

#13 ZoriaRPG

ZoriaRPG

    The Timelord

  • ZC Developers
  • Gender:Unspecified
  • Location:Prydon Academy

Posted 18 February 2021 - 12:00 AM

To ensure that you can only use it once per screen, I create a dummy weapon with no collision and an eternal lifespan; then, if that weapon exists, cancel the candle flame.



#14 Venrob

Venrob

    Scripter / Dev

  • ZC Developers
  • Real Name:Rob
  • Gender:Male

Posted 18 February 2021 - 09:54 AM

To ensure that you can only use it once per screen, I create a dummy weapon with no collision and an eternal lifespan; then, if that weapon exists, cancel the candle flame.

Why would you need that with my script? That uses the engine to create the flame. So, if the candle can normally only be used once per screen, that would still apply. The script does not create any weapons, only modifying the one created by the engine.



#15 P-Tux7

P-Tux7

    Illustrious

  • Members

Posted 18 February 2021 - 12:02 PM

I figured I'd post this in the same thread, since the request was similar.

 

I want a bow sprite to appear when using the bow, similar to ALttP. It doesn't have to be anything snazzy, but I would like to be able to control the pixels to make it perfectly aligned to his hands, facing all four directions. 

 

I am using 2.55 Beta 85. Any questions please ask me! Thanks so much.

Can't you make a "Wand" that looks like a bow, make it sound like one, disable the harmfulness of the rod, and its combo/enemy defenses are set to arrows/silver arrows? King Aquamentus was able to make a Bait item that triggers Stomp Boots combos and enemy defenses, for instance (the pickup item looking like a bag, and the laid-down bait looking like magic powder).




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users