A couple questions about LunaDLL (TheXTech)

Description: Do you have troubles with the TheXTech engine? Post your problem here!
Moderators: Moderators, Semi-moderatos

Superbloxen
Topic author, Nice citizen
Nice citizen
Superbloxen
Topic author, Nice citizen
Nice citizen
Reputation: 0
Posts: 11
Joined: 18 Jul 2022

Post #1by Superbloxen » 10 Oct 2023, 0:42

(Not sure if these questions are supposed to be posted here)
Hello, I was using LunaDLL in TheXTech and I was wondering if it was possible to make 1 NPC use the AI of another (example a Goomba behaving like a Thwomp) without changing the GFX. Is it possible?

Also, is it possible to manipulate Block and Effect AI and behavior as well?

Wohlstand M
Lead Developer
Lead Developer
Avatar
Wohlstand M
Lead Developer
Lead Developer
Age: 33
Reputation: 498
Posts: 1897
Joined: 15 Feb 2014
English Pronouns: he/him
Location: Moscow, Russia
Website Youtube channel URL Skype Tencent QQ

Post #2by Wohlstand » 10 Oct 2023, 10:31

Hello!
On this moment it's impossible to re-assign NPC-AIs between IDs. Basically, becasuse original SMBX (and TheXTech on this moment) defines the AI by ID: every function that related to NPC logic, has a huge spaghetti of "if id == 1; ... else if id == 2; ... else, etc...".
However, there is a great plan to majorly refactor the whole NPC code to turn that scarrying spaghetti into an array of function pointers which will allow us to re-assign AIs between different IDs without the dependency on the old stuff.
Image

Superbloxen
Topic author, Nice citizen
Nice citizen
Superbloxen
Topic author, Nice citizen
Nice citizen
Reputation: 0
Posts: 11
Joined: 18 Jul 2022

Post #3by Superbloxen » 22 Oct 2023, 0:26

Is it also possible to create custom powerup states by manipulating the player's memory? I tried to change the powerup state above State 7 and put the 38A sprites into Mario's folder, which caused an Assertion Failure when I ran the Autocode script. I pressed Always Ignore and the game functioned normally, so I think it could be possible. There was a bit of weirdness though because Mario had the wrong offset and turned into Luigi when I tried to raise the state to 11 or higher.

Wohlstand M
Lead Developer
Lead Developer
Avatar
Wohlstand M
Lead Developer
Lead Developer
Age: 33
Reputation: 498
Posts: 1897
Joined: 15 Feb 2014
English Pronouns: he/him
Location: Moscow, Russia
Website Youtube channel URL Skype Tencent QQ

Post #4by Wohlstand » 22 Oct 2023, 3:06

Superbloxen wrote:Is it also possible to create custom powerup states by manipulating the player's memory?
It's possible to slightly alternate behaviour of existing power-up states, but you can't add new, because that requires an engine-side implementation of the necessary API that will allow you that.

Superbloxen wrote:I tried to change the powerup state above State 7 and put the 38A sprites into Mario's folder, which caused an Assertion Failure when I ran the Autocode script.
Because the code (inherited from SMBX) tries to find any sprite files by counting, and... it may fail, because attempts to deal with non-existing array entry. That's a bug, and I should solve it. It should just don't try to load sprites for non-existing array entries. :comando:

Superbloxen wrote:There was a bit of weirdness though because Mario had the wrong offset and turned into Luigi when I tried to raise the state to 11 or higher.
Seems, because of past tricks, and because of missing array entries, you have to override the data of next array (Luigi's).

Anyway, existing memory emulator of TheXTech doesn't gives full memory access, and it gives the access to known addresses and it maps the data between real in-engine fields and script. Basically, it was been implemented to support existing LunaDll projects (such as Analog Funk), and currently is a temporary scripting system for extra things here.
Image

Superbloxen
Topic author, Nice citizen
Nice citizen
Superbloxen
Topic author, Nice citizen
Nice citizen
Reputation: 0
Posts: 11
Joined: 18 Jul 2022

Post #5by Superbloxen » 22 Oct 2023, 3:22

I see. Will the adding of new content like this become possible in a future update?
In addition, will the Memory Map on the Github page get an update? Some codes lack descriptions which make it a bit confusing to utilize.
And unrelated, but how do I use the Controls:: and Location:: structures?

Wohlstand M
Lead Developer
Lead Developer
Avatar
Wohlstand M
Lead Developer
Lead Developer
Age: 33
Reputation: 498
Posts: 1897
Joined: 15 Feb 2014
English Pronouns: he/him
Location: Moscow, Russia
Website Youtube channel URL Skype Tencent QQ

Post #6by Wohlstand » 22 Oct 2023, 4:09

Superbloxen wrote:Will the adding of new content like this become possible in a future update?
In the future is actually planned to allow adding new content, yeah.

Superbloxen wrote:will the Memory Map on the Github page get an update?
I do update it every time I add new data into the memory emulator. Speaking about descriptions, I need a reminder to fill them all as soon as possible.

Superbloxen wrote:how do I use the Controls:: and Location:: structures?
They are basically a sub-structures of NPC and Player classes, you can access sub-fields by computing an absolute address of every field.
Image


Return to “TheXTech Troubleshooting”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest