Author Topic: Butterfly and other scripted images  (Read 3616 times)

So you're using parametric equations and algebraic expressions to create floating bricks that form a 3D shape?

This, my good sire, is a very good find.

I concur. We must do this.


What would the exact steps be to produce this?


What would the exact steps be to produce this?

1) Create a folder in your add-ons folder, call it something like "Script_MyFirstScript".  The path to this folder should now look like:
C:\Program Files\Blockland\Add-Ons\Script_MyFirstScript.
2) In this Folder, create a description.txt file.  The contents of this file look like this:

Title: Script
Author: Elvis Presley
A Script

3) Create a new file, called namecheck.txt.  I've made the contents of this file to be:
Script_MyFirstScript

4) The last, and most important, are a file called script.cs -- create this file with notepad as well.  The contents of this file are what you need to make a scripted pattern work:

for( %i = 0 ; %i < 1000 ; %i++ )
{


%a=0.5;

%posx = 2*%a*mCos(%i)+%a*mCos(2*%i);
%posz = 2*%a*mSin(%i)-%a*mSin(2*%i);
%posy = 1;

%temp = new fxDTSBrick()
   {
    datablock = "brick1x1Data";
    position = 50*%posx SPC %posy SPC 50*%posz;
    rotation = "0 0 0 0";
    colorID = "16";
    scale = "1 1 1";
    angleID = "0";
    colorfxID = "0";
    shapefxID = "0";
    isPlanted = 1;
   };


}


5) Start up Blockland.  Choose the "Construct" game.  Select "Script_MyFirstScript" in the add-on list, otherwise it won't run.

That's it! 

Can you post a download of that; My Blockland is not finding the add-on in the check list.

What is the name that you are giving the folder?
You probably have it done right, just make sure that the name of your folder has a little underscore in it, like Script_MyFirstScript
That's important, otherwise the game won't find it.
Another thing is to make sure that your server.cs file is actually a .cs file and not a .cs.txt file (that's a common enough error).

Tom

I think you need to learn what a function is.

I'm pretty sure that spawning bricks before the game is loaded isn't the best idea.

It looks as if they are 3-D models, seeing some rotation, and your shadow.

I think you need to learn what a function is.

I'm pretty sure that spawning bricks before the game is loaded isn't the best idea.

That's simple enough to change -- so instead of having the bricks getting created when the map gets loaded, the bricks can get created when you call a function.  That takes two seconds to change.

This is really cool, trying my hand at it now.

Cool!

You should stick around.

This is indeed awesome.

I remember back in v0002 when brick scripting took on many unique qualities.

Damn, this guy has been here for 10 days and he has already done something that no one has ever thought of and that is better than most people's add-ons. I have great expectations for this one....

This is indeed awesome.

I remember back in v0002 when brick scripting took on many unique qualities.
The the TBM thing?  :cookieMonster: