Jump to content

Photo

Simple Candle Script


  • Please log in to reply
28 replies to this topic

#1 Jared

Jared

    Deified

  • Members
  • Real Name:Jared
  • Pronouns:He / Him
  • Location:New Hampshire

Posted 29 December 2020 - 03:59 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
  • Location:Alabama

Posted 29 December 2020 - 04:12 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 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 29 December 2020 - 05:06 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

    Deified

  • Members
  • Real Name:Jared
  • Pronouns:He / Him
  • Location:New Hampshire

Posted 29 December 2020 - 06:01 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 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 29 December 2020 - 06:20 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

    Deified

  • Members
  • Real Name:Jared
  • Pronouns:He / Him
  • Location:New Hampshire

Posted 29 December 2020 - 07:06 PM

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



#7 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 29 December 2020 - 07:22 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

    Deified

  • Members
  • Real Name:Jared
  • Pronouns:He / Him
  • Location:New Hampshire

Posted 29 December 2020 - 08:03 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
  • Location:Alabama

Posted 29 December 2020 - 09:08 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

    Deified

  • Members
  • Real Name:Jared
  • Pronouns:He / Him
  • Location:New Hampshire

Posted 29 December 2020 - 09:31 PM

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



#11 Mitchfork

Mitchfork

    no fun. not ever.

  • Members
  • Real Name:Mitch
  • Location:Alabama

Posted 29 December 2020 - 11:00 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

    Deified

  • Members
  • Real Name:Jared
  • Pronouns:He / Him
  • Location:New Hampshire

Posted 16 February 2021 - 10:04 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 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 18 February 2021 - 01:22 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 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 18 February 2021 - 11:16 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

    💛

  • Members

Posted 18 February 2021 - 01:24 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