autorun_e(ID)

Description: Have any suggestions or new ideas for SMBX-38A? This is a place for you. Good suggestions may appear in future versions of SMBX-38A.
Moderators: Yoshi021, Lx Xzit, 5438A38A, Semi-moderatos, Moderators

Lx Xzit M
Topic author, Moderator
Moderator
Avatar
Lx Xzit M
Topic author, Moderator
Moderator
Reputation: 326
Posts: 702
Joined: 9 Nov 2015
Website

Post #1by Lx Xzit » 15 Dec 2019, 21:01

This function would let us know when the conditions to execute an autorun event are met, without having to make an autorun event and adding a flag or make it trigger an script. The main advantage of this is that scripts would require less user-intervention, plus it would help to our scripts to be more organized.

It should be read-only and the only parameter is the ID of the auto-run event (starting from "P Switch - Start"):

Spoiler
Image

Here's an example of an usage.

Code: Select all

do
   if autorun_e(3)
      call showmsg("The level has ended!")
   end if
   call sleep(1)
loop


This would open a lot of possibilities, like executing a script when an NPC dies/gets killed, when the player gets a power-up or gets hurt, etc.. All without having to do messy autorun events triggering.
VISIT MY YOUTUBE CHANNEL! LX XZIT
Join our 38A Discord server!

Image

Victor ManuelMR
Close friend
Close friend
Avatar
Victor ManuelMR
Close friend
Close friend
Reputation: 33
Posts: 81
Joined: 7 Feb 2018

Post #2by Victor ManuelMR » 16 Jan 2020, 2:53

Lx Xzit wrote:This function would let us know when the conditions to execute an autorun event are met, without having to make an autorun event and adding a flag or make it trigger an script. The main advantage of this is that scripts would require less user-intervention, plus it would help to our scripts to be more organized.

It should be read-only and the only parameter is the ID of the auto-run event (starting from "P Switch - Start"):

Spoiler
Image

Here's an example of an usage.

Code: Select all

do
 if autorun_e(3)
 call showmsg("The level has ended!")
 end if
 call sleep(1)
loop


This would open a lot of possibilities, like executing a script when an NPC dies/gets killed, when the player gets a power-up or gets hurt, etc.. All without having to do messy autorun events triggering.


For example, how could I activate a death event if the second or first player dies?
and another, was the script supposed to repeat this sample message several times?

NESTED ERNEST M
Marquis
Marquis
Avatar
NESTED ERNEST M
Marquis
Marquis
Reputation: 29
Posts: 193
Joined: 23 Sep 2017
Location: Perú, Lima
Website

Post #3by NESTED ERNEST » 16 Jan 2020, 5:25

I am sorry to disappoint you, but the truth is that this suggestion was not added (ie it doesn't work), you can put autorun_e(3) or autorun(3) or autorublablablamm(3) or asujkdhsiuak and this will continue to run.
Programming NPCs in SMBX-38A is fun:

ROCKMAN GIF IN SMBX 38A

Image

Lx Xzit M
Topic author, Moderator
Moderator
Avatar
Lx Xzit M
Topic author, Moderator
Moderator
Reputation: 326
Posts: 702
Joined: 9 Nov 2015
Website

Post #4by Lx Xzit » 16 Jan 2020, 5:29

NESTED ERNEST wrote:I am sorry to disappoint you, but the truth is that this suggestion was not added (ie it doesn't work), you can put autorun_e(3) or autorun(3) or autorublablablamm(3) or asujkdhsiuak and this will continue to run.

I just noticed that
VISIT MY YOUTUBE CHANNEL! LX XZIT
Join our 38A Discord server!

Image

NESTED ERNEST M
Marquis
Marquis
Avatar
NESTED ERNEST M
Marquis
Marquis
Reputation: 29
Posts: 193
Joined: 23 Sep 2017
Location: Perú, Lima
Website

Post #5by NESTED ERNEST » 30 Mar 2020, 20:33

1.4.5 path 29 does can detect the error.
Programming NPCs in SMBX-38A is fun:

ROCKMAN GIF IN SMBX 38A

Image


Return to “Ideas & Suggestions”

Who is online (over the past 5 minutes)

Users browsing this forum: 2 guests