1.4.5. NPC behavior values/ivals

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

Void-the-Bat M
Topic author, Bat
Bat
Avatar
Void-the-Bat M
Topic author, Bat
Bat
Age: 17
Reputation: 32
Posts: 197
Joined: 18 Apr 2014
Location: Somewhere...
Website

Post #1by Void-the-Bat » 23 Aug 2019, 20:35

I've been getting into TeaScript quite a bit, and SetaYoshi/Yoshi021 had introduced me to ivals. Ivals practically are values that determine an NPC's AI, from how long they attack for, when they attack, and how they attack, or even what state they're in. If there's an NPC in this list that doesn't show one of the types of ivals, then that means it isn't used at all for that NPC.

I'm open for any requests at the moment, so if you want an explanation of an NPC's AI, feel free to leave a reply here.

Also, if the list gets too big, I will hide the entire thing in another spoiler. Don't forget that Ctrl+F is your friend.

SMB3 Bowser:
Spoiler
.ivala indicates action. -1 and lower are standing, 0 is squatting, 1 is breathing fire, 2 is hopping, 3 is Bowser Bomb, 4 and higher are changing direction.

.ivalb indicates how many more times the current action (either hopping or breathing fire) will loop until next action. Forcing the variable to a negative number or forcing ivala's value to 1 or 2 will cause the action to be looped infinitely. It also works as the speed for the Bowser Bomb, maximum being 8. Interestingly, forcing this value to 8 for when Bowser Bomb is being used actually gives Bowser's drop velocity. Any numbers lower will cause him to fall slower. I have not found any way to make him fall faster through ivals.

.ivalc indicates how many frames until current action repeats or next action occurs. Max frames is 50.

Dino Rhino/Dino Torch:
Spoiler
.ivala indicates the amount of frames the NPC has been attacking. Positive values are forward attacks, and negative values are upward attacks.

.ivalb indicates how many frames have passed since last attack.

.ivalc indicates whether or not the NPC has jumped. 0 is when the NPC is jumping and 1 is when the NPC is grounded or walking off a platform.

Mother Brain:
Spoiler
.ivala determines the hit animation timer, including the shaking effect. 0 is its normal state and values 1 to 30 are for when it takes damage. If this value is forced to 0, it will not shake when it takes damage, and its hurt frame will only appear for a few seconds. Values 1 to 30 are the hurt animation timer. If forced to one of these values, it will be in its damaged state infinitely, however, it can still take damage.

Ice Brick:
Spoiler
.ivala seems to determine what state the NPC is in along with how long it's been in that state. 0 is when it hasn't been picked up or is currently being held by the player. When the object is thrown/dropped, this value begins to increase by 1 every frame. Once this value reaches 1000, the NPC disappears. This value also resets when the player picks the object up again. Interestingly, when this object is falling down (i.e. dropped down a pit, dropped midair, thrown upward), the value is then immediately negated for whatever reason. Probably to prevent it from disappearing when falling down?

Fighter Fly:
Spoiler
.ivala serves as both the amount of time the enemy has to wait before its next jump AND when it's jumping phase is active. It's value counts up to 30 whenever on the ground. The NPC seems to only jump at frame 29. When its value is at 30, this indicates that the NPC is in midair. It will not change until it lands on the ground. If you don't want a wait timer, you could force .ivala to 29 to have it constantly jump.

Player Fireball:
Spoiler
.ivala serves as how long the projectile has been active in frames. As usual, each frame increments the ival by 1. Nothing else interesting happens as far as I know.

.ivalb is where it gets kinda complicated. When the value is 0, the fireball acts like Mario's or Luigi's fireballs. This is strange considering Link's fireball uses the same values as Mario & Luigi for all three ivals. For Peach's fireballs, .ivalb seems to work as a spawn shot speed? I'm not too sure on this one. The value depends on how fast the player is moving when they shoot the fireball and if they actually shot it or threw it. Positive numbers are shot to the right, negatives are shot to the left. Throwing Peach's fireball directly upwards makes this value 0. Toad and Link's are always zero.

.ivalc is also kinda complicated. For Mario, Luigi, and Link, these values are always 0. For Peach, the value is set to 5 when a fireball is shot. When it bounces off a wall, this value is set to 1 to indicate that the next time it hits the wall, it'll disappear. For Toad, this seems to work exactly the same as Peach's .ivalb, except the values are mostly different.

Player Iceball:
Spoiler
.ivala works as how many times the Iceball has hit the ground, the value incrementing by 1 each bounce. If it hits the ground while this value is 2, it'll disappear. Throwing an Iceball directly upwards as Peach or Toad has this value set to 0, which will change to 2 when it hits the ground. This value isn't used for Link as his Iceballs have no gravity. You can force this value to 0 if you want Iceballs to bounce forever until they hit a wall or hit the ground when thrown upwards with Peach or Toad.

.ivalb works as the frame timer, go figure. Value increments by 1 every frame, yadayada, you know the drill by now.

.ivalc surprisingly does nothing. I thought maybe this one would've indicated if this was Link's Iceball or not.

Player Hammer:
Spoiler
.ivalb, as with the Fireball and Iceball, works as the frame timer.

Peach's Bomb doesn't use ivals at all.

Toad's Boomerang:
Spoiler
.ivala is an interesting case. Not only does it work as a sort of frame timer, but it also indicates the "radius" of the Boomerang as it tries to return to Toad. Max value is 60. Force it to this value if you want to completely nerf Toad's Boomerang.

.ivalb determines the direction the Boomerang was fired. 1 is right, and -1 is left. 0 is used for when the NPC was spawned by other means.

Link's Sword Beam:
Spoiler
.ivala is the frame timer for the NPC yet again. If the value reaches 29, the NPC destroys itself. Like the Iceball, if you want this to go on until it despawns offscreen, just set the value to anything below 29. Interestingly, if the value is forced to 28, it will not only go on forever, but it won't produce a sparkle trail at all. If you want Link's sword beam to be useless, force the value to 29 or higher, rendering the NPC useless aside from some sparkle effects that appear when the NPC destroys itself.

Swinging Claw:
Spoiler
.ivala determines if the claw is holding something or not. 0 is holding nothing, 1 is holding a player, and 2 is holding an NPC.

.ivalb determines the interval of the NPC holding another NPC or player.

.ivalc is sorta unknown. It may possibly be related to the position or speed of the swinging claw when the player is moving on it.
(ivals contributed by Victor ManuelMR)

Most updates to this thread will be either because of my own personal research, or someone requested me to analyze an NPC's AI. If you would like to keep up to date then you should subscribe to this topic, as I don't know how often I'll update it if there's no pending requests. Please feel free to make a request or notify me of any errors in this thread.
Last edited by Void-the-Bat on 17 Nov 2019, 3:38, edited 2 times in total.
If you need help with anything related to SMBX38A (that isn’t TeaScript) come ask me. I know quite a bit about how expanded NPC text codes and other stuff works.

sweep a leaf sweep away a troubles
While you're looking at whatever has this signature attached to it, why not check out my DeviantArt page?

hey look a Discord server

"If you look deep into each message, you will be sent on a path to enlightenment..." -Abridged Tails

(If you wanna know what it seems like I'm online all the time, it's because I usually don't log out.)

Victor ManuelMR
Honourable citizen
Honourable citizen
Avatar
Victor ManuelMR
Honourable citizen
Honourable citizen
Reputation: 17
Posts: 36
Joined: 7 Feb 2018

Post #2by Victor ManuelMR » 26 Aug 2019, 1:02

Spoiler
EXEcutor-The-Bat wrote:I've been getting into TeaScript quite a bit, and SetaYoshi/Yoshi021 had introduced me to ivals. Ivals practically are values that determine an NPC's AI, from how long they attack for, when they attack, and how they attack, or even what state they're in. If there's an NPC in this list that doesn't show one of the types of ivals, then that means it isn't used at all for that NPC.

I'm open for any requests at the moment, so if you want an explanation of an NPC's AI, feel free to leave a reply here.

Also, if the list gets too big, I will hide the entire thing in another spoiler. Don't forget that Ctrl+F is your friend.

SMB3 Bowser:
Spoiler
.ivala indicates action. -1 and lower are standing, 0 is squatting, 1 is breathing fire, 2 is hopping, 3 is Bowser Bomb, 4 and higher are changing direction.

.ivalb indicates how many more times the current action (either hopping or breathing fire) will loop until next action. Forcing the variable to a negative number or forcing ivala's value to 1 or 2 will cause the action to be looped infinitely. It also works as the speed for the Bowser Bomb, maximum being 8. Interestingly, forcing this value to 8 for when Bowser Bomb is being used actually gives Bowser's drop velocity. Any numbers lower will cause him to fall slower. I have not found any way to make him fall faster through ivals.

.ivalc indicates how many frames until current action repeats or next action occurs. Max frames is 50.

Dino Rhino/Dino Torch:
Spoiler
.ivala indicates the amount of frames the NPC has been attacking. Positive values are forward attacks, and negative values are upward attacks.

.ivalb indicates how many frames have passed since last attack.

.ivalc indicates whether or not the NPC has jumped. 0 is when the NPC is jumping and 1 is when the NPC is grounded or walking off a platform.

Mother Brain:
Spoiler
.ivala determines the hit animation timer, including the shaking effect. 0 is its normal state and values 1 to 30 are for when it takes damage. If this value is forced to 0, it will not shake when it takes damage, and its hurt frame will only appear for a few seconds. Values 1 to 30 are the hurt animation timer. If forced to one of these values, it will be in its damaged state infinitely, however, it can still take damage.

Ice Block:
Spoiler
.ivala seems to determine what state the NPC is in along with how long it's been in that state. 0 is when it hasn't been picked up or is currently being held by the player. When the object is thrown/dropped, this value begins to increase by 1 every frame. Once this value reaches 1000, the NPC disappears. This value also resets when the player picks the object up again. Interestingly, when this object is falling down (i.e. dropped down a pit, dropped midair, thrown upward), the value is then immediately negated for whatever reason. Probably to prevent it from disappearing when falling down?

Fighter Fly:
Spoiler
.ivala serves as both the amount of time the enemy has to wait before its next jump AND when it's jumping phase is active. It's value counts up to 30 whenever on the ground. The NPC seems to only jump at frame 29. When its value is at 30, this indicates that the NPC is in midair. It will not change until it lands on the ground. If you don't want a wait timer, you could force .ivala to 29 to have it constantly jump.

Player Fireball:
Spoiler
.ivala serves as how long the projectile has been active in frames. As usual, each frame increments the ival by 1.

.ivalb is where it gets kinda complicated. When the value is 0, the fireball acts like Mario or Luigi's fireballs. This is strange considering Link's fireball uses the same values as Mario & Luigi for all three ivals. For Peach's fireballs, .ivalb seems to work as a spawn shot speed? I'm not too sure on this one. The value depends on how fast the player is moving when they shoot the fireball and if they actually shot it or threw it. Positive numbers are shot to the right, negatives are shot to the left. Throwing Peach's fireball directly upwards makes this value 0. Toad and Link's are always zero.

.ivalc is also kinda complicated. For Mario, Luigi, and Link, these values are always 0. For Peach, the value is set to 5 when a fireball is shot. When it bounces off a wall, this value is set to 1 to indicate that the next time it hits the wall, it'll disappear. For Toad, this seems to work exactly the same as Peach's .ivalb, except the values are mostly different.

Player Iceball:
Spoiler
.ivala works as how many times the Iceball has hit the ground, the value incrementing by 1 each bounce. If it hits the ground while this value is 2, it'll disappear. Throwing an Iceball directly upwards as Peach or Toad has this value set to 0, which will change to 2 when it hits the ground. This value isn't used for Link as his Iceballs have no gravity. You can force this value to 0 if you want Iceballs to bounce forever until they hit a wall or hit the ground when thrown upwards with Peach or Toad.

.ivalb works as the frame timer, go figure. Value increments by 1 every frame, yadayada, you know the drill by now.

.ivalc surprisingly does nothing. I thought maybe this one would've indicated if this was Link's Iceball or not.

Player Hammer:
Spoiler
.ivalb, as with the Fireball and Iceball, works as the frame timer.

Peach's Bomb doesn't use ivals at all.

Toad's Boomerang:
Spoiler
.ivala is an interesting case. Not only does it work as a sort of frame timer, but it also indicates the "radius" of the Boomerang as it tries to return to Toad. Max value is 60. Force it to this value if you want to completely nerf Toad's Boomerang.

.ivalb determines the direction the Boomerang was fired. 1 is right, and -1 is left. 0 is used for when the NPC was spawned by other means.

Link's Sword Beam:
Spoiler
.ivala is the frame timer for the NPC yet again. If the value reaches 29, the NPC destroys itself. Like the Iceball, if you want this to go on until it despawns offscreen, just set the value to anything below 29. Interestingly, if the value is forced to 28, it will not only go on forever, but it won't produce a sparkle trail at all. If you want Link to just be like Ronald McDonald in McDonald Land, and just shoot sparkles, force the value to 29 or higher, rendering the NPC useless aside from some sparkle effects that appear when the NPC destroys itself.


Most updates to this thread will be either because of my own personal research, or someone requested me to analyze an NPC's AI. If you would like to keep up to date then you should subscribe to this topic, as I don't know how often I'll update it if there's no pending requests. Please feel free to make a request or notify me of any errors in this thread.

Swinging Claw

1.png
1.png (1.5 KiB) Viewed 2593 times


.ivala =
0 - Holding No NPC/Player
-1 - Holding the Player
2 - Holding an NPC

.ivalb =
Interval holding NPC / Player

.ivalc =
NPC Position?
Exem.gif


Return to “TeaScript”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest