Balance system

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

JDM M
Topic author, Nice citizen
Nice citizen
Avatar
JDM M
Topic author, Nice citizen
Nice citizen
Age: 18
Reputation: 2
Posts: 10
Joined: 14 Aug 2016

Post #1by JDM » 14 Aug 2016, 23:44

Hi everyone ! Here is a balance system : a platform which go down where the player stands ... Nothing more. Here's some screenshots :
Spoiler
Image
Image
> A demo to test the system is provided in attached file.

To install it you have 2 possibilities :
First, you recreate manually the environment of the system, including custom npc configuration, scripts, etc ...


Or, the second possibility is to use the install assistant balance.bat (dezip attached "install_balance.zip").
Put the installator in the same directory of your level file, open it, write the level name (without .lvl extension, i.e. if your level file is mylevel.lvl just write "mylevel" (without quotation marks)). Then, it will create automatically all the things we need (custom npc configuration, scripts, variables ...).

Now we'll need to do some ajustments. First you need to trigger the "Fonction" script (i.e. on Level Start event).
Then in the "Fonction" script you have to write in the beginning of the script all the balances you will create, with this custom function :

Code: Select all

Call CreerBalance([x], [y], [d])

Where :
[x] stands to the X-coordinate of the platform's center block
[y] stands to the Y-coordinate
[d] stands to the length of the platform, in blocks (i. e. in the screens 5 for the left platform and 8 for the right platform).
(you can determinate x and y by activating grid then press F11)


As you can see, I make this system as modular as I could ; I also include an "API" :P
The followings informations are for users of TeaScript only :
The function CreerBalance() returns an NPC id which can be used to get and edit some balance's internal informations, as seen in these examples :

Code: Select all

val(balance) = CreerBalance(-199500, -200050, 6)
'npc(val(balance)).x : Read&Write, X-coordinate of middle of balance ; modify will move the platform
'npc(val(balance)).y : Read&Write, Y-coordinate of middle of balance ; modify will move the platform
'npc(val(balance)).ivala : Read&Write, Angle of platform (between -40 and 40) ; modify will change the angle
'npc(val(balance)).ivalb : Read-Only, Length of the platform (in blocks) ; modify will make the platform buggy, so don't do it



I hope it will be useful for you !
Attachments
install_balance.zip
Automatic installation (updated)
(2.16 KiB) Downloaded 83 times
balance.zip
Example of system (updated)
(4.7 KiB) Downloaded 119 times
Last edited by JDM on 16 Aug 2016, 9:54, edited 2 times in total.

Lx Xzit M
Moderator
Moderator
Lx Xzit M
Moderator
Moderator
Reputation: 137
Posts: 430
Joined: 9 Nov 2015
Website

Post #2by Lx Xzit » 15 Aug 2016, 3:36

I tested this and it was awesome! I didn't know we could do things like this in Tea. This will be very helpful in castle levels. Good job and great contribution!

BTW I do have a question, could you try to make the NSMBwii balancing platforms? (The ones that appears in the first castle). :P
VISIT MY YOUTUBE CHANNEL! LX XZIT

JDM M
Topic author, Nice citizen
Nice citizen
Avatar
JDM M
Topic author, Nice citizen
Nice citizen
Age: 18
Reputation: 2
Posts: 10
Joined: 14 Aug 2016

Post #3by JDM » 15 Aug 2016, 11:44

Hi ! Thank you for your answer, really encouraging :)

For information, there are 2 types of NPC : the one we can see which has no hitbox, and another which we can't see and have an hitbox of 2*2 ; the second NPC is here to make the platform tangible and enable climbing the platform without jumping, moreover I have to change the .advset of the displays npc to make them rotate and the positions of blocks.

Make the NSMBW platforms is a really challenge (because of change the center of platforms, the ropes, the angle of ropes & platforms) but I'll etudiate it and I hope I could do something good :P
After thinking a little, I have some ideas but notice that like in this system, you won't slip on the slope :/

Lx Xzit M
Moderator
Moderator
Lx Xzit M
Moderator
Moderator
Reputation: 137
Posts: 430
Joined: 9 Nov 2015
Website

Post #4by Lx Xzit » 16 Aug 2016, 0:21

I also noticed two things:
- The balancing system won't work with Link unless you press "down" key (though, almost no one uses Link so this isn't a big deal :P)
- If you run fast while the platform is inclined, you can go through the blocks:
Spoiler
Image

If you make the hitboxes solid, there will be a little bug, but if you don't, this may happen. Do you think you could fix this ^^? BTW you gave me an idea to make inclined platforms tangibles (I meant like the SMW diagonal resizeable blocks). :P
VISIT MY YOUTUBE CHANNEL! LX XZIT

JDM M
Topic author, Nice citizen
Nice citizen
Avatar
JDM M
Topic author, Nice citizen
Nice citizen
Age: 18
Reputation: 2
Posts: 10
Joined: 14 Aug 2016

Post #5by JDM » 16 Aug 2016, 9:38

Arf :/
About Link, the problem is that his hitbox is too high to detect him as "on the platform", so I add a "magic number" if the player is Link, it seems to work.
About the problem "pass through", I add a new layer of NPCs (140) 2 pixels below and it seems to work, I can't redo the bug with this fix, so I hope it is definitely fixed ^^.
The example is updated, I will change the installator by the way. Thanks for the feedback !

EDIT : Installator updated

Lx Xzit M
Moderator
Moderator
Lx Xzit M
Moderator
Moderator
Reputation: 137
Posts: 430
Joined: 9 Nov 2015
Website

Post #6by Lx Xzit » 18 Aug 2016, 7:06

Unfortunately the bug it's still here. :/
Anyway thank your for listening my suggestions and for try to fix it. :P
VISIT MY YOUTUBE CHANNEL! LX XZIT

Bulletbill510 M
Citizen
Citizen
Bulletbill510 M
Citizen
Citizen
Age: 19
Reputation: 3
Posts: 8
Joined: 17 May 2017

Post #7by Bulletbill510 » 24 May 2017, 23:28

I'm going to use this for my project (If that's fine with you and as long as I give credit to you). I'm trying to use the balance.bat file to install the balance system in my level but what am I doing wrong?
Steps of what I was doing:
1. I put the balance.bat in my level folder called "2-2" (Without quotation marks)
2. I open up balance.bat and then type the name of my level called 2-2 after the question mark and then I hit enter. (I typed it without the .lvl thing)
3. It then said that my level was not found, so is there something that I'm missing or doing wrong?


Return to “Script submission”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest