Building a boss from scratch

This is the place for discussion and support for LunaLua and related modifications and libraries.

Moderator: Userbase Moderators

Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on topic/appropriate?
-Are you posting in the right forum/following the forum rules?
King of GETs
Hoopster
Hoopster
Posts: 48
Joined: Sat Jan 16, 2016 8:17 pm

Building a boss from scratch

Postby King of GETs » Mon Aug 28, 2017 5:45 am

So I'm been playing around with LunaLua, and I've got a good amount of code down. There are some basic principles I need to figure out:

1. I need to spawn a block (anything -- lava, ground, etc.), but more importantly, I need to be able to DESPAWN that specific block. I've looked up codes for spawning objects, but every time I try to despawn it, it doesn't work, so help with this would be appreciated. Would I have to attach something to a spawned block to make it despawn, or could I despawn every single block of the same type with a single code?
2. I need to spawn a NEW block that has no hit detection and cannot damage the player. I could repurpose a background object for this if it's too risky to create something completely new. When Mario/Luigi hits this block with a hammer, it has to decrease a variable down by one. The specific hammer can only damage the boss one time, and after it does damage, it despawns.
3. I need to be able to change the X and Y coordinates of both of these blocks either through manual input or through speed modification. Such as, if A = 1, this object is now at this position; if A = 2, it's now here, and so on.

I'm actually not sure how complicated the coding would be for these, so if it's something not possible in LunaLua or requires a wall of coding, please let me know. Also, if there are some help pages somewhere that already cover some of these in-depth, please link me to them.

The0x539
Eerie
Eerie
Posts: 751
Joined: Fri Jan 22, 2016 8:02 pm

Re: Building a boss from scratch

Postby The0x539 » Mon Aug 28, 2017 6:46 am

1. There's CURRENTLY no way to keep a specific block reference valid across ticks. However, blocks do have a remove method, so you can use that, and when you spawn the block you can set the block's layer name to something unique, which is a decent enough way to reference it later on.

2. Use a BGO or a collider, or something of that sort.

3. Only NPCs, layers, particle effects, and players (maybe BGOs?) have a concept of "speed", meaning a displacement that gets applied each tick by vanilla logic.

I get the impression that you might be going about this in a not-so-great way, but without more details I can't quite discern what, other than relying too much on vanilla rather than going, as it were, "pure Lua".

King of GETs
Hoopster
Hoopster
Posts: 48
Joined: Sat Jan 16, 2016 8:17 pm

Re: Building a boss from scratch

Postby King of GETs » Tue Aug 29, 2017 3:42 am

The0x539 wrote:1. There's CURRENTLY no way to keep a specific block reference valid across ticks. However, blocks do have a remove method, so you can use that, and when you spawn the block you can set the block's layer name to something unique, which is a decent enough way to reference it later on.

2. Use a BGO or a collider, or something of that sort.

3. Only NPCs, layers, particle effects, and players (maybe BGOs?) have a concept of "speed", meaning a displacement that gets applied each tick by vanilla logic.

I get the impression that you might be going about this in a not-so-great way, but without more details I can't quite discern what, other than relying too much on vanilla rather than going, as it were, "pure Lua".
Yeah, I'm just experimenting with things right now trying to create something that has never been done before. I've got an unorthodox way of going about things as I have limited programming knowledge and "do things as I learn how to do them" while also trying to keep it fun to play. Thanks for your help.

The0x539
Eerie
Eerie
Posts: 751
Joined: Fri Jan 22, 2016 8:02 pm

Re: Building a boss from scratch

Postby The0x539 » Tue Aug 29, 2017 10:09 am

King of GETs wrote:
The0x539 wrote:1. There's CURRENTLY no way to keep a specific block reference valid across ticks. However, blocks do have a remove method, so you can use that, and when you spawn the block you can set the block's layer name to something unique, which is a decent enough way to reference it later on.

2. Use a BGO or a collider, or something of that sort.

3. Only NPCs, layers, particle effects, and players (maybe BGOs?) have a concept of "speed", meaning a displacement that gets applied each tick by vanilla logic.

I get the impression that you might be going about this in a not-so-great way, but without more details I can't quite discern what, other than relying too much on vanilla rather than going, as it were, "pure Lua".
Yeah, I'm just experimenting with things right now trying to create something that has never been done before. I've got an unorthodox way of going about things as I have limited programming knowledge and "do things as I learn how to do them" while also trying to keep it fun to play. Thanks for your help.
I recommend getting in touch over instant message with someone who knows their way around this stuff.


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari