Show Posts

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.


Messages - Brixmon

Pages: 1 [2] 3 4 5 6 7 ... 10
16
Help / VCE - Item collection system, escape/generator win system
« on: October 29, 2017, 08:46:04 PM »
I've tried this before, but it always screws up in weird and occasionally hard to reproduce ways.

The basic outline is, I have a brick that, on minigame reset, gradually randomizes the locations of eight collectable items. These could be pages, gas cans, bepises, or what-have-you. The location randomization system I have works, but no matter how hard I try, the game can't seem to remember how many items were collected and refuses to act properly. For some reason, sometimes the game thinks that all have been collected and activates events pertaining to that on the very first item. I have no clue why.

Basically, these items are set to disappear onActivate and increment a variable related to the minigame, as well as tell some bricks to check how many items there are and
display them in either chat or centerprint. But it just doesn't work half the time, and this is strange because by every means I can see, it should work perfectly.

I'd provide a screenshot, but I haven't because I suspect my entire system is broken. But the VCE manual's no help, searching on the forums is no help, so I have to ask here.

Can someone just provide me with a system that...
  • Randomly unhides one of four bricks labeled item1a/b/c/d etc, and repeats this up to item8 every minigame reset
  • Upon clicking one, hides it and adds one item to the minigame's item count, displaying to everyone how many have been collected
  • Upon collecting all eight, enables events for either a generator that must be started to win the round or, ideally, enables an 'escape here' zonebrick that wins the round once all LIVING players enter the zone
I hope this isn't too much to ask. It seems simple to me, but VCE is messing it up in ways I can't even comprehend.

17
Add-Ons / Re: Blockland Glass 4.1
« on: October 29, 2017, 01:03:42 AM »
I have no idea what your problems are nor whether they're fixed or not. That's something you're going to have to figure out yourself.
Oh. It's been so long since I played BL before that I forgot whether or not the problems with Slayer were widespread. Nevermind then.

18
Add-Ons / Re: Blockland Glass 4.1
« on: October 29, 2017, 12:56:57 AM »
If I recall correctly, slayer has also done things like that before.
Ah. Well, while I do have Slayer, I think I've kept it to an old version due to problems with new ones.
Did those get fixed, or is current Slayer still buggy?

19
Add-Ons / Re: Blockland Glass 4.1
« on: October 29, 2017, 12:36:29 AM »
A few minutes ago, I had a prepper show up on my add-ons list. It animated about the same way that the prepper particle does, but I'm not sure where it came from.
Considering the time of year, it's probably a seasonal thing, but just in case, I thought I should ask. I suspect Glass probably does this, as it's the only add-on I can envision affecting the menu like that.

20
Modification Help / Re: Weapon won't fire anything
« on: October 27, 2017, 03:14:16 PM »
Yes, when the function executes it does your stuff, then parent:: stuff tells it to do the old function stuff, then it goes back to your code

Ie

Code: [Select]
function thing::onFire()
{
echo("a");
}

function blub::onFire()
{
echo("b");
parent::onFire();
echo("c");
}
(blub extends stuff)

Would print b, a, c

Also there's nothing wrong with making more topics if they are useful for the discussion of things
Alright, thanks!

21
Modification Help / Re: Weapon won't fire anything
« on: October 27, 2017, 02:11:46 PM »
Because firing a projectile is supposed to happen in the ::onFire function. You're overriding it and not calling a parent or writing your own projectile spawning code.
It should work if you just add Parent::onFire(%this,%obj,%slot); to it.
I'm... not quite sure where to add that. Sorry if this is obvious stuff.
Scratch that. Saw exactly what you're talking about somewhere else. Thanks!
Edit: So if I don't parent the onFire function, then it completely overrides the default onFire function, but if I add Parent::onFire(%this,%obj,%slot); , it instead adds my code to the existing function? Am I understanding this correctly?

22
Modification Help / Weapon won't fire anything
« on: October 27, 2017, 01:59:28 PM »
Someone tell me if posting this many help threads is against the rules or something. As far as I can tell, it isn't...

Soo... now I'm trying to get this weapon to work. It's an invisible weapon meant to work with the Ghast playertype located here: https://forum.blockland.us/index.php?topic=289735
But it doesn't fire anything. The Ghast usually animates properly- its face changes when it's supposed to fire, though sometimes it gets stuck in armAttack and doesn't go back to Root. Even spawning the Ghast Fireball projectile with events works properly- the particles are right, it flies right, and it explodes right.
But no matter how I change it, I can't seem to get it to fire. I have a feeling it's got something to do with the "Charge" state, which is meant to provide a delay before firing to replicate the Minecraft Ghast's chargeup time and give it time to make the sound before firing. But as far as I can tell, it's correct.
Code: [Select]
//GhastFireball.cs

//audio
datablock AudioProfile(GhastFireSound)
{
   filename    = "./ghastfire.wav";
   description = AudioClose3d;
   preload = true;
};

datablock AudioProfile(GhastExplodeSound)
{
   filename    = "./ghastexplode.wav";
   description = AudioDefault3d;
   preload = true;
};
datablock AudioProfile(GhastChargeSound)
{
   filename    = "./ghastcharge.wav";
   description = AudioClose3d;
   preload = true;
};

datablock ParticleData(GhastTrailParticle)
{
dragCoefficient      = 2.5;
gravityCoefficient   = -0.17;
inheritedVelFactor   = 0.8;
constantAcceleration = 0;
lifetimeMS           = 850;
lifetimeVarianceMS   = 500;
textureName          = "base/data/particles/cloud";
spinSpeed = 10.0;
spinRandomMin = -500.0;
spinRandomMax = 500.0;
colors[0] = "0.2 0.2 0.2 1";
colors[1] = "1 0.5 0 0.5";
colors[2] = "1 0.25 0 0.25";
colors[3] = "1 0 0 0";
sizes[0] = 1.15;
sizes[1] = 1.0;
sizes[2] = 1.2;
sizes[3] = 1.5;
times[0] = 0;
times[1] = 0.1;
times[2] = 0.8;
times[3] = 1;

useInvAlpha = false;
};

datablock ParticleEmitterData(GhastTrailEmitter)
{
   ejectionPeriodMS = 5; //2
   periodVarianceMS = 0;
   ejectionVelocity = 15;
   velocityVariance = 5;
   ejectionOffset   = 0;
   thetaMin         = 0;
   thetaMax         = 5;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "GhastTrailParticle";

   uiName = "Ghast Fireball Trail";
};

datablock ParticleData(GhastExplosionParticle)
{
dragCoefficient      = 3;
gravityCoefficient   = -0.5;
inheritedVelFactor   = 0.2;
constantAcceleration = 0.0;
lifetimeMS           = 700;
lifetimeVarianceMS   = 400;
textureName          = "base/data/particles/cloud";
spinSpeed = 10.0;
spinRandomMin = -50.0;
spinRandomMax = 50.0;
colors[0]     = "0.9 0.9 0.6 0.9";
colors[1]     = "0.9 0.5 0.6 0.0";
sizes[0]      = 10.0;
sizes[1]      = 15.0;

useInvAlpha = true;
};
datablock ParticleEmitterData(GhastExplosionEmitter)
{
   ejectionPeriodMS = 3;
   periodVarianceMS = 0;
   ejectionVelocity = 10;
   velocityVariance = 1.0;
   ejectionOffset   = 3.0;
   thetaMin         = 89;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "GhastExplosionParticle";

   uiName = "Ghast Explosion Smoke";
   emitterNode = TenthEmitterNode;
};


datablock ParticleData(GhastExplosionRingParticle)
{
dragCoefficient      = 8;
gravityCoefficient   = -0.5;
inheritedVelFactor   = 0.2;
constantAcceleration = 0.0;
lifetimeMS           = 40;
lifetimeVarianceMS   = 10;
textureName          = "base/data/particles/star1";
spinSpeed = 10.0;
spinRandomMin = -500.0;
spinRandomMax = 500.0;
colors[0]     = "1 0.5 0.2 0.5";
colors[1]     = "0.9 0.0 0.0 0.0";
sizes[0]      = 8;
sizes[1]      = 13;

useInvAlpha = false;
};
datablock ParticleEmitterData(GhastExplosionRingEmitter)
{
lifeTimeMS = 50;

   ejectionPeriodMS = 1;
   periodVarianceMS = 0;
   ejectionVelocity = 5;
   velocityVariance = 0.0;
   ejectionOffset   = 3.0;
   thetaMin         = 0;
   thetaMax         = 180;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "GhastExplosionRingParticle";

   uiName = "Ghast Explosion Flash";
};

datablock ExplosionData(GhastExplosion)
{
   explosionShape = "Add-Ons/Weapon_Rocket_Launcher/explosionSphere1.dts";
soundProfile = GhastExplodeSound;

   lifeTimeMS = 350;

   particleEmitter = GhastExplosionEmitter;
   particleDensity = 10;
   particleRadius = 0.2;

   emitter[0] = GhastExplosionRingEmitter;

   faceViewer     = true;
   explosionScale = "1 1 1";

   shakeCamera = true;
   camShakeFreq = "10.0 11.0 10.0";
   camShakeAmp = "3.0 10.0 3.0";
   camShakeDuration = 0.5;
   camShakeRadius = 20.0;

   // Dynamic light
   lightStartRadius = 10;
   lightEndRadius = 25;
   lightStartColor = "1 1 1 1";
   lightEndColor = "0 0 0 1";

   damageRadius = 4.5;
   radiusDamage = 125;

   impulseRadius = 6;
   impulseForce = 4000;
};


AddDamageType("Ghast");
datablock ProjectileData(GhastFireballProjectile)
{
   projectileShapeName = "base/data/shapes/empty.dts";
   directDamage        = 75;
   directDamageType = $DamageType::Ghast;
   radiusDamageType = $DamageType::Ghast;
   impactImpulse    = 500;
   verticalImpulse    = 500;
   explosion           = GhastExplosion;
   particleEmitter     = GhastTrailEmitter;

   brickExplosionRadius = 3;
   brickExplosionImpact = false;          //destroy a brick if we hit it directly?
   brickExplosionForce  = 30;             
   brickExplosionMaxVolume = 30;          //max volume of bricks that we can destroy
   brickExplosionMaxVolumeFloating = 60;  //max volume of bricks that we can destroy if they aren't connected to the ground (should always be >= brickExplosionMaxVolume)

   muzzleVelocity      = 65;
   velInheritFactor    = 1.0;

   armingDelay         = 00;
   lifetime            = 4000;
   fadeDelay           = 3500;
   bounceElasticity    = 0.5;
   bounceFriction      = 0.20;
   isBallistic         = false;
   gravityMod = 0.0;

   hasLight    = true;
   lightRadius = 8.0;
   lightColor  = "1 0.5 0.0";

   uiName = "Ghast Fireball";
};

//////////
// item //
//////////
datablock ItemData(GhastFireballItem)
{
category = "Weapon";  // Mission editor category
className = "Weapon"; // For inventory system

// Basic Item Properties
shapeFile = "base/data/shapes/empty.dts";
rotate = false;
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;

//gui stuff
uiName = "Ghast Fireball";
iconName = "./icon_GhastFireball";
doColorShift = false;
colorShiftColor = "1 1 1 1.000";

// Dynamic properties defined by the scripts
image = GhastFireballImage;
canDrop = true;
};

////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(GhastFireballImage)
{
   // Basic Item properties
   shapeFile = "base/data/shapes/empty.dts";
   emap = true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 0;
   offset = "0 0 0";
   eyeOffset = 0; //"0.7 1.2 -0.5";
   rotation = eulerToMatrix( "0 0 0" );

   // 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;

   // Add the WeaponImage namespace as a parent, WeaponImage namespace
   // provides some hooks into the inventory system.
   className = "WeaponImage";

   // Projectile && Ammo.
   item = GhastFireballItem;
   ammo = " ";
   projectile = GhastFireballProjectile;
   projectileType = Projectile;

//casing = GhastFireballShellDebris;
shellExitDir        = "1.0 -1.3 1.0";
shellExitOffset     = "0 0 0";
shellExitVariance   = 15.0;
shellVelocity       = 7.0;

   //melee particles shoot from eye node for consistancy
   melee = true;
   //raise your arm up or not
   armReady = false;
   
   doColorShift = false;
   colorShiftColor = GhastFireballItem.colorShiftColor;//"0.400 0.196 0 1.000";

   //casing = " ";

   // 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]             = 1;
stateTransitionOnTimeout[0]       = "Ready";
// stateSound[0] = weaponSwitchSound;

stateName[1]                     = "Ready";
stateTransitionOnTriggerDown[1]  = "Charge";
stateAllowImageChange[1]         = true;
stateSequence[1] = "Ready";

stateName[2]                     = "Charge";
stateTransitionOnTimeout[2]  = "Fire";
stateTimeoutValue[2]             = 0.6;
stateAllowImageChange[2]         = false;
stateSound[2] = GhastChargeSound;
stateSequence[2] = "Ready";

stateName[3]                    = "Fire";
stateTransitionOnTimeout[3]     = "CoolDown";
stateTimeoutValue[3]            = 0.1;
stateFire[3]                    = true;
stateAllowImageChange[3]        = false;
stateSequence[3]                = "Fire";
stateScript[3]                  = "onFire";
stateWaitForTimeout[3] = true;
stateSound[3] = GhastFireSound;
    stateSequence[3]                = "Fire";
//stateEjectShell[2]       = true;

    stateName[4] = "CoolDown";
    stateTimeoutValue[4]            = 0.3;
    stateTransitionOnTimeout[4]     = "Reload";
    stateSequence[4]                = "TrigDown";
   
    stateName[5] = "Reload";
stateTransitionOnTriggerUp[5]     = "Ready";
stateScript[5]                  = "onReload";
stateSequence[5] = "TrigDown";

};

function GhastFireballImage::onFire(%this, %obj, %slot)
{
%obj.playthread(2, armAttack);
}

function GhastFireballImage::onReload(%this, %obj, %slot)
{
%obj.playthread(2, root);
}

23
Modification Help / Re: How to mount an image to a player?
« on: October 26, 2017, 01:15:18 PM »
That sounds like a weird bug. I think that only happens on nondedicated servers.
No, I'm using a dedi to test this. I'm pretty sure it resends the player's appearance data whenever I save options, meaning that it would unhide nodes and change colors, causing the phase effect to vanish.

24
Modification Help / Re: How to mount an image to a player?
« on: October 26, 2017, 09:26:41 AM »
Okay, well, is there a way to refresh the appearance data/re-hide nodes every time the player uses the options menu? I don't want it to lose the phase effect...

25
Modification Help / Re: How to mount an image to a player?
« on: October 25, 2017, 02:07:21 AM »
Try changing up the state values: - This is ripped off from my shield add-on
Code: [Select]
datablock ShapeBaseImageData(YourImage : PlayerTeleportImage)
{
shapeFile = "shapefile.dts";
colorShiftColor = "0.0000 0.0000 0.0000 0.0000";
doColorShift = false;

stateName[0] = "Ready";
stateTransitionOnTimeout[0] = "Check";
stateTimeoutValue[0] = 0.1;

stateName[1] = "Check";
stateTransitionOnTimeout[1] = "Check";
stateWaitForTimeout[1] = true;
stateTimeoutValue[1] = 0.05;
stateEmitter[1] = "your emitter here";
stateEmitterTime[1] = 1;
//stateScript[1] = "onCheck";

mountPoint = $HipSlot;
};
Thanks, gonna try that, but I should also mention that the phase effect didn't work either. How can I apply that and have it stay?
EDIT: Heeey! The phase works now! Here's the code:
Code: [Select]
function PlayerCauchemar::onNewDatablock(%data, %obj)
{
    Parent::onNewDatablock(%data, %obj);
    %obj.unmountImage(2);
    %obj.mountImage(CauchemarImage,2);
    %obj.setNodeColor("ALL", "0 0 0 0");
}

I used this for a different playertype to turn it invisible, but that one lost the invisibility partially every so often. If that happens with Cauch here, how do I keep it there/refresh it periodically?

Edit: By now I think it's safe to say my problem has been solved. Thanks for the help, though!

26
Modification Help / How to mount an image to a player?
« on: October 24, 2017, 05:50:07 PM »
I just can't seem to get this to work. Like my previous two threads (I sincerely hope I'm not spamming...), I figure the problem must be simple, but it doesn't seem to work.
I cannibalized code from Ability Bots ( https://forum.blockland.us/index.php?topic=292925.0 ), specifically the Phase C bot, to try to get a similar effect.
I want a playertype that's phased and has an emitter attached to it, but the actual process of mounting the image seems different for players than bots.

Sorry to bother you again, forum! But can you help?

Code: [Select]
datablock PlayerData(PlayerCauchemar : PlayerStandardArmor)
{
uiName = "Cauchemar";
canJet = 0;
rechargeRate = 0;
showEnergyBar = false;
maxdamage = 9999;
};

datablock ParticleData(CauchemarParticle)
{
textureName          = "base/data/particles/dot";
dragCoefficient      = 0.0;
gravityCoefficient   = 0.0;
inheritedVelFactor   = 0.0;
windCoefficient      = 0;
constantAcceleration = 0;
lifetimeMS           = 1250;
lifetimeVarianceMS   = 0;
spinSpeed     = 0;
spinRandomMin = -90.0;
spinRandomMax =  90.0;
useInvAlpha   = false;

colors[0] = "0.32 0 1 1.0";
colors[1] = "0.49 0 1 0.85";
colors[2] = "0.74 0 1 0.0";

sizes[0] = 0.2;
sizes[1] = 0.15;
sizes[2] = 0.1;

times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};

datablock ParticleEmitterData(CauchemarEmitter)
{
   ejectionPeriodMS = 1;
   periodVarianceMS = 0;
   ejectionVelocity = -10.0;
   velocityVariance = 0.0;
   ejectionOffset   = 10.0;
   thetaMin         = 0;
   thetaMax         = 180;
   phiReferenceVel  = 720;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "CauchemarParticle";

   //useEmitterColors = True;
   useEmitterColors = False;

    uiName = "Cauchemar";
};

datablock ShapeBaseImageData( CauchemarImage )
{
shapeFile = "base/data/shapes/empty.dts";
emap = false;

mountPoint = 7;//$HeadSlot; //i want it to spawn the emitter on his torso, so instead of "4", a foot, it's "2", the torso
//alternatively i can set it to "7" for his pants

offset = "0 0 0";
rotation = "1 0 0 180";

stateName[0] = "Ready";
stateTransitionOnTimeout[0] = "FireA";
stateTimeoutValue[0] = 0.1;

stateName[1] = "FireA";
stateTransitionOnTimeout[1] = "Ready";
stateWaitForTimeout[1] = True;
stateTimeoutValue[1] = 0.1;
stateEmitter[1] = CauchemarEmitter; //wandExplosionEmitter; //PlayerJetEmitter;
//this is the only thing i'll change probably
//you can change the "A" to letters A-F
//those are all the emitters.
stateEmitterTime[1] = 1000;

// stateName[2] = "Done";
// stateScript[2] = "onDone";
};

function PlayerCauchemar::onAdd(%this,%obj)
{
armor::onAdd(%this,%obj);

%obj.mountImage( CauchemarImage, 2);

GameConnection::ApplyBodyParts(%obj);
GameConnection::ApplyBodyColors(%obj);

//this is the glitchy phase effect
//allows the bot to be a portal to the skybox
%obj.setNodeColor("ALL", "0 0 0 0");
}

27
Modification Help / Re: Command to make player play sound (again no GUI)
« on: October 22, 2017, 11:24:36 PM »
That is good. In some weapon addons they do use playAudio on a player object if you are wondering where it can be.
Initially I had planned to try making a bunch of copies of the Alarm emote with no particles, and let the command mod do the randomization for me... but I knew that was a horrible workaround for something that must've been simple, so I tried this. Spawning a bunch of explosions probably wasn't the way to do it.
Not much else to talk about here though, so I'll just thank you  two again for your help and lock it!

28
Modification Help / Re: Command to make player play sound (again no GUI)
« on: October 22, 2017, 11:21:00 PM »
Remember, try to learn the code before you test it, definitely will help with your experience
I think that a part of the reason why I had trouble with this is that I don't know of any addons that make the player simply play sounds on command, so I had nothing to directly reference. All I could think to do was cobble something together, which I knew probably wouldn't work.
One day I'll probably figure this out. I think I get how the code is structured, I feel like I moreso need to just know... specific strings. Like that client.player thing.

29
Modification Help / Re: Command to make player play sound (again no GUI)
« on: October 22, 2017, 11:14:57 PM »
-scissors-

Thanks for the help, that worked. I knew from the start that this was simple, as I pretty much copied the code. I also knew that probably wouldn't work, but I didn't know what else to do.
Thing is, I don't know the names of default variables or functions, nor what they do. The reference site I went to only seems to list them, not explain them.
I also haven't found any references for that sort of thing anywhere, which has made figuring out basic stuff like this very difficult. But that's neither here nor there- thanks a lot for the help!

30
Modification Help / Command to make player play sound (again no GUI)
« on: October 22, 2017, 10:03:02 PM »
Hey! I've got another problem here.
Pretty much the same as what I needed before, but even simpler, and for sound files this time.

This is probably a dumb question, the answer to which should be obvious to those more experienced than I, but alas, I can't decipher bldoc.nullable.se to find the information I seek, soo...

For the same reasons as before, I want to make a /command to make the player(not the client or server) play a 3d sound. Specifically, I was trying to make it randomly select a sound from a list, which I sampled Player_Overwatch for, since that Tracer playertype can play multiple random sounds for its blink ability. But I obviously messed something simple up here, I just don't know what it is.

This is the test addon's code in its entirety.

Code: [Select]
//Emote_Alarm.cs

datablock AudioProfile(chrys_scream1Sound)
{
filename = "./chrys_scream1.wav";
description = AudioClosest3d;
preload = false;
};

datablock AudioProfile(chrys_scream2Sound : chrys_scream1Sound)
{
filename = "./painis_2.wav";
};

datablock AudioProfile(chrys_scream3Sound : chrys_scream1Sound)
{
filename = "./duckn_alert.wav";
};

datablock AudioProfile(chrys_scream4Sound : chrys_scream1Sound)
{
filename = "./skel_buzz_skeletonalarm.wav";
};

function serverCmdhorrortest(%client)
{
if(isObject(%client.player))
%pl.schedule(1,playAudio,4,chrys_scream @ getRandom(1,4) @ Sound);
}

Clearly a simple error, as the console spits this out when I try the test command.

Quote
Add-Ons/Script_PlayerHorrorSounds/horrorsounds.cs (0): Unable to find object: '' attempting to call function 'schedule'
BackTrace: ->serverCmdhorrortest
And of course, it doesn't play the sound. To clarify, I did check that the sounds worked. They do... even though it took me like two days to figure out that they had to be 16-bit PCM wavs.

Pages: 1 [2] 3 4 5 6 7 ... 10