Page 1 of 1

Goomba Killing Achievement (SOLVED!)

Posted: Wed Feb 22, 2023 7:07 pm
by KurttheKing
How can I make an achievement that activates when I've killed a grand total of 100 Goombas?

Re: Goomba Killing Achievement (SOLVED!)

Posted: Thu Feb 23, 2023 12:07 pm
by KurttheKing
Nevermind. I figured it out!

Re: Goomba Killing Achievement (SOLVED!)

Posted: Fri Feb 24, 2023 8:48 am
by Torterra18
KurttheKing98YT wrote:
Thu Feb 23, 2023 12:07 pm
Nevermind. I figured it out!
Tell me how you did it in excruciating detail

Re: Goomba Killing Achievement (SOLVED!)

Posted: Fri Feb 24, 2023 4:18 pm
by KurttheKing
Torterra18 wrote:
Fri Feb 24, 2023 8:48 am
Tell me how you did it in EXCRUCIATING detail

With pleasure! First, write the Achievement's info in ach-1.ini, located in the achievements file of your episode:

Code: Select all

name = "Goomba Destroyer"
desc = "Destroy 100 Goombas!"
condition-1 = 100
condition-1-desc = "Goombas Defeated:"
and then go to the Global Lunalua File and write the following:

Code: Select all

local ach1 = Achievements(1)

function onNPCKill(eventObj, killedNPC, killReason)
	if killedNPC.id == 1 then
		if killReason ~= HARM_TYPE_OFFSCREEN then
			ach1:progressCondition(1)
		end
	end
end
If I understand correctly, the way it all works is like this. First, we create a Variable to take the place of Achievement 1 (ach1), then we make an onNPCKill Function to check when a Goomba is killed using the code, "if killedNPC.id == 1 then" Afterwards, we check if the Goomba didn't die to Harm Type Off-Screen. This is so that the Goomba isn't considered to be dead when he falls down a hole or walks off-screen and despawns. Then we just need to advance the Achievement. To do this, we write ach1:progressCondition(1). What this does is first checks for what Achievement we are referring to (in this case Achievement 1 because ach1 takes it's place) and then progresses the condition in parentheses (1), which adds 1 to the amount of Goombas you killed. So everytime a Goomba is killed it adds on 1 until you kill 100 Goombas and will be given the Achievement.

I hope this helped and was filled with enough excruciating detail! :D

Re: Goomba Killing Achievement (SOLVED!)

Posted: Fri Feb 24, 2023 6:57 pm
by Torterra18
KurttheKing wrote:
Fri Feb 24, 2023 4:18 pm
Torterra18 wrote:
Fri Feb 24, 2023 8:48 am
Tell me how you did it in EXCRUCIATING detail

With pleasure! First, write the Achievement's info in ach-1.ini, located in the achievements file of your episode:

Code: Select all

name = "Goomba Destroyer"
desc = "Destroy 100 Goombas!"
condition-1 = 100
condition-1-desc = "Goombas Defeated:"
and then go to the Global Lunalua File and write the following:

Code: Select all

local ach1 = Achievements(1)

function onNPCKill(eventObj, killedNPC, killReason)
	if killedNPC.id == 1 then
		if killReason ~= HARM_TYPE_OFFSCREEN then
			ach1:progressCondition(1)
		end
	end
end
If I understand correctly, the way it all works is like this. First, we create a Variable to take the place of Achievement 1 (ach1), then we make an onNPCKill Function to check when a Goomba is killed using the code, "if killedNPC.id == 1 then" Afterwards, we check if the Goomba didn't die to Harm Type Off-Screen. This is so that the Goomba isn't considered to be dead when he falls down a hole or walks off-screen and despawns. Then we just need to advance the Achievement. To do this, we write ach1:progressCondition(1). What this does is first checks for what Achievement we are referring to (in this case Achievement 1 because ach1 takes it's place) and then progresses the condition in parentheses (1), which adds 1 to the amount of Goombas you killed. So everytime a Goomba is killed it adds on 1 until you kill 100 Goombas and will be given the Achievement.

I hope this helped and was filled with enough excruciating detail! :D
OMG thx so much for the info!

Re: Goomba Killing Achievement (SOLVED!)

Posted: Fri Feb 24, 2023 10:25 pm
by KurttheKing
Torterra18 wrote:
Fri Feb 24, 2023 8:48 am
OMG thx so much for the info!

You're welcome! Glad I could help! :)