Pages: 1
Posted on 08-19-16, 03:31 pm (rev. 15 by ImageBot on 11-21-16, 03:23 am)


Karma: 19757
Posts: 582/1100
Since: 04-02-13
Actor Spawning Block:
repl_0209C1B8_ov_00: STR R3, [SP,#4] CMP R0, #0x29 BXNE LR LDR R0, =0x0208B19C LDR R0, [R0] STMFD SP!, {R1-R5,LR} MOV R3, #0x1000 MOV R5, #0 LDR R4, [R2,#0x4] LDRB R1, [R0,#0x12] CMP R1, #0x0 BEQ .YOffs CMP R1, #0x7F BLLS .positive LDRB R1, [R0,#0x12] CMP R1, #0x7F BLHI .negative STR R4, [R2,#0x4] .YOffs: LDRB R1, [R0,#0x13] CMP R1, #0x0 ITTT NE LDRB R1, [R0,#0x1B] CMP R1, #0x0 BEQ .return BL getPtrToPlayerActor LDRB R5, [R0, #0x76C] CMP R5, #0x15 MOVEQ R5, #1 CMP R5, #0x10 MOVEQ R5, #1 LDR R0, =0x0208B19C LDR R0, [R0] LDR R4, [R2,#0x8] CMP R5, #1 LDREQB R1, [R0,#0x1B] CMPEQ R1, #0x0 BEQ .return CMP R5, #1 SUBNE R4, R4, #0x12000 ADDEQ R4, R4, #0x12000 CMP R5, #1 BEQ .down .up: LDRB R1, [R0,#0x13] CMP R1, #0x7F BLLS .positive LDRB R1, [R0,#0x13] CMP R1, #0x7F BLHI .negative STR R4, [R2,#0x8] B .return .down: LDRB R1, [R0,#0x1B] CMP R1, #0x7F BLLS .positive LDRB R1, [R0,#0x1B] CMP R1, #0x7F BLHI .negative STR R4, [R2,#0x8] .return: LDMFD SP!, {R1-R5,LR} LDR R1, [R0,#0x14] LDRH R0, [R0,#0x10] BX LR .positive: MUL R1, R3, R1 ADD R4, R4, R1 BX LR .negative: MVN R1, R1 LSL R1, #0x18 LSR R1, #0x18 SUB R1, #1 MUL R1, R3, R1 SUB R4, R4, R1 BX LR repl_020D0468_ov_0A: LDR R0, =0x0208B19C LDR R0, [R0] LDRH R0, [R0,#0x1C] BX LR repl_020D0420_ov_0A: STR R2, [SP,#0x18] LDR R0, =0x0208B19C LDR R0, [R0] LDRH R0, [R0, #0x18] CMP R0, #0x76 BEQ 0x020D0424 BNE 0x020D043C


This is an addition to the wonderful Actor Spawner Sprite by Mariomaster. Essentially, what this will do, is make the Boo Spawning Question Block spawn the enemy with Settings ID = 0, complete with spritedata, sound effect and particle. The X/Y offset fields are also supported: The "X offset" field applies to both when Mario hits the block from underneath and if he groundpounds it. However, the "Y Offset" field applies only when Mario pounds the block upward. If it's groundpounded, the actor will be offset by the "Y Particle Offset" field instead; this allows you to perfectly place the actor.

What this means is; you can spawn any sprite out of the block, be it a Star Coin, Goomba or Spiny.

The sprite you're spawning needs to appear in the level in order to actually load the model/sprite it's using. Easiest way to ensure this is to place one right below Mario's starting point, just slightly out of zone. And, obviously, sprite sets need to have this enemy enabled.

Note that every time you used the block in the game previously will need to have Settings ID = 0 set to this:


...in order to work like it used to.

Short video demonstration:

Posted on 08-19-16, 04:17 pm
Fuzzy
Will never finish a hack

Karma: 1843
Posts: 226/778
Since: 03-25-16
Does beating Bowser Jr in that level beat the level? Or does it just exit to worldmap?
_________________________
hey look, I did a thing
Posted on 08-19-16, 04:19 pm


Karma: 19757
Posts: 583/1100
Since: 04-02-13
Probably the former, but I'm too lazy to try.
Posted on 08-22-16, 03:43 pm
Panser
I AM DERP INCARNATE

Karma: 503
Posts: 18/328
Since: 08-20-16
Could you make it support the offset values? I want my Star Coins to spawn ON TOP of the block, not on the side...
rip signature
Posted on 08-22-16, 06:23 pm
Birdo


Karma: 2754
Posts: 1750/2091
Since: 06-26-11
Posted by MarioKart7z
Could you make it support the offset values? I want my Star Coins to spawn ON TOP of the block, not on the side...

Also, it'd be good if there was a version of the code that spawns a different number for when you ground pound the block (so you could spawn something going down instead of up).
Posted on 08-22-16, 06:51 pm


Karma: 19757
Posts: 590/1100
Since: 04-02-13
There, that should do it. The code is not very space-efficient, but whatever.
Posted on 08-22-16, 07:14 pm
Birdo


Karma: 2754
Posts: 1752/2091
Since: 06-26-11
What exactly did you change?
Posted on 08-22-16, 08:29 pm (rev. 5 by  skawo on 08-22-16, 08:38 pm)


Karma: 19757
Posts: 591/1100
Since: 04-02-13
Well, I changed it again, just now. What it does now is this:

If either X, Y offset or Y particle offset fields are 0, the game will just use the normal position it uses for the Boo in game.

If X Offset is not 0, it will add the X offset to the position.
If Y Offset or Y particle offset is not 0, it will check if Mario is groundpounding or not.

If he isn't, it will add the Y offset to the block's Y position (NOT the position value the game used for the Boo!), letting you move the sprite spawn point upward if it's bonked from underneath.

If he is, it will add the Y particle offset to the block's Y position, letting you move the sprite spawn point downward if it's groundpounded (meaning, you'll probably want this offset to be negative).
Posted on 08-23-16, 10:08 am (rev. 1 by  Hiccup on 08-23-16, 10:08 am)
Birdo


Karma: 2754
Posts: 1753/2091
Since: 06-26-11
That is an improvement, but what I was asking for was a version of the code that spawns a different number for ground-pounding, so you can have different sprite data or actor for when it is ground-pounded
Posted on 08-23-16, 10:34 am


Karma: 19757
Posts: 592/1100
Since: 04-02-13
Alright, if you want that, cut out
LDMFD SP!, {R1-R5,LR} LDR R1, [R0,#0x14] LDRH R0, [R0,#0x10]
from ".return:"

and paste it just before
B .return
in ".up"

Then, put this at the very end of ".down:"
LDMFD SP!, {R1-R5,LR} LDR R1, [R0,#0x24] LDRH R0, [R0,#0x20]

That will spawn ID 1 on groundpounds.
Posted on 09-06-16, 10:19 pm (rev. 1 by ImageBot on 11-21-16, 03:23 am)


Karma: 1064
Posts: 169/200
Since: 02-02-15
Spawning Actors/Sprites using blocks

This test have aims to spawn with Mario Master's Spawner Sprite, some actors/sprites using the improved code implemented by master Skawo.

The test pop-up 4 (four) actors/sprites, while player pass through a Bonus Room level.:

- 1 Buzzy Bettle Shell
- 1 Turtle Shell
- 1 Piranha Plant
- 1 Brozzer (using a ground pound maneuver)

Testing Actor/Sprite Spawner [20] with Blocks

Youtube: 1 minunte and 30 seconds


It works!

Related Posts:
- simple Spawn examples: (1) (2)
- simple Despawn examples: (1) (2)

[] -P

Posted on 09-09-16, 04:06 am
Fuzzy
That MvL Hacker

Karma: 1599
Posts: 78/789
Since: 04-11-15
pinet, how did you get multiple enemies from multiple blocks if you can only use ID=0
_________________________
Here's my MvL Hacking thread

Consider joining the NSMB DS Hacking Discord Server!

#HakingNoMore
Posted on 09-09-16, 12:42 pm
Birdo


Karma: 2754
Posts: 1857/2091
Since: 06-26-11
Multiple areas.
Posted on 09-09-16, 02:49 pm
Panser
I AM DERP INCARNATE

Karma: 503
Posts: 95/328
Since: 08-20-16
Posted by Hiccup
Multiple areas.

Watch the video; the 2 spawner blocks are fairly close to each other. And there's no transition between them. You can't have multiple areas without a transition between them...
rip signature
Posted on 09-09-16, 02:55 pm
Birdo


Karma: 2754
Posts: 1858/2091
Since: 06-26-11
Oh yeah. I don't know, maybe he modified the code of this or the actor spawner?
Posted on 09-09-16, 05:24 pm


Karma: 19757
Posts: 662/1100
Since: 04-02-13
I think he's spawning enemies using the Actor Spawner itself, not this.
Posted on 09-09-16, 05:45 pm
Birdo


Karma: 2754
Posts: 1860/2091
Since: 06-26-11
I guess using an IF controller zone under the blocks?

@pinet
Enlighten us
Pages: 1