Pages: 123 »
Posted on 08-18-16, 03:16 pm (rev. 5 by RicBent on 10-04-18, 04:34 pm)
Mariomaster

Karma: 8528
Posts: 623/1681
Since: 06-09-12
Actor/Particle/SFX Spawer Sprite:



https://www.youtube.com/watch?v=9Mt0wu0wO_U
https://www.youtube.com/watch?v=vMJSXnI7Q-Y

This hack allows you to spawn any actor, particle and/or SFX (Soundeffect).

Since the regular amount of sprtedata nybbles is far to less to store the neccessary information I had to choose a more hacky way.
I append all of our custom data to block 14 of the level header (Sprite Sets). This means that we have to use a modded NSMBe.

This hack replaces the defunct actor 22 and will be available by default as sprite 20.



These are the available nybbles of the sprite:



If you leave "Spawn Delay" at 0 and set a "Triggering ID", the sprite will spawn the actor once if you activate the event.
If the event is disabled and activated again, the actor is spawn once more. The first example in the video uses that.

If the "Spawn Delay" is greater than 0 the actor will spawn every X frames while the event is active. If you set the "Triggering ID" to 0 the spawning cycle begins imediatly and lasts forever. That can be seen in the Bob-Omb example in the video.

"Spawn one time cycle later" is only relevant if "Spawn Delay" is set. If it is enabled and the event get's enabled it takes the specified frame count until the actor spawns the first time. The fireworks example uses that since the particles don't appear right after entering the level.

If you want to disable spawning an actor/particles/sfx you can set that by enablig the respective checkbox.


As you can see there is another field: "Settings ID".

These can be set by opening the "Actor Spawner Settings" dialog in the modded NSMBe. In the toolbar click on the yellow block.

You will see this dialog:



Just select what you want to spawn and remember the ID on the left side and put that into your sprite 20 as "Settings ID".
Remember that the selected actor has to be enabled in the sprite sets and the specified sfx has to be available in the used sound set.



https://nsmbhd.net/file/VJlLIYigo02gRRjE/ActorSpawner.tar.gz

In the compressed folder you find the modded NSMBe and the necessary files for the ASM patch template.



Thanks to  Arisotura for the Sprite100 hack which I used as a base.
Thanks to  skawo for the documentations of the particles and SFXes.

Please post any unknown particle/sfx ids you find here.
Have fun!
_________________________
GitHub - Kuribo64 - YouTube
Posted on 08-18-16, 03:20 pm
I Am Not Inteligent

Karma: 979
Posts: 165/380
Since: 03-04-14
Take all my +1's, please! I was literally fangirl-screaming when I watched your videos. This is SO AMAZING!!
Posted on 08-18-16, 03:58 pm


Karma: 19752
Posts: 581/1100
Since: 04-02-13
Something fun: Spawning actor 21 ends your game.

Which is weird, as placing a sprite with that actor into the level just crashes.
Posted on 08-18-16, 05:35 pm
Birdo


Karma: 2754
Posts: 1740/2091
Since: 06-26-11
Posted by skawo
Something fun: Spawning actor 21 ends your game.

Which is weird, as placing a sprite with that actor into the level just crashes.

I thought sprite 21 was the player actor. What actor did you spawn to create the player clones in your "science" video?
Posted on 08-18-16, 07:35 pm
Mariomaster

Karma: 8528
Posts: 624/1681
Since: 06-09-12
It is. Probably Nintendo Codeders had fun doing this
_________________________
GitHub - Kuribo64 - YouTube
Posted on 08-18-16, 07:48 pm (rev. 1 by  Hiccup on 08-18-16, 07:50 pm)
Birdo


Karma: 2754
Posts: 1741/2091
Since: 06-26-11
So I guess there are different actor spawn methods that produce different results?

Also, can you make this part of the official nsmbe code?
Posted on 08-18-16, 08:08 pm
Mariomaster

Karma: 8528
Posts: 625/1681
Since: 06-09-12
No, since the original NSMB hasn't this hack applied.

I don't want to cause millions of posts with "OMG THIZ EDITOR IS CRAP. ACTOR SPAANER NOT WORKING!!1 lol"
_________________________
GitHub - Kuribo64 - YouTube
Posted on 08-18-16, 08:10 pm
Birdo


Karma: 2754
Posts: 1742/2091
Since: 06-26-11
You could make it disabled by default with a warning message, but anyway.
Posted on 08-18-16, 09:17 pm
Mariomaster

Karma: 8528
Posts: 626/1681
Since: 06-09-12
Updated to code to make it work with all 64 activator IDs.

If you already have it downloaded redownload.
_________________________
GitHub - Kuribo64 - YouTube
Posted on 08-20-16, 11:04 am
Birdo


Karma: 2754
Posts: 1745/2091
Since: 06-26-11
Could you add support for spawning tiles, like the tile god? Currently you need to use this in conjunction with the ASM-improved tile god for tile spawning with any effect/sound.
Posted on 08-20-16, 12:12 pm
Mariomaster

Karma: 8528
Posts: 629/1681
Since: 06-09-12
Creating/Destroying tiles is compleatly unrelated to this sprite.
_________________________
GitHub - Kuribo64 - YouTube
Posted on 08-20-16, 01:06 pm (rev. 2 by  skawo on 08-20-16, 01:06 pm)


Karma: 19752
Posts: 585/1100
Since: 04-02-13
I could update my tilegod hack to use the particle/sound values from these fields, though.

Should I?
Posted on 08-20-16, 01:14 pm (rev. 2 by  Hiccup on 08-20-16, 05:07 pm)
Birdo


Karma: 2754
Posts: 1749/2091
Since: 06-26-11
You are probably asking Mariomaster... but I think thats a good idea - even if it is duplicated code it gets rid of the need to use two sprites on top of each other if you just want to spawn a tile with any effect/SFX.

Though the best case scenario would be a single sprite that can spawn any tile specified in the new header section, as well as being able to spawn an actor, particle effect and SFX.
Posted on 08-23-16, 10:41 am (rev. 1 by  Hiccup on 08-23-16, 10:41 am)
Birdo


Karma: 2754
Posts: 1754/2091
Since: 06-26-11
@Mariomaster
I was wondering if actor 22, the one you used for this, had any code at all before you "added to it"/"overwrote it".
Posted on 08-23-16, 10:45 am


Karma: 19752
Posts: 593/1100
Since: 04-02-13
All it has are the destructor and constructor, which do pretty much nothing in particular before freeing the memory they used.
Posted on 08-23-16, 10:59 am (rev. 6 by  Hiccup on 08-23-16, 11:28 am)
Birdo


Karma: 2754
Posts: 1755/2091
Since: 06-26-11
Three more questions:
1. Why doesn't it have support for nybbles 1-4? That way you can use skawo's "Actor Spawning ? Block" to spawn actors that require events to be visible or to activate events
2. Could you add a despawning feature?
3. Where does the Actor Spawner get the sound/particle IDs?

Also, here is a start to a SFX table - on the wiki so anyone can edit (™)
http://nsmbhd.net/wiki/Actor_Spawner_SFX/
Posted on 08-23-16, 11:45 am (rev. 1 by RicBent on 08-23-16, 11:47 am)
Mariomaster

Karma: 8528
Posts: 644/1681
Since: 06-09-12
1. Those event nybbles are not sprite data. I have not found how to set those for an actor yet.

2. Theoretical yes. I think crateActor returns the pointer to the created actor. On that pointer I could call Base__deleteIt. I don't see many usefull reasons to add a feature like that tho.

3.
Posted by Mariomaster
Since the regular amount of sprtedata nybbles is far to less to store the neccessary information I had to choose a more hacky way.
I append all of our custom data to block 14 of the level header (Sprite Sets).

_________________________
GitHub - Kuribo64 - YouTube
Posted on 08-23-16, 11:57 am


Karma: 19752
Posts: 594/1100
Since: 04-02-13
1. Can't you just write to [sprite] + 0x334?
Posted on 08-23-16, 12:03 pm
Birdo


Karma: 2754
Posts: 1756/2091
Since: 06-26-11
@Mariomaster
1. I guess they are a special kind of sprite data. Could you add a feature that lets you activate event(s) when an Actor Spawner Settings ID is activated (so I can use skawo's Actor Spawning ? Block to activate events)
2. To remove actors like you can remove tiles with the tile god. E.g. destroy an arrow sign as well as the ground it is standing on
3. I meant "where does the game look up the numbers you specify?"
Posted on 08-23-16, 12:49 pm
Mariomaster

Karma: 8528
Posts: 645/1681
Since: 06-09-12
Posted by Hiccup
3. I meant "where does the game look up the numbers you specify?"


The header blocks are loaded compleatly into memory.

0x0208B19C holds the offset to block 14 when a level is loaded.
_________________________
GitHub - Kuribo64 - YouTube
Pages: 123 »