LunaDLL/LunaLUA help thread
Re: LunaDLL help thread
Yeah that doesnt work but was working not too long ago. I'll figure it out.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
Re: LunaDLL help thread
Ok I found a bug with the builtin sprites. It'll be fixed when I make builtin sprites not suck (for SDS 2?) but I can't update lunadll at the moment since im in the middle of a large update. But you could still use a phanto right now by copying the phanto definition into your file. Here's a complete working file for that level. Also I got rid of the cursed key problem in this one.
Also that way gives you the ability to customize the speed of the phanto if you want.
Code: Select all
///////////////////////////////
/// -- Phanto definition -- ///
#-1
$MyPhanto,SpriteBlueprint,0,0,0,0,0,0
$DECEL,Deccelerate,0.04,0.04,0,0,0,0
// These are the 4 random IDs I know a key can have
$KEY1,PlayerHoldingSprite,31,0,0,55000,0,0
$KEY2,PlayerHoldingSprite,15,0,0,55000,0,0
$KEY3,PlayerHoldingSprite,64,0,0,55000,0,0
$KEY4,PlayerHoldingSprite,192,0,0,55000,0,0
$MOVE,PhaseMove,0,0,0,0,0,0
$DRAW,RelativeDraw,0,0,0,0,0
$PHANHITBOX,SetHitbox,2,2,28,28,1,0
$MyPhanto,Attach,0,0,0,0,0,DECEL
$MyPhanto,Attach,0,0,0,0,0,KEY1
$MyPhanto,Attach,0,0,0,0,0,KEY2
$MyPhanto,Attach,0,0,0,0,0,KEY3
$MyPhanto,Attach,0,0,0,0,0,KEY4
$MyPhanto,Attach,0,0,0,0,0,MOVE
$MyPhanto,Attach,1,0,0,0,0,DRAW
$MyPhanto,Attach,2,0,0,0,0,PHANHITBOX
#55000
AccelToPlayer,0.095,0.095,5.6,0,1,0
OnPlayerCollide,0,0,0,55001,1,0
OnPlayerDistance,3000,0,0,55002,1,0
#55001
HarmPlayer,0,0,0,0,1,0
#55002
TeleportNearPlayer,1000,0,0,0,1,0
//////////////////////////////////
// Level code
// Load image phanto.bmp into image slot 2 with transparency color FF00DC (pink)
#-1
LoadImage,2,0xDC00FF,0,0,0,phanto.bmp
#0
PlaceSprite,0,2,-159552,-160352,0,MyPhanto
DON'T PM me. Ask your question in the help thread so everyone can be answered.
Re: LunaDLL help thread
ps, I think I just fixed a2mbxt appearing as a virus, and it no longer should with most antiviruses
http://www.gamearchaeology.com/a2mbxt.exe
http://www.gamearchaeology.com/a2mbxt.exe
DON'T PM me. Ask your question in the help thread so everyone can be answered.
- Willhart
- Stalker, Doxxer, and Sexual Harasser
- Banned
- Posts: 2434
- Joined: 13 years ago
- Location: Finland
Re: LunaDLL help thread
Avast still prevented it automatically. Hopefully it works for others.Kil wrote:ps, I think I just fixed a2mbxt appearing as a virus, and it no longer should with most antiviruses
http://www.gamearchaeology.com/a2mbxt.exe
Infection: Win32:Evo-gen [Susp]
Re: LunaDLL help thread
That's unfortunate. According to this online scan it was showing barely any detections https://www.virustotal.com/en/file/4ddc ... 413193242/
https://www.metascan-online.com/en/scan ... a35cf740e0
https://www.metascan-online.com/en/scan ... a35cf740e0
DON'T PM me. Ask your question in the help thread so everyone can be answered.
Re: LunaDLL help thread
Just spotted something on the reference page, in the memory map of the player object:
That's an awfully big memory gap there. I'd have expected the next few values to be:
0x6A
0x6C
0x6E
0x70
0x72
0x74
0x76
0x78
0x7A
What happened to these values? Why is 0x68 mapped as a 640-bit word?
Code: Select all
//+0x66 w = Unknown66
//+0x68 w = Unknown68
//+0x7A w = Unknown70
//+0x7C w = Unknown72
0x6A
0x6C
0x6E
0x70
0x72
0x74
0x76
0x78
0x7A
What happened to these values? Why is 0x68 mapped as a 640-bit word?
Re: LunaDLL help thread
I only marked down addresses which the game actually tried to use
DON'T PM me. Ask your question in the help thread so everyone can be answered.
Re: LunaDLL help thread
Ah, that makes sense. I was just having a look to see if I can detect whether the player has finished the level or not (so I can run some code immediately before returning to the world map), so I was looking for some unknown timers or flags. Good to know it's just because the game doesn't use them, though.Kil wrote:I only marked down addresses which the game actually tried to use
Re: LunaDLL help thread
By the way detecting that sounds rough, considering all the ways you can leave end or otherwise exit a level, and I don't know of any really convenient memory you can scan for that or anything. I suppose you could do it with tons and tons of conditional checks of various things.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
Re: LunaDLL help thread
I can cover most level exits using Lua's findnpcs function, but this doesn't account for a) key exits and b) warp/offscreen exits.Kil wrote:By the way detecting that sounds rough, considering all the ways you can leave end or otherwise exit a level, and I don't know of any really convenient memory you can scan for that or anything. I suppose you could do it with tons and tons of conditional checks of various things.
An alternative would be to find the ways the player can leave the level without finishing it. I believe this is just by death or by quitting, which might be simpler to detect...
Re: LunaDLL help thread
I know the function npcs_to_coins which is called when the player hits the exit. With xrefs (IDA's Reference Language ) I can lookup which function calls this function. But currently I am heavly busy :/
Re: LunaDLL help thread
That could help, but also doesn't cover all cases, so it could potentially lead nowhere.Kevsoft wrote:I know the function npcs_to_coins which is called when the player hits the exit. With xrefs (IDA's Reference Language ) I can lookup which function calls this function. But currently I am heavly busy :/
Re: LunaDLL help thread
I spent about 2 hours finding it, now have a good use for it!
0x00B2C59E at type WORD
0x00B2C59E = 0 means currently not winning
0x00B2C59E = ? means current winning at win-type '?'
0x00B2C59E at type WORD
0x00B2C59E = 0 means currently not winning
0x00B2C59E = ? means current winning at win-type '?'
Re: LunaDLL help thread
Kevsoft wrote:I spent about 2 hours finding it, now have a good use for it!
0x00B2C59E at type WORD
0x00B2C59E = 0 means currently not winning
0x00B2C59E = ? means current winning at win-type '?'
Finally a way to remove the mercy block's invincible mode!
Re: LunaDLL help thread
This is super useful! I've managed to build a currency system now.Kevsoft wrote:I spent about 2 hours finding it, now have a good use for it!
0x00B2C59E at type WORD
0x00B2C59E = 0 means currently not winning
0x00B2C59E = ? means current winning at win-type '?'
It's definitely worth noting that this doesn't work for "warp" level endings (doors and the like), but that shouldn't be too much of an issue.
Re: LunaDLL help thread
Just checked, if you keep setting it to 0 you can basically deactivate winning. Kinda funny
- Mabel
- Just west of wierd
- Posts: 302
- Joined: 10 years ago
- https://marbels.talkhaus.com/
Re: LunaDLL help thread
Looks like those Gravity codes might have some issues...
-play level with custom gravity in it
-die/exit
-go to another level
-gravity still on
just putting this out here so if you use such codes in your level that this happens...this might even be just editor only...
-play level with custom gravity in it
-die/exit
-go to another level
-gravity still on
just putting this out here so if you use such codes in your level that this happens...this might even be just editor only...
theres been alot of posts lately so this was probably brough up before so if it has this is just an empty post
Re: LunaDLL help thread
No you're right, you should be careful with those because they are never reset back to normal values. It'd be nice if someone reset them in the lunaworld file.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
Re: LunaDLL help thread
So would normal gravity in lunaworld overwrite the custom gravity? I hope not.
Also custom sprites: let's say I set a custom sprite to display when the player has 1 heart. If I got another heart would it disappear or would it keep displaying until told to disappear?
Also custom sprites: let's say I set a custom sprite to display when the player has 1 heart. If I got another heart would it disappear or would it keep displaying until told to disappear?
Re: LunaDLL help thread
That's why you should put the gravity reset in the level load section of lunaworld.TiKi wrote:So would normal gravity in lunaworld overwrite the custom gravity? I hope not.
That's entirely dependent on how you're displaying the sprite.Also custom sprites: let's say I set a custom sprite to display when the player has 1 heart. If I got another heart would it disappear or would it keep displaying until told to disappear?
DON'T PM me. Ask your question in the help thread so everyone can be answered.
Re: LunaDLL help thread
Personally I would just hardcode a reset code in the dll to prevent such a thing.
Re: LunaDLL help thread
If someone tells me all the default values that need to be reset, I would
DON'T PM me. Ask your question in the help thread so everyone can be answered.
Re: LunaDLL help thread
Man, lunadll gets better every day
So about speed: wouldn't there be some value SMBX sets the cap to, like "if player is above x set acceleration to 0"? One that could be modified?
So about speed: wouldn't there be some value SMBX sets the cap to, like "if player is above x set acceleration to 0"? One that could be modified?
Re: LunaDLL help thread
That seems like it would be in the speed processing code, probably not a modifiable memory location
DON'T PM me. Ask your question in the help thread so everyone can be answered.
- Oddwrath
- The ghost of talkhaus unlikely
- Posts: 117
- Joined: 9 years ago
- Pronouns: she/her
- Location: Merry Old Europe
Re: LunaDLL help thread
In LunaLua, what is the difference between RECT and RECTd? And which one would be the TriggerZone of LunaLua?
my avatar is from that obake game made in 2001 that you cannot play anymore unless you run it through a virtual machine and apply a locale patch