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 - Wheatley

Pages: 1 ... 134 135 136 137 138 [139] 140 141 142 143 144 ... 148
2071
Modification Help / Re: Is this incorrect?
« on: July 22, 2011, 08:29:43 PM »
is that correct? or is it
                                   }
                                   return;
                                   {

Under the if(%client.isSuperAdmin), change the "}" to "{"(new line, same justification) "}".

I also might recommend that you change it to if(!%client.isSuperAdmin), and then swap out the else{<stuffhere>} and put it under the first if.
also, at the end, take off the ";" and move the last bracket over so it's aligned with the very first.

2072
Modification Help / Re: Is this incorrect?
« on: July 22, 2011, 08:25:13 PM »
Though this isn't really the forums section for this...
There's plenty of online tools to check and update your video drivers.
Does the graphics section of dxdiag just have blank results? Either way, you should be able to find what you have in the control panel.

Intel also has a nice tool for checking your video drivers, but that might only apply to intel chips.

2073
Modification Help / Re: Changing Player list database?
« on: July 22, 2011, 08:14:46 PM »
Do you mean the message the server gets when someone becomes admin?

In that case, Badspot could have typed this into the console:

messageAll('msgAdminForce', "\c2Ehpialtes has become Super Admin (Manual)");

But I doubt Eric would do that.

Edit: That consoleCmd is basically automatically called when someone becomes a super admin, with their name instead of Ehpialtes. the 'msgAdminForce' makes it play the sound.

2074
Modification Help / Re: Is this incorrect?
« on: July 22, 2011, 08:10:33 PM »
Yes.

In the superadmin check, you have a closing bracket but no opening one.

In the function itself, you have 3 closing brackets at the end, but only two are needed. Figure out which you don't need. syntax is vital.
I'm not sure that it makes a difference, but to be safe, you should change the messageclient opening and closing quotes from ' to ". Not the ones directly after %client, though.
Also, though I'm not sure about this, the %1 might show up as "%1". Try changing it to this:

Quote
MessageClient(%client, '', "\c6Congratulations SuperAdmin, " @ %client.name @ " you have accessed into the Blockland code file.");

2075
Still need help with this.
However, I can post some code if it's any help..
Code: [Select]
datablock ShapeBaseImageData(grGunImage : printGunImage)
{
   colorShiftColor = "0.2 0.2 0.2 1.000";
   item = grGunItem;
   projectile = grGunProjectile;
   altProjectile = grGunBlastProjectile;
   gravFunc = "GrGunAltFire";
   isGravGun = 1;
   projectileType = Projectile;


// States
stateName[0]                     = "Activate";
stateTimeoutValue[0]             = 0.15;
stateTransitionOnTimeout[0]       = "Ready";
stateSound[0] = sprayActivateSound;

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

stateName[2]                    = "Fire";
stateTransitionOnTimeout[2]     = "Reload";
stateTimeoutValue[2]            = 0.2;
                   stateTransitionOnAmmo[2] = "GravLoop";
stateFire[2]                    = true;
stateAllowImageChange[2]        = false;
stateSequence[2]                = "Fire";
stateScript[2]                  = "onFire";
stateWaitForTimeout[2] = true;
stateEmitter[2] = "grGunemitter";
stateEmitterTime[2] = 0.15;
stateEmitterNode[2] = "muzzleNode";
stateSound[2] = printFireSound;
stateEjectShell[2]       = false;

stateName[3] = "Reload";
stateSequence[3]                = "Reload";
stateTransitionOnTrigger[3]     = "Ready";
stateSequence[3] = "Ready";

stateName[4] = "GravLoop";
stateEmitter[4] = grGunEmitter2;
stateEmitterTime[4] = 0.01;
stateEmitterNode[4] = "muzzleNode";
              stateTransitionOnTimeout[4]     = "GravLoop";
              stateTransitionOnTriggerUp[4] = "Cancel";
              stateTransitionOnNoAmmo[4] = "Cancel2";
              stateTimeoutValue[4]            = 0.01;
              stateScript[4]                  = "onGrav";
stateSequence[4] = "Ready";

              stateName[5] = "Cancel";
              stateScript[5] = "onCancel";
              stateTimeoutValue[5] = "0.1";
              stateTransitionOnTimeout[5] = "Ready";

              stateName[6] = "Cancel2";
              stateScript[6] = "onCancel";
              stateTimeoutValue[6] = "0.5";
              stateTransitionOnTimeout[6] = "Ready";
              stateTransitionOnTriggerUp[6] = "Ready";
};

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

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

//gui stuff
uiName = "Gravity Gun";
iconName = "base/client/ui/itemIcons/printer";
doColorShift = true;
colorShiftColor = "0.25 0.25 0.25 1.000";

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

function grGunImage::onMount(%this,%obj,%slot)
{
 %obj.setImageAmmo(0,0);
}

function grGunProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
 if(!miniGameCanDamage(%obj,%col)){return;}
 if((strStr(strLwr(%col.getClassName()),"vehicle") !$= "-1" || %col.getclassname() $= "AIPlayer") && (!%col.isHeld) && %col.spawnbrick.getGroup().client.minigame $= %obj.client.minigame)
 {
  %obj.client.player.gravobj = %col;
  %obj.client.player.gravobj.holder = %obj.client.player;
  %obj.client.player.gravobj.lastpos = %col.position;
  %obj.client.player.gravobj.lastpos2 = %col.position;
  %obj.client.player.gravobj.lastrot = "0 0 0";
  %obj.client.player.setImageAmmo(0,1);
  %obj.client.player.gravobj.disablemove = 1;
 }
}

function grGunImage::onCancel(%this,%obj,%slot)
{
 if(isObject(%obj.gravObj)){ %obj.gravObj.setVelocity(vectorScale(vectorSub(%obj.gravObj.getTransform(),%obj.gravObj.lastpos2),5));}else{return;}
 %obj.gravobj.disablemove = 0;
 %obj.gravObj.isHeld = 0;
 cancel(%obj.gravobj.gravSched);
 %obj.gravobj.gravSched = %obj.gravobj.schedule(3000,gravHold);
 %obj.gravObj = "";
 %obj.setImageAmmo(0,0);
}

function grGunImage::onUnMount(%this,%obj,%slot)
{
 if(!isObject(%obj.gravObj)){return;}
 %obj.gravobj.disablemove = 0;
 cancel(%obj.gravobj.gravSched);
 %obj.gravobj.gravSched = %obj.gravobj.schedule(3000,gravHold);
 %obj.gravObj.holder = "";
 %obj.gravObj.isHeld = "";
 %obj.gravObj = "";
}

function grGunImage::onGrav(%this,%obj,%slot)
{
 %obj.setImageTrigger(0,1);
 if(!isObject(%obj.gravobj)){%obj.setImageTrigger(0,0);%obj.setImageAmmo(0,0);return;}
 if(isMountedTo(%obj,%obj.gravObj)){%obj.setImageTrigger(0,0);%obj.setImageAmmo(0,0);return;}
   %mouseVec = %obj.getMuzzleVector(0);
   %cameraPoint = %obj.getEyePoint();
   %selectRange = %obj.gravObj.getDatablock().mass / 30;
   %mouseScaled = VectorScale(%mouseVec, %selectRange);
   %rangeEnd = VectorAdd(%cameraPoint, %mouseScaled);

   %searchMasks = $TypeMasks::VehicleObjectType | $TypeMasks::FXBrickObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::StaticObjectType | $TypeMasks::TerrainObjectType;

   %player = %obj;
  %scanTarg = ContainerRayCast (%cameraPoint, %rangeEnd, %searchMasks,%obj.gravobj);
   if(!isObject(firstWord(%scanTarg)))
   {
    %pos = %rangeEnd;
   }
   else
   {
    %sub = vectorSub(posFromRaycast(%scanTarg),%cameraPoint);
    %nom = vectorNormalize(%sub);
    %len = vectorLen(%sub);
    %pos = vectorAdd(%cameraPoint,vectorScale(%nom,%len*0.5));
   }
   %obj.gravObj.holder = %obj;
   %obj.gravObj.isHeld = 1;
   %obj.gravObj.lastPos2 = %obj.gravObj.lastPos;
   %obj.gravObj.lastPos = %obj.gravObj.getTransform();
   %t = %obj.gravObj.getTransform();
   %rot =  eulerToMatrix(%obj.gravobj.lastrot);
     //Uncomment the line below and comment out the one below this to use alternate control method. It "swings" more realistically but kills people very easily and you if you turn too fast.
   //%obj.gravObj.setTransform(%obj.gravObj.position SPC %rot);
   %obj.gravObj.setTransform(%pos SPC %rot);
  %obj.gravobj.lastrot = vectorAdd(%obj.gravobj.lastrot,"0 0 0.035");
  //Uncomment the line below and comment out the one below this to use alternate control method. It "swings" more realistically but kills people very easily and you if you turn too fast.
   //%obj.gravObj.setVelocity(vectorScale(vectorSub(%pos,%obj.gravObj.position),5));
   %obj.gravObj.setVelocity("0 0 0");
}

function GrGunAltFire(%this,%player,%slot,%trigger)
{
 if(isObject(%player.gravobj))
 {
   %player.setImageTrigger(0,0);
   %player.setImageAmmo(0,0);
   %mouseVec = %player.getMuzzleVector(0);
   %vel = vectorScale(%mouseVec,4000 / (%player.gravobj.getDatablock().mass));
   %player.gravobj.setVelocity(%vel);
   %player.gravobj.disablemove = 0;
   %player.gravObj.isHeld = 0;
   cancel(%player.gravobj.gravSched);
   %player.gravobj.gravSched = %player.gravobj.schedule(3000,gravHold);
   %player.gravobj = "";
 }
 else
 {
%obj = %player;
%projectile = %obj.getMountedImage(0).altProjectile;
%vector = %obj.getEyeVector();
%objectVelocity = %obj.getVelocity();
%vector1 = VectorScale(%vector, %projectile.muzzleVelocity);
%vector2 = VectorScale(%objectVelocity, %projectile.velInheritFactor);
%velocity = VectorAdd(%vector1,%vector2);
%p = new Projectile()
{
dataBlock = %projectile;
initialVelocity = %velocity;
initialPosition = %obj.getMuzzlePoint(0);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p);
 }
}
I don't think anything out of what's here should be interfering..

2076
Modification Help / Re: Changing Player list database?
« on: July 22, 2011, 07:45:39 PM »
You can enter into your console:

ClientCmdSetAdminLevel(%arg);
Where %arg is:
0 for no Admin
1 for normal Admin
2 for Super Admin
(and if you put anything higher, it will show up as the number)

Note that this only is visible to you, and not to the rest of the server.

The only time this command is useful is if the server has you registred as an admin, but your client doesn't.
Entering this will allow you to open the admin menu, but no actual information will show up. (No, you can't use any of the buttons, either, unless the server says you're an admin.)

2077
Modification Help / Re: Get Id from cmd
« on: July 22, 2011, 07:40:49 PM »
Otto, that's a server-side command.

There's a handy check-box in the options menu:

Press Ctrl+O (default keybind to open options)
Go to the Advanced Tab.
Scroll down until you find the "Gui Options" section.
Near the bottom of the section, there's a check-box that says "Show BL_IDs in player list"
Check the box, then hit the "Done" button.
Now, any time you press F2, the player's BL_ID will show up next to their name.

2078
Modification Help / Re: Detecting when the player releases mouse1
« on: July 21, 2011, 08:12:38 PM »
::onTrigger(%datablock,%player,%slot,%state)

If %slot and %state are both 0.
I was hoping for something more like when the projectile hits the object, it becomes mounted to the player in the way it does when the player holds down mouse1.

Because of the way I'm using it, I can't use ::OnTrigger

2079
Modification Help / Editing a script so it has toggle-type handling
« on: July 21, 2011, 08:01:03 PM »
Hello.
I'm fixing up the gravity gun and related things to fit some other things I'm doing.
I looked through the code, and I'm fairly sure the setImageTrigger(arg1,arg2) is the problem, but I'm changing it so that the holding is toggled instead of hold-release controlled.
Could anybody help me fix this?
Any help is very much appreciated.

2080
Modification Help / Re: Checking Other Players Client Sided
« on: July 20, 2011, 06:19:28 AM »
servercmds are serversided, no matter what.

Also, findClientByName is used by the host console, not yours.

Besides, CityRPGs are a waste of time.

2081
Still need help with the new issue...

2082
Love it.
It's almost like loading a saved duplication in any server, without the wrench events.
It also solves the problem of creating a macro and attempting to not turn, which can be very difficult sometimes.

Definitely one of my favorite client-side add-ons.

Now if only it could do wrench events.

2083
Modification Help / Re: Function used to open/close tools?
« on: July 16, 2011, 06:48:05 PM »
I used Trace(1);, and plenty of info came up.

Though, I ended up finding a file in Gamemode_CTF that prevents users from using inventory while holding a flag.

I pretty much found everything I needed there.

Thanks guys!

2084
Modification Help / Function used to open/close tools?
« on: July 16, 2011, 05:43:10 PM »
I was just wondering what function(s) are used to open/close your tools, and if it's clientside or serverside.

I can't seem to find it in the console.

2085
Modification Help / Re: Need help with adding sounds to an AI bot
« on: July 16, 2011, 05:08:48 AM »
I need to edit the Mutalid's script to add sounds to it like the zombie tank.  It is for a special project I am working on, which I am not going to reveal yet.

Anyways, I look at the tank's script and look at other scripts within the mod, but I just couldn't figure it out.
I am fine with doing it myself, but will need a little help. If one of you want me to give you the sounds so you can do it yourself and PM the link to me when you are done that would be great too.

Off-topic

I also might need someone to host a server when the time comes, as my server has ping problems...I think.
First of all, you'll need to define an audio datablock, unless what you're using already exists in another script.
Code: [Select]
datablock AudioProfile(SoundName1) //what do you want to name the audio?
{
   filename    = "./MutalidSoundFile.wav"; //what is the directory/name?
   description = AudioClose3d; //Most likely, you won't need to change this
   preload = true; //Do you want players to download it if they download sounds?
};
Then, you tell the code when to play it:
Code: [Select]
function MutalidAI::OnDamage(%this, %obj) //this function is called when the mutalid is damaged.
{
    serverPlay3D(SoundName1, %obj.getPosition());
}
now, serverPlay3D(SoundName1, %obj.getPosition()); is basically this, when explained:
Code: [Select]
serverPlay3D //tell the server to play a 3D sound--
SoundName1  //the audioprofile name you chose--
%obj.getPosition() //%obj is the mutalid that calls the function.
//%obj.getPosition() tells the console to get the position of the mutalid
So, that function basically tells the server to play a sound when the mutalid is damaged, from the mutalid's location.

Pages: 1 ... 134 135 136 137 138 [139] 140 141 142 143 144 ... 148