Blockland Forums > Modification Help
team to make guitar
(1/10) > >>
Ladios:
well this idea is based off of guitar hero sorta
what i plan to do is have a guitar that will play notes (and possibly songs later)

what i need is someone to model it (MODEL MUST WORK) and maybe some experianced coder to assist or whatever.. and eventually someone with too much time on their hands to make the codes

basically when you take it out it puts the player into a state that reassigns the buttons
i was thinking Q W E and R to play the basic notes
the left arrow or right arrow, wehn held down, will shift the selection lower or higher leaving a total of 12 possible notes (not including chords or whatever)

so when the note is played it will play a guitar note sound corrisponding to which note was hit
fairly simple in idea

the trick will come later in making the songs and gui so the player can play the song but until then i am hoping to get at least a little help so i can get this thing off te ground
Masterlegodude:
I can model it, but not code it

Can i help with the model?
Ladios:
all help is welcome
the main coding thing i want help on is how to make it so the player now is only playing notes after clicking when guitar is out then clicking again stops playing notes, i have an idea that this would work somewhat like skis but i really am lost
Masterlegodude:
Yeah, it don't work, dunno why, is very odd, no?


--- Code: ---//Guitar by [SS]Masterlegodude[AG]
datablock ParticleData(guitarParticleA)
{
   dragCoefficient      = 0;
   gravityCoefficient   = 0;
   inheritedVelFactor   = 1;
   constantAcceleration = 0.0;
   spinRandomMin = -90;
   spinRandomMax = 90;
   lifetimeMS           = 100;
   lifetimeVarianceMS   = 20;
   textureName          = "base/data/particles/star1";
   colors[0]     = getrandom(0,1000) / 1000 SPC getrandom(0,1000) / 1000 SPC getrandom(0,1000) / 1000 @ " 0.500";
   colors[1]     = getrandom(0,1000) / 1000 SPC getrandom(0,1000) / 1000 SPC getrandom(0,1000) / 1000 @ " 0.500";
   sizes[0]      = 0.3
   sizes[1]      = 0.05;
};

datablock ParticleEmitterData(guitarEmitterA)
{
   ejectionPeriodMS = 1;
   periodVarianceMS = 0;
   ejectionVelocity = 6;
   velocityVariance = 1.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 180;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "guitarParticleA";
};

datablock ParticleData(guitarParticleB)
{
   dragCoefficient      = 0;
   windCoefficient     = 0;
   gravityCoefficient   = 0;
   inheritedVelFactor   = 0.0;
   constantAcceleration = 0.0;
   spinRandomMin = -90;
   spinRandomMax = 90;
   lifetimeMS           = 800;
   lifetimeVarianceMS   = 200;
   textureName          = "base/data/particles/star1";
   colors[0]     = "1 1 1 1";
   colors[1]     = "0.2 0.2 1 0";
   sizes[0]      = 0.1;
   sizes[1]      = 0.05;
};

datablock ParticleEmitterData(guitarEmitterB)
{
   ejectionPeriodMS = 1;
   periodVarianceMS = 0;
   ejectionVelocity = 0;
   velocityVariance = 0.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 180;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "guitarParticleB";
};

datablock ExplosionData(guitarExplosion)
{
   //explosionShape = "";

   lifeTimeMS = 150;

   particleEmitter = guitarEmitterA;
   particleDensity = 10;
   particleRadius = 0.2;

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

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

   // Dynamic light
   lightStartRadius = 0;
   lightEndRadius = 0;
   lightStartColor = "0 0 0 0";
   lightEndColor = "0 0 0 0";

   damageRadius = 4;
   radiusDamage = 70;

   impulseRadius = 6;
   impulseForce = 800;
};


AddDamageType("guitarDirect",   '<bitmap:add-ons/ci/generic> %1',    '%2 <bitmap:add-ons/ci/generic> %1',1,1);
AddDamageType("guitarRadius",   '<bitmap:add-ons/ci/generic> %1',    '%2 <bitmap:add-ons/ci/generic> %1',1,0);
datablock ProjectileData(guitarLauncherProjectile)
{
   //projectileShapeName = "";
   directDamage        = 40;
   directDamageType = $DamageType::guitarDirect;
   radiusDamageType = $DamageType::guitarRadius;
   impactImpulse    = 1000;
   verticalImpulse    = 1000;
   explosion           = guitarExplosion;
   particleEmitter     = guitarEmitterB;

   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)

   sound = guitarLoopSound;

   muzzleVelocity      = 100;
   velInheritFactor    = 0.0;

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

   hasLight    = false;
   lightRadius = 0.0;
   lightColor  = "1 0.5 0.0";
};

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

// Basic Item Properties
shapeFile = "Add-Ons/shapes/Guitar.dts";
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;

//gui stuff
uiName = "Guitar";
iconName = "./ItemIcons/bow";
doColorShift = true;
colorShiftColor = "0.3 0.3 0.3 1";

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

datablock ShapeBaseImageData(guitarImage)
{
   // Basic Item properties
   shapeFile = "Add-Ons/shapes/Guitar.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 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;

   eyeOffset = "0 0 0";

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

   // Projectile && Ammo.
   item = guitarItem;
   ammo = " ";

   //melee particles shoot from eye node for consistancy
   melee = false;
   doRetraction = false;
   //raise your arm up or not
   armReady = true;

   //casing = " ";
   doColorShift = true;
   colorShiftColor = "0 0 0 1";

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

stateName[1]                     = "Ready";
stateTransitionOnTriggerDown[1]  = "PreFire";
stateAllowImageChange[1]         = true;

stateName[2] = "PreFire";
stateScript[2]                  = "onPreFire";
stateAllowImageChange[2]        = false;
stateTimeoutValue[2]            = 0.1;
stateTransitionOnTimeout[2]     = "Fire";

stateName[3]                    = "Fire";
stateTransitionOnTimeout[3]     = "CheckFire";
stateTimeoutValue[3]            = 0.2;
stateFire[3]                    = true;
stateAllowImageChange[3]        = false;
stateSequence[3]                = "Fire";
stateScript[3]                  = "onFire";
stateWaitForTimeout[3] = true;
//stateTransitionOnTriggerUp[3] = "StopFire";

stateName[4] = "CheckFire";
stateTransitionOnTriggerUp[4] = "StopFire";
stateTransitionOnTriggerDown[4] = "Fire";


stateName[5]                    = "StopFire";
stateTransitionOnTimeout[5]     = "Ready";
stateTimeoutValue[5]            = 0.2;
stateAllowImageChange[5]        = false;
stateWaitForTimeout[5] = true;
stateSequence[5]                = "StopFire";
stateScript[5]                  = "onStopFire";
};

function guitarImage::onPreFire(%this, %obj, %slot)
{
%obj.playthread(2, armattack);
}

function guitarImage::onStopFire(%this, %obj, %slot)
{
%obj.playthread(2, root);
}
--- End code ---
Space Guy:
Won't the random colour thing at the start just choose one colour and then keep using that, rather than a different one each time?
Navigation
Message Index
Next page

Go to full version