Cuberite Forum
MCSmash/Super Smash Craft Beta (Bug fixes! Per-arena item management!) - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Releases (https://forum.cuberite.org/forum-2.html)
+---- Forum: Archived Plugins (https://forum.cuberite.org/forum-18.html)
+---- Thread: MCSmash/Super Smash Craft Beta (Bug fixes! Per-arena item management!) (/thread-1734.html)

Pages: 1 2


MCSmash/Super Smash Craft Beta (Bug fixes! Per-arena item management!) - DiamondToaster - 01-19-2015

That one plugin probably only one or two of you have been waiting for. I bring you Super Smash Bros. in Minecraft. It follows the basic mechanics of the original games but in a 3D plane.

-- How to use: --

Well, first you need a place to brawl, right?

But before that, stand on the spot where you want players to respawn after being eliminated, then do:

/setlobby

This is pretty self-explanatory.

NOW you can build an arena.

Create a new world with a fighting field preferably atleast 20x20 and 40 blocks above the ground. Place a 3x3 wide section of note blocks 2 blocks under the spawn point (Needed for music to work correctly). Stand in the center where you would like the players to respawn. (I recommend WorldEdit to make the arena using /up 0 to build a platform off of.) Now type:

/createarena <Name of the stadium> <Inner boundary radius where players respawn (preferably the entirety of the solid ground)> <Outer radius (How far they fly before being knocked out)>

Now type: /listarenas

Your newly made stadium should be listed there.
Multiple arenas can be in a single world.

To enter that newly made stadium and start fighting, do /joinsmash <Name of arena>

Controls:

* Right-click with the given Diamond Sword to Double-Jump in the air/Triple-Jump off the ground
* That's about it, beat the dust out of anyone you see in sight. Big Grin
* Also, there are item drops. Currently, there are golden apples (Invincibility Stars) and the Diamond Axe (The Dreaded Hammer. Big Grin)

There are several known bugs that I have yet to fix, all of them relatively minor. This plugin in my opinion is ready for testing.

I would VERY much appreciate it if someone could host a server with it so we can try out some mass multiplayer with this. Big Grin Screenshots may be coming soon.

EDIT: PLEASE do not use this version as it is severely outdated. Use the second version of the plugin found here.
https://forum.cuberite.org/showthread.php?tid=1839


RE: MCSmash/Super Smash Craft Beta - NiLSPACE - 01-19-2015

Cool, another minigameBig Grin

I manged to create an actual double jump some time ago. If I remember correctly the code looked something like this:
-- This goes somewhere where the player would join the arena
Player:SetCanFly(true)



-- The OnPlayerMoving hook
function OnPlayerMoving(a_Player, a_OldPosition, a_NewPosition)
	-- I don't know how your plugin checks if the player has joined an arena, so I'll do this for now.
	if (not IsInArena(a_Player)) then
		return false
	end
	
	-- Check if the player is flying
	if (not a_Player:IsFlying()) then
		return false
	end
	
	a_Player:SetFlying(false)
	a_Player:SetSpeedY(10) -- Set a proper jump height here
end



RE: MCSmash/Super Smash Craft Beta - DiamondToaster - 01-19-2015

Oh wow, nice. Smile Mind if I eventually replace the right-click with the space double-jump? I could use the sword block for the shield.

And to anyone who wants to modify it or anything, PLEASE do it, its kind of sloppily written.


RE: MCSmash/Super Smash Craft Beta - NiLSPACE - 01-19-2015

Of course Smile

Keep in mind that it relies on players starting to fly, so you might have to press space 3 times in total.


RE: MCSmash/Super Smash Craft Beta - DiamondToaster - 01-19-2015

Oh ok, I'll take that into consideration. Smile

Also, a glitch I can't seem to fix involves Players not teleporting when Player:SetPosition() is used. Replacing it with Player:TeleportToCoords() works, but instant teleportation would be very much useful.


RE: MCSmash/Super Smash Craft Beta - NiLSPACE - 01-19-2015

TeleportToCoords should be the function you're looking for.. I don't even know why SetPosition is exported to the Lua API anyway. Maybe @xoft can shed some light?


RE: MCSmash/Super Smash Craft Beta - DiamondToaster - 01-19-2015

The thing about TeleportToCoords is that it takes some ticks to actually get to the destination it seems because its like throwing an enderpearl, you just accelerate really fast in that direction. So while its teleporting, it checks every tick if the player is out of bounds. If the player is still out there on the second tick, he loses more than one life before respawning. So something like direct position control would be nice. Confused


RE: MCSmash/Super Smash Craft Beta - NiLSPACE - 01-19-2015

Actualy the TeleportToCoords function uses the cEntity:SetPosition function, but it also broadcasts it to every player: https://github.com/mc-server/MCServer/blob/master/src/Entities/Entity.cpp#L1633-L1637


RE: MCSmash/Super Smash Craft Beta - DiamondToaster - 01-19-2015

Oh ok, so thats just kind of my fault. I probably should find a way around that. I just checked if the player was invincible, and if he was, no lives would be taken away. So right after the first contact with the outer boundary, I would set the players invincible ticks to 5. Unfortunately, the invincibility powerup kind of interferes with that so the guy who's invincible can't lose any lives whether he fell off or not.


RE: MCSmash/Super Smash Craft Beta - tonibm19 - 01-19-2015

Good, but...
Does this plugin add a knockback depending on player damage?
I mean, in Smash Bros is your damage is 300% a hit and you "fly"