[TeaScript] Reverse block's player's effect

Description: You made a script? Submit it here to show your creation to the public, share, take reviews, provision of the help and support is here!
Moderators: Yoshi021, Lx Xzit, 5438A38A, TepigFan101, Moderators

Catskart M
Topic author, Count
Count
Avatar
Catskart M
Topic author, Count
Count
Age: 18
Reputation: 120
Posts: 256
Joined: 29 Nov 2015
Location: France

Post #1by Catskart » 16 Aug 2016, 18:50

1. Introduction.

The player's block can be passed if the character used is right.

My customNPC is the same player's blocks, but the effect is reversed, the player's block become solid when the character used is right.
You can see the video here : https://vid.me/e/oZHe?stats=1

The PB with the normal effect is a block, the other is a NPC.

2. How to install this.

First, download this picture which will be NPC-288.
I use this NPC because it's the less used NPC in smbx levels.

Spoiler
Image

Put this picture in your level folder, with the name "npc-288".
This NPC must have a txt file (with the same name) :

Code: Select all

scripts=RPB
frames=1
grabtop=0
grabside=0
playerblock=1
playerblocktop=1
npcblock=0
npcblocktop=0
noyoshi=1
nofireball=1
noiceball=1
nogravity=1
width=32
height=32
GFXwidth=32
GFXheight=32
noblockcollision=1


In your level you must use this script (with the name "RPB" and this NPC will work corretly.) :

Code: Select all

'----------------------------------Character's Blocks with reversed effects.------------------------------
'Created by Catskart.
'This custom NPC is a character block which became solid if the player has the right character.
'----------------------------------------------------------------------------------------------------------------------
if npc(sysval(Param1)).ivalc=0 then
npc(sysval(Param1)).y=npc(sysval(Param1)).y-2
npc(sysval(Param1)).ivalc=1
end if
npc(sysval(Param1)).ivala=npc(sysval(Param1)).ivala+1

if npc(sysval(Param1)).advset > 5 then
npc(sysval(Param1)).advset=5
end if

npc(sysval(Param1)).x=npc(sysval(Param1)).x


if npc(sysval(Param1)).advset=1 then
if char(1).id=npc(sysval(Param1)).advset-1 then
npc(sysval(Param1)).ivalb=0
else
npc(sysval(Param1)).ivalb=1
end if
end if
if npc(sysval(Param1)).advset=2 then
if char(1).id=npc(sysval(Param1)).advset-1 then
npc(sysval(Param1)).ivalb=2
else
npc(sysval(Param1)).ivalb=3
end if
end if
if npc(sysval(Param1)).advset=3 then
if char(1).id=npc(sysval(Param1)).advset-1 then
npc(sysval(Param1)).ivalb=4
else
npc(sysval(Param1)).ivalb=5
end if
end if
if npc(sysval(Param1)).advset=4 then
if char(1).id=npc(sysval(Param1)).advset-1 then
npc(sysval(Param1)).ivalb=6
else
npc(sysval(Param1)).ivalb=7
end if
end if
if npc(sysval(Param1)).advset=5 then
if char(1).id=npc(sysval(Param1)).advset-1 then
npc(sysval(Param1)).ivalb=8
else
npc(sysval(Param1)).ivalb=9
end if
end if


if char(1).id=npc(sysval(Param1)).advset-1 then
npc(sysval(Param1)).friendly=0
else
npc(sysval(Param1)).friendly=1
end if


npc(sysval(Param1)).curframe=(npc(sysval(Param1)).ivalc)+(npc(sysval(Param1)).ivalb*3)

if npc(sysval(Param1)).ivala=8 then
if npc(sysval(Param1)).ivalc=>3 or npc(sysval(Param1)).ivalc=0 then
npc(sysval(Param1)).ivalc=1

else
npc(sysval(Param1)).ivalc=npc(sysval(Param1)).ivalc+1
end if
npc(sysval(Param1)).ivala=0
end if


3. How to use it.

This NPC is in SMB2 Section, he replaces the potion and has an advance option.
Image

The original NPC change the section with your position, the effect is different with the script.
The section number is the player's character selected.

Section 1 = Mario.
Section 2 = Luigi.
Section 3 = Peach.
Section 4 = Toad.
Section 5 or more = Link.

There is a autocorrection about Y position.
Don't use with 2 players mode !

Yoshi021 M
Moderator
Moderator
Avatar
Yoshi021 M
Moderator
Moderator
Age: 17
Reputation: 79
Posts: 637
Joined: 15 Feb 2016
Location: Yoshi's Island

Post #2by Yoshi021 » 17 Aug 2016, 5:32

This is cool. Hopefully this can be fully implemented into 1.4.3
Links
ImageImageImage
Image
Image
"Going to University is FUN!" :pardon:


Return to “Script submission”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest