256
Modification Help / Re: Timescale tweaks SOON to be released
« on: September 27, 2015, 11:30:52 PM »
Oh that could be pretty neat! Nice one
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
erm, I found bricks made with DTS objects easiest to understand.different strokes for different folks yoCode: [Select]datablock StaticShapeData(AnvilShape) //Name of your model datablock.
{
shapefile="./shapes/anvil.dts"; //Points to your model.
};
datablock fxDtsBrickData(AnvilBrickData) //Datablock of your brick.
{
category="RPG"; //Category. Can be anything you want. This is the tab in the brick menu.
subCategory="Functional"; //Subcat in the tab mentioned in category.
uiName="Anvil"; //Name you'll see under the icon.
iconName = "./icons/unknown"; //Icon shown in the brick menu.
brickSizeX=2; //X size of your brick.
brickSizeY=5; //Y size of your brick.
brickSizeZ=6; //Z size of your brick.
//Is a prop!
isProp=1; //To avoid making the model mounting code ourselves, we're going to use System_Propsys. This varible tells the prop system that it's a prop and has a model to mount.
//Brick
brickRender=0; //If we render the brick, we will see the model inside of the blb brick. We have to disable it.
brickCollide=1;
brickRaycast=1;
spawnModel=AnvilShape; //Name of your model.
modelOffset="-0.3 0 0"; //Offset it so it's in place where you want it.
modelScale="2 2 2"; //Scale it to the size you want.
colorCount=1; //I am unsure about this but it gave me a syntax error if it wasn't here.
colorGroup[0]="ALL";
colorMode[0]="Intensity"; //Modifies the color of the model if you didn't give it a texture.
colorShift[0]="1 1 1 1"; //Modifies the color of the model if you didn't give it a texture.
};
//////////
// item //
//////////
datablock ItemData(swordItem)
{
category = "Weapon"; // Mission editor category
className = "Weapon"; // For inventory system
// Basic Item Properties
shapeFile = "./sword.dts";
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;
//gui stuff
uiName = "Sword"; //this is what it will be called in the wrench box and inventory
iconName = "./icon_sword"; //this is an icon image file for the inventory
doColorShift = true; //same as shapebaseimagedata, check the comment there
colorShiftColor = "0.471 0.471 0.471 1.000";
// Dynamic properties defined by the scripts
image = swordImage; //this is tying to shapebaseimagedata
canDrop = true; //whether you can throw it away or not using ctrl W
};
////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(swordImage)
{
// Basic Item properties
shapeFile = "./sword.dts"; //the model that will be used
emap = true; //no idea
// Specify mount point & offset for 3rd person, and eye offset
// for first person rendering.
mountPoint = 0; //0 is the right hand
offset = "0 0 0"; //offset changes where the center of the model is in relation to the mount point
// When firing from a point offset from the eye, muzzle correction
// will adjust the muzzle vector to point to the eye LOS point.
// Since this weapon doesn't actually fire from the muzzle point,
// we need to turn this off.
correctMuzzleVector = false;
eyeOffset = "0.7 1.2 -0.25"; //where abouts on your screen you see the item in 1st person. dont use this if you want it to just be where it naturally is
// Add the WeaponImage namespace as a parent, WeaponImage namespace
// provides some hooks into the inventory system.
className = "WeaponImage";
// Projectile && Ammo.
item = swordItem; // this links to the ItemData datablock
ammo = " ";
projectile = swordProjectile; //this is the projectile that will be fired when statefire is true in an image state
projectileType = Projectile; //the projectile is a projectile I guess..
//melee particles shoot from eye node for consistancy
melee = true;
doRetraction = false;
//raise your arm up or not
armReady = true;
//casing = " ";
doColorShift = true; //if you have any alpha textures on the model you can tint or colour them here
colorShiftColor = "0.471 0.471 0.471 1.000";
// Images have a state system which controls how the animations
// are run, which sounds are played, script callbacks, etc. This
// state system is downloaded to the client so that clients can
// predict state changes and animate accordingly. The following
// system supports basic ready->fire->reload transitions as
// well as a no-ammo->dryfire idle state.
// Initial start up state
stateName[0] = "Activate";
stateTimeoutValue[0] = 0.5;
stateTransitionOnTimeout[0] = "Ready";
stateSound[0] = swordDrawSound; //when it is activated, the sword draw sound is played, then it takes half a second to be ready
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "PreFire"; //now it is ready, when the mouse is clicked ("transition on trigger down") it goes to prefire.
stateAllowImageChange[1] = true; //this line means you can change the weapon / tool you're wielding to something else while the weapon is in this state
stateName[2] = "PreFire";
stateScript[2] = "onPreFire"; //ties to the function swordImage::onPrefire
stateAllowImageChange[2] = false; //you can no longer change what you're wielding until this state is finished
stateTimeoutValue[2] = 0.1;
stateTransitionOnTimeout[2] = "Fire"; //in 1 tenth of a second it goes to the "fire" state
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "CheckFire";
stateTimeoutValue[3] = 0.2; //in a fifth of a second it goes to checkfire
stateFire[3] = true; //it shoots a projectile in this state
stateAllowImageChange[3] = false; //you still can't change weapons in this state
stateSequence[3] = "Fire"; //the sword animates since in first person it wouldn't move since the eyeOffset was changed to a custom value
stateScript[3] = "onFire"; //ties to function swordImage::onFire
stateWaitForTimeout[3] = true; //the timeout can't be circumvented
stateName[4] = "CheckFire";
stateTransitionOnTriggerUp[4] = "StopFire"; //if they have let go of the left mouse button, it stops swinging
stateTransitionOnTriggerDown[4] = "Fire"; //if they still have the mouse button down then it keeps swinging
stateName[5] = "StopFire";
stateTransitionOnTimeout[5] = "Ready";
stateTimeoutValue[5] = 0.2;
stateAllowImageChange[5] = false;
stateWaitForTimeout[5] = true;
stateSequence[5] = "StopFire"; //stop swinging animation
stateScript[5] = "onStopFire"; //links to swordImage::onStopFire
};
function swordImage::onPreFire(%this, %obj, %slot)
{
%obj.playthread(2, armattack); //animates the players arm up and down
}
function swordImage::onStopFire(%this, %obj, %slot)
{
%obj.playthread(2, root); //resets the players arm
}Important to note that when messing about with image states, always check the bracketed numbers if there's a problem. Couldn't tell you how many times I've pasted a line and not changed the number
stateScript[#] = ""; lines, with player animations (arm swing in swords example) or item usage being the most popular functions to tie in with the states. So function weaponImage::onFire would be tied to stateScript[3] = "onFire"; as an example off the top of my headI was joking.Don't make me paranoid D:
Seems very reminiscent of "Blockland Project Creators" ...In what way? :)
Wow, an unexpected comeback!Reports of my death have been greatly exaggerated :D
did u fix the death glitch?A loooooooooooooong time ago :)

