Turn one NPC into another

Description: Internal scripting system of SMBX-38A Engine based on the simple VB-like language
Moderators: Lx Xzit, Yoshi021, 5438A38A, Semi-moderatos, Moderators

Alvespires M
Topic author, Count
Count
Alvespires M
Topic author, Count
Count
Age: 22
Reputation: 17
Posts: 228
Joined: 20 Aug 2016
Location: Koopa Troopa Beach

Post #1by Alvespires » 20 Dec 2016, 19:30

I need make a goomba appear and after a few seconds,it turn into another NPC.The problem is,I have no Idea on how to do that,as I want that NPC to appear on the SAME place the other NPC was,and not "reset" it.Is there a Way?
Not really up to it.

Lx Xzit M
Moderator
Moderator
Avatar
Lx Xzit M
Moderator
Moderator
Reputation: 402
Posts: 757
Joined: 9 Nov 2015
Website

Post #2by Lx Xzit » 20 Dec 2016, 21:10

Try this

Code: Select all

With NPC(sysval(param1))
.ivala = .ivala + 1
if .ivala = X then
Call NKill(-code-)
Call NCreate(-code-)
end if
end with

X is the number of frames the script will execute the next action. I think the best way to replace a NPC is "killing" it and create a new one at the same moment
VISIT MY YOUTUBE CHANNEL! LX XZIT
Join our 38A Discord server!

Image

Alvespires M
Topic author, Count
Count
Alvespires M
Topic author, Count
Count
Age: 22
Reputation: 17
Posts: 228
Joined: 20 Aug 2016
Location: Koopa Troopa Beach

Post #3by Alvespires » 20 Dec 2016, 23:54

Lx Xzit wrote:Try this

Code: Select all

With NPC(sysval(param1))
.ivala = .ivala + 1
if .ivala = X then
Call NKill(-code-)
Call NCreate(-code-)
end if
end with

X is the number of frames the script will execute the next action. I think the best way to replace a NPC is "killing" it and create a new one at the same moment
No,I really want to replace with time,not killing.BTW the -code- is the NPC that will be replaced/put in the place,isn't it?
Not really up to it.

Zwertll
Close friend
Close friend
Zwertll
Close friend
Close friend
Reputation: 51
Posts: 82
Joined: 6 Dec 2016

Post #4by Zwertll » 21 Dec 2016, 18:37

Alvespires wrote:
Lx Xzit wrote:Try this

Code: Select all

With NPC(sysval(param1))
.ivala = .ivala + 1
if .ivala = X then
Call NKill(-code-)
Call NCreate(-code-)
end if
end with

X is the number of frames the script will execute the next action. I think the best way to replace a NPC is "killing" it and create a new one at the same moment
No,I really want to replace with time,not killing.BTW the -code- is the NPC that will be replaced/put in the place,isn't it?
Try

Code: Select all

With NPC(sysval(param1))
.ivala = .ivala + 1
if .ivala = X then
.ID = Y
end if
end with

Alvespires M
Topic author, Count
Count
Alvespires M
Topic author, Count
Count
Age: 22
Reputation: 17
Posts: 228
Joined: 20 Aug 2016
Location: Koopa Troopa Beach

Post #5by Alvespires » 21 Dec 2016, 19:46

Zwertll wrote:Try

Code: Select all

With NPC(sysval(param1))
.ivala = .ivala + 1
if .ivala = X then
.ID = Y
end if
end with
Yeah....I guess that's a better choice than the other...Thank you!But...One last thing...Theres a way to change the NPC back after that?
Not really up to it.


Return to “TeaScript”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest