Ncreate parameters

Description: Report bugs of SMBX-38A here.
Forum rules: https://wohlsoft.ru/forum/viewtopic.php?f=64&t=1069
Moderators: Lx Xzit, Yoshi021, 5438A38A, Semi-moderatos, Moderators

ctrl_void
Topic author, Honourable citizen
Honourable citizen
Avatar
ctrl_void
Topic author, Honourable citizen
Honourable citizen
Age: 23
Reputation: 3
Posts: 49
Joined: 14 Sep 2015

Post #1by ctrl_void » 19 Oct 2016, 2:01

What are the last 2 parameters of Ncreate supposed to do:

Ncreate(... advset, cdata)

I'm reading the rotating flamethrower example, but without this info it's hard to understand.
Discord server to play SMBX online via Parsec!

https://discord.gg/FftYYMv

Yoshi021 M
Moderator
Moderator
Avatar
Yoshi021 M
Moderator
Moderator
Age: 22
Reputation: 170
Posts: 693
Joined: 15 Feb 2016
Location: Yoshi's Island

Post #2by Yoshi021 » 20 Oct 2016, 0:49

I'm not sure what they do, but I think they are when you are making really complex NPC scripts
Links
ImageImageImage
Image
Image
"Going to University is FUN!" :pardon:

MACKACHE
Lord
Lord
Avatar
MACKACHE
Lord
Lord
Age: 16
Reputation: 108
Posts: 522
Joined: 22 Aug 2016
Website Twitter

Post #3by MACKACHE » 20 Oct 2016, 16:53

[NCreate]
NCreate(id, x, y, sx, sy, advset, cdata)
Returns the permanent ID(double type) of the NPC created.
id(Double) type-ID of the NPC , eg: 1 for a goomba
x(Double) x-position of the NPC
y(Double) y-position of the NPC
sx(Double) x-axis speed of the NPC
sy(Double) x-axis speed of the NPC
advset(Double) additional data of the NPC.Default:0
cdata(Double) creation information.Default:0

The permanent ID returned will become effective in the next frame of the creation.The NPC is not really created immediately in the frame the script is executed.


I read this on .rtf SMBx Scripting Help. On procedures.
ImageImage

ctrl_void
Topic author, Honourable citizen
Honourable citizen
Avatar
ctrl_void
Topic author, Honourable citizen
Honourable citizen
Age: 23
Reputation: 3
Posts: 49
Joined: 14 Sep 2015

Post #4by ctrl_void » 20 Oct 2016, 22:58

Still didn't help... I already read the help file
Discord server to play SMBX online via Parsec!

https://discord.gg/FftYYMv

TheCreator520
Close friend
Close friend
Avatar
TheCreator520
Close friend
Close friend
Reputation: 64
Posts: 91
Joined: 21 Feb 2016

Post #5by TheCreator520 » 21 Oct 2016, 8:40

.advset is the advanced setting number of an npc , for example , if you place a flying koopa and don't change it's variantion , it'll jump and the .advset of the flying koopa is 1 . But if you open the advanced setting window of the flying koopa and turn "Jump" to "Chase" , the .advset turns to 0 from 1 .
Every npc's .advset would make the npcs to have different movements . ( except the npcs with only one way to move . )
the cdata is the way that the npc spawn . for example , if the number is 0 the npc will spawn instandly . if the cdata is 5 the npc will be warped out .
Hope it can help you ;)
Image

ctrl_void
Topic author, Honourable citizen
Honourable citizen
Avatar
ctrl_void
Topic author, Honourable citizen
Honourable citizen
Age: 23
Reputation: 3
Posts: 49
Joined: 14 Sep 2015

Post #6by ctrl_void » 21 Oct 2016, 18:48

TheCreator520 wrote:.advset is the advanced setting number of an npc , for example , if you place a flying koopa and don't change it's variantion , it'll jump and the .advset of the flying koopa is 1 . But if you open the advanced setting window of the flying koopa and turn "Jump" to "Chase" , the .advset turns to 0 from 1 .
Every npc's .advset would make the npcs to have different movements . ( except the npcs with only one way to move . )
the cdata is the way that the npc spawn . for example , if the number is 0 the npc will spawn instandly . if the cdata is 5 the npc will be warped out .
Hope it can help you ;)

But in the rotating flamethrower example, Ncreate() is used to create npc-340, which is the flamethrower, and it has 3 different fields to adjust:

- Angle
- Delay
- Lenght

So how can only one number set all those 3 parameters?
Discord server to play SMBX online via Parsec!

https://discord.gg/FftYYMv

KFCMARIO
Good citizen
Good citizen
Avatar
KFCMARIO
Good citizen
Good citizen
Reputation: 21
Posts: 33
Joined: 25 Jan 2016

Post #7by KFCMARIO » 21 Oct 2016, 19:02

Prado wrote:
But in the rotating flamethrower example, Ncreate() is used to create npc-340, which is the flamethrower, and it has 3 different fields to adjust:

- Angle
- Delay
- Lenght

So how can only one number set all those 3 parameters?

3 paramters could finally be saved as one variable(.advset), look the flamethrower example and you will know how it archive

ctrl_void
Topic author, Honourable citizen
Honourable citizen
Avatar
ctrl_void
Topic author, Honourable citizen
Honourable citizen
Age: 23
Reputation: 3
Posts: 49
Joined: 14 Sep 2015

Post #8by ctrl_void » 22 Oct 2016, 0:38

I realized that I need urgent help to understand this example :SOS:
Discord server to play SMBX online via Parsec!

https://discord.gg/FftYYMv


Return to “SMBX-38A Bug reports”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest