Cuberite Forum
Worldedit [Creating one myself :)] - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Requests (https://forum.cuberite.org/forum-3.html)
+--- Thread: Worldedit [Creating one myself :)] (/thread-567.html)

Pages: 1 2


Worldedit [Creating one myself :)] - NiLSPACE - 10-04-2012

can someone create a look-a-like of worldedit? because Cuboidplus doesn't work anymore Sad


RE: Worldedit - xoft - 10-04-2012

I'm not familiar with either, could you perhaps describe the functionality that you want? Not "like XYZ", but "Do X, then Y, and the plugin creates Z"


RE: Worldedit - NiLSPACE - 10-04-2012

just like with world edit. you can use something like a wooden axe or something with that you can select points, and then you can use //walls and //set and //replace etc (can also be other commands)


RE: Worldedit - xoft - 10-04-2012

I have never seen worldedit, so you'll need to be a tad more specific. That is, if I were to make a plugin. Which I probably won't, anywayTongue


RE: Worldedit - NiLSPACE - 10-04-2012

made a video. thats better than words. Smile




RE: Worldedit - NiLSPACE - 10-05-2012

Was the video usefull? Smile


RE: Worldedit - xoft - 10-05-2012

I don't like videos, because even when you need to find only one tiny little detail, you still need to watch them full time. Also, not being searchable, copyable or archivable... But hey, as I said, I'm very unlikely to make any plugin, so perhaps someone else will find it usefulTongue


RE: Worldedit - Taugeshtu - 10-05-2012

Why won't you try to write a plugin on your own? (By this I mean "I'm not interested"Big Grin)
API is quite easy, Lua is stupiditly easy, and whole programming thing is basically just "all right, to do X I need to do Y, then Z". Where Y and Z are what computer is capable for.

Try some basic stuff, like creating a block where player stand by a command. Look at other plugins code (I do a lot!) - like Core, sTick, Rainy. Feel free to ask Smile

P.S.
Probably we'll have your enthusiasm to fill wiki up to dateBig Grin


RE: Worldedit - NiLSPACE - 10-06-2012

ok i tried like you said with creating a block where you stand and i have this:
function Initialize( Plugin )
	PLUGIN = Plugin
	
	Plugin:SetName( "PlaceHere" )
	Plugin:SetVersion( 1 )
	
	PluginManager = cRoot:Get():GetPluginManager()
	PluginManager:AddHook( Plugin, cPluginManager.E_PLUGIN_CHAT )
	
	Plugin:AddCommand("/PlaceHere",         " - Places a block where you stand",                 "PlaceHere.PlaceHere")
	
	Plugin:BindCommand( "/PlaceHere",            "PlaceHere.PlaceHere",            HandlePlaceHereCommand )
	Plugin:BindCommand( "/ph",                   "placehere.placehere",            HandlePlaceHereCommand )
	
	
	function HandlePlaceHereCommand( Split, Player)
	
	local World = cRoot:Get():GetDefaultWorld()
	local Name  = Player:GetName()
	
	IncrementUndoGroup( Name )
		
		X = mFloor(Player:GetPosX())
		Y = mFloor(Player:GetPosY())
		Z = mFloor(Player:GetPosZ())
			
		if Y ~= -1 then
			CuboidBlockPlace(X, Y, Z, fillBlock, 1, Name)
			Server:SendMessage( cChatColor.Green .. "Block placed at: ".. cChatColor.White .." X:" ..X.. " Y:" ..Y.. " Z:" ..Z.. "", Player )
		end
	end
	return true
end

LOG( "Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion() )
    return true
end
it says that there is an error close to the last "end"


RE: Worldedit - xoft - 10-06-2012

You didn't end your Initialize function with an "end" statement.

Use indentation to help you - after every "function", "if", "for", indent by one tab more; after each end, indent one tab less. Also, you do not want to declare your functions inside other functions (that's an advanced topic and you don't need it yet).