31
Gallery / Re: (WIP) Ski Lodge.
« on: November 02, 2014, 09:12:12 AM »
Woah, fancy. I love the brick columns next to those arches.
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.
function harold(%this) {
echo("you called me!");
} //END WITH CURLY BRACES
datablock PlayerData(defaultfootprintParticle){
diffuseMap[0] = "footprint";
vertColor[0] = true;
translucent = true;
castShadows = "0";
translucentZWrite = "1";
materialTag0 = "Player";
decalOffset = "1";
dustEmitter = "1";
footPuffEmitter = "1";
footPuffNumParts = "1";
footPuffRadius = "5.0";
};
function serverCmdDFPrint(%player) {
//do you want to assign this to the player here?
}
Also I believe those animations are playing on the character itself, and I can tell you the default Blockland characters don't have those animations. Have you tried using %this instead?I'll have a go, thanks.
stateSequence[2] = "firecrackerThrow";
in the states of the weapon.Well you're trying to play fireCrackerReady and the two animation sequences I see are Charge and fireCrackerThrow. Last I checked Ready !$= Throwoh sorry i cut that part out, even after re-naming these parts within the script; the animation won't play. (updated code below)
function firecrackerImage::onAbortCharge(%this, %obj, %slot)
{
%obj.playthread(2, root);
}
function firecrackerImage::onCharge(%this, %obj, %slot)
{
%obj.playthread(2, firecrackerThrow);
}
function firecrackerImage::onFire(%this, %obj, %slot)
{
%obj.playthread(2, firecrackerThrow);
Parent::onFire(%this, %obj, %slot);
}
stateName[2] = "Charge";
stateTransitionOnTimeout[2] = "Armed";
stateTimeoutValue[2] = 0.8;
stateWaitForTimeout[2] = false;
stateTransitionOnTriggerUp[2] = "AbortCharge";
stateScript[2] = "onCharge";
stateAllowImageChange[2] = false;
};
function firecrackerImage::onCharge(%this, %obj, %slot)
{
%obj.playthread(2, firecrackerReady);
}
function firecrackerImage::onAbortCharge(%this, %obj, %slot)
{
%obj.playthread(2, root);
}
Any comments? - From JC2IS THAT TRIANGULATION ON THE HANDLE?
-snip-
So you have a global array of maps, and transformations for each of the maps, and you're trying to get both of these variables out of a single function? - This is correctThank you so much, I knew I could've done it smaller but I didn't know you could do it that way.
You can concatenate the two variables and return that, then unconcatenate it to get the variables out.
return $map[0] NL $tele[0];
And then %mapData = random(); %map = getRecord(%mapData, 0); %transform = getRecord(%mapData, 1);
Also, you can seriously optimize this by using $map[%random] as opposed to checking each number, of course this wouldn't check if it exists.
And return doesn't need brackets, its not a function.
echo(getField(NL %secondstring));
another edit: i am an idiot, getRecord( sourceString , index ); (from the torquescript wiki) does this
$tele[1] = "152.596 101.372 1.01 0 0 -1.00001 0.102687"; //teleport location for apartment save
$tele[2] = "-53.6 -68.24 21.5 0 0 1 1.6"; // teleport location for arch of constantine save
$map[0] = "Apartment.bls"; // apartment save file
$map[1] = "Arch of Constantine.bls"; //arch save file
function random(%map, %randomTp) {
%random = getRandom(1,2); // random number between 1 and 2
// random map
switch (%map) {
case 1:
return ($map0);
case 2:
return ($map1);
default:
}
//set teleport to be same as map
%randomTp = %random;
switch (%randomTp) {
case 1:
return ($tele[0]);
case 2:
return ($tele[1]);
default:
}
}
function loadBrix() {
schedule(0, 0, serverDirectSaveFileLoad, "saves/" @ random(%map), 3, "", 2, 1);
findclientbyname("Arix").player.setTransform(random(%randomTp));
}
(forgive my formatting)