Topic Outdated. No longer needed.

This is the place for discussion and support for LunaLua and related modifications and libraries.
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?
loop
Ninji
Ninji
Posts: 984
Joined: Sun Apr 17, 2016 5:56 pm
Flair: i may be dumb but im not stupid!
Pronouns: he/him/they

Topic Outdated. No longer needed.

Postby loop » Thu May 11, 2017 7:53 pm

This is outdated. My problem was solved.
Last edited by loop on Sat May 13, 2017 12:27 am, edited 1 time in total.

Quantumenace
Ripper II
Ripper II
Posts: 308
Joined: Mon Dec 28, 2015 2:17 am

Re: Make Thwomps spawn other NPCs?

Postby Quantumenace » Thu May 11, 2017 10:02 pm

The memory offsets? Are you trying to check the Thwomp's AI state? You can do that based on the NPC's .ai fields (.ai1, .ai2)

loop
Ninji
Ninji
Posts: 984
Joined: Sun Apr 17, 2016 5:56 pm
Flair: i may be dumb but im not stupid!
Pronouns: he/him/they

Re: Make Thwomps spawn other NPCs?

Postby loop » Thu May 11, 2017 10:04 pm

Uh, yeah.
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
I just need to know HOW to do it.

Quantumenace
Ripper II
Ripper II
Posts: 308
Joined: Mon Dec 28, 2015 2:17 am

Re: Make Thwomps spawn other NPCs?

Postby Quantumenace » Thu May 11, 2017 10:32 pm

if v.ai1 == 2 and v.ai2 == 0 then...

(if that doesn't work try v.ai2 == 1 instead)

loop
Ninji
Ninji
Posts: 984
Joined: Sun Apr 17, 2016 5:56 pm
Flair: i may be dumb but im not stupid!
Pronouns: he/him/they

Re: Make Thwomps spawn other NPCs?

Postby loop » Thu May 11, 2017 11:44 pm

How do i get it to check for the Thwomp's AI? How do I spawn NPCs with LunaLua?

Quantumenace
Ripper II
Ripper II
Posts: 308
Joined: Mon Dec 28, 2015 2:17 am

Re: Make Thwomps spawn other NPCs?

Postby Quantumenace » Fri May 12, 2017 12:07 am

Jayce 777 wrote:How do i get it to check for the Thwomp's AI? How do I spawn NPCs with LunaLua?
1) I just told you. The NPC's ai values can be accessed with .ai1, .ai2 etc. This checks if its ai1 is 2, meaning it's down and waiting to go back up, and its ai2 is 0, meaning it just hit the ground.
2) NPC.spawn(int npcId, number x, number y, int sectionNumber)

loop
Ninji
Ninji
Posts: 984
Joined: Sun Apr 17, 2016 5:56 pm
Flair: i may be dumb but im not stupid!
Pronouns: he/him/they

Re: Make Thwomps spawn other NPCs?

Postby loop » Fri May 12, 2017 7:18 am

Oh. I'll try after school.

loop
Ninji
Ninji
Posts: 984
Joined: Sun Apr 17, 2016 5:56 pm
Flair: i may be dumb but im not stupid!
Pronouns: he/him/they

Re: Make Thwomps spawn other NPCs?

Postby loop » Fri May 12, 2017 5:32 pm

Nope, ain't working because I can't set a simple variable for some reason.

Quantumenace
Ripper II
Ripper II
Posts: 308
Joined: Mon Dec 28, 2015 2:17 am

Re: Make Thwomps spawn other NPCs?

Postby Quantumenace » Fri May 12, 2017 8:41 pm

Jayce 777 wrote:Nope, ain't working because I can't set a simple variable for some reason.
What do you have written? I can't help you without seeing what you're trying to do.

loop
Ninji
Ninji
Posts: 984
Joined: Sun Apr 17, 2016 5:56 pm
Flair: i may be dumb but im not stupid!
Pronouns: he/him/they

Re: Make Thwomps spawn other NPCs?

Postby loop » Fri May 12, 2017 10:04 pm

That is outdated. I got a new error when trying to use NPC.spawn.
Image

Code: Select all

function onTick()
			for _,v in pairs(NPC.get(180,-1)) do
				if v.ai1 == 0
					then v.ai1 = 1
				end
			end
		for _,v in pairs(NPC.get(180,-1)) do
				if v.ai1 == 2
					then NPC.spawn(210, lx, ly, player.section, false, true)
		end
	end
end
WTF?

Quantumenace
Ripper II
Ripper II
Posts: 308
Joined: Mon Dec 28, 2015 2:17 am

Re: Make Thwomps spawn other NPCs?

Postby Quantumenace » Fri May 12, 2017 10:34 pm

"No matching overload" means your arguments have incorrect types. Unless you defined "lx" and "ly" elsewhere they will be nil, and you can't give that as coordinates here.

loop
Ninji
Ninji
Posts: 984
Joined: Sun Apr 17, 2016 5:56 pm
Flair: i may be dumb but im not stupid!
Pronouns: he/him/they

Re: Make Thwomps spawn other NPCs?

Postby loop » Fri May 12, 2017 11:11 pm

How would I define the Thwomps' coordinates?

Quantumenace
Ripper II
Ripper II
Posts: 308
Joined: Mon Dec 28, 2015 2:17 am

Re: Make Thwomps spawn other NPCs?

Postby Quantumenace » Fri May 12, 2017 11:38 pm

You can get their coordinates with v.x and v.y. This will be the top-left corner of the NPC. If you want, say, the center of the bottom edge, use:

lx = v.x+0.5*v.width
ly = v.y+v.height


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 0 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari