Page 1 of 1

Allan's Coding Problem List

PostPosted: Wed Mar 15, 06 6:09 pm
by Allan
To save time on mine, and everyone else's parts, I decided to start a thread for my coding problems, as i seem to have so many XD

So, to put a start to my list:

1: UT style "Player leads the match by -- points" texture

If you ever played the Morpheus level in UT-GOTY edition, you may remember the "Player leads the match by -- points" textures. I thought these were really cool, and wanted to use them for my SuperModv1 (Probably going to have to remove the V anything eventually, with all the stuff in it XD) pack. I copied the codes from UT for them, and changed them slightly, so it was more specific about what it was to look for (DeusExPlayer instead of PlayerPawn). However, it has been giving me accessed nones ever since i started with it. Even before modifying the PlayerPawn bits to DeusExPlayer.

Fixed by [A]lex, it was just a problem with the texture i was using :D

2: MS3d Animating

Not really a coding issue, but still something that bothers me. I've been making a few meshes, and was wondering how i animate them so they work in DX? Any help here?

PostPosted: Wed Mar 15, 06 6:18 pm
by Alex
Use Scripted.utx, use the exact same script as in UT. Just do the same as Morpheus, and it works.

PostPosted: Wed Mar 15, 06 6:25 pm
by Allan
Weird, but ok, i'll try it :) Wonder why it needs Scripted.utx...

PostPosted: Wed Mar 15, 06 6:32 pm
by Alex
Because that's the texture it will replicate the text on... :roll:

PostPosted: Wed Mar 15, 06 6:39 pm
by Allan
Lol, silly me :P .Ah well, i got it working now, just made a scripted texture on something i knocked together on paint, and added it to SuperModTex. Screenshots in a mo :D

Thanks for the help Alex, this'll really help in my new map/s :D

PostPosted: Thu Mar 16, 06 2:30 pm
by Allan
Updated!!!

PostPosted: Thu Mar 16, 06 7:56 pm
by Dae
A topic with all your questions is a good idea but please post your questions as separate messages, instead of updating the first message. That's more comfortable for us.

And personally I don't understand what's the essence of the problem? As far as I remember you can make animations in Milkshape, as usually after that you will have to use Tack's tool (or someone's plugin) to convert them to Deus Ex format.

PostPosted: Mon Mar 27, 06 7:30 pm
by Allan
Ok, new issue.

Not a problem as such, but could someone go over these mutator codes to check if they would work in game with the proper setup?

Code: Select all
//=============================================================================
// AllBomber. Sets LAM's on everyone but you!
//=============================================================================
class AllBomber expands Mutator config (Mutators);

simulated function PostBeginPlay()
{
   Level.Game.BaseMutator.AddMutator(Self);
}

function Mutate (String S, PlayerPawn Player)
{
Local DeusExPlayer DX;
Local LAM B;

If (DX.bAdmin==True)
 {
   if (S ~= "blowall")
   {
      foreach AllActors(Class'DeusExPlayer',DX)
     {
        if (DX != None && DX != Self)
        {
        B.spawn(class'DeusEx.LAM');
        B.SetBase(DX);
        B.bArmed=True;
        B.bProximityTriggered=True;
        B.bHighlight=True;
        B.bHidden=True;
        B.FuseLength=10.0;
        B.BlastRadius=32;
        B.FragmentClass=None;
        B.Damage=100000;
        B.Speed=0;
        B.Velocity.X=DX.Velocity.X;//Dirty hack to keep the projectile in place,
        B.Velocity.Y=DX.Velocity.Y;//as Const variables such as Physics can't be
        B.Velocity.Z=DX.Velocity.Z;//changed easily via coding.
        }   
     }
   }
 }
 If (DXP.bAdmin!=True)
 {
 return;
 }
}


Code: Select all
//=============================================================================
// AllanHelpMutator. -Provides help on mutators and weapons.
//=============================================================================
class AllanHelpMutator expands Mutator config(Mutators);

simulated function PostBeginPlay()
{
   Level.Game.BaseMutator.AddMutator(Self);
}
 
function Mutate (String S, PlayerPawn Player)
{
local DeusExPlayer DX;

   if (S ~= "Help")
   {
        if (DX != None)
        {
           DX.ClientMessage("|P2Mutator Help: |P3For access to some of the functions, you need to be an admin. These include the 'Log All players in as admin' and 'All Players explode' mutators. However, the 'Suicide Bomber' and 'Bubble Shield' are free for anyone to use.");
           DX.ClientMessage("|P2Other Help: |P3To use the alternate fire modes for weapons, use # to switch their modes. If this doesn't work, they only have 1 mode.");
        }     
   }
}




Code: Select all
//=============================================================================
// AllAdmins.
//=============================================================================
class AllAdmins expands Mutator;

simulated function PostBeginPlay()
{
   Level.Game.BaseMutator.AddMutator(Self);
}

function Mutate (String S, PlayerPawn Player)
{
Local DeusExPlayer DX;

If (DX.bAdmin==True)
 {
   if (S ~= "alllogin")
   {
      foreach AllActors(Class'DeusExPlayer',DX)
     {
        if (DX != None && DX != Self)
        {
      DX.bAdmin=True;
      DX.ClientMessage("|P3You have been logged into administration by |P2Allan's |P3Admin mutator");
        }   
     }
   }
   if (S ~= "alllogout")
   {
      foreach AllActors(Class'DeusExPlayer',DX)
     {
        if (DX != None && DX != Self)
        {
      DX.bAdmin=False;
      DX.ClientMessage("|P3You have been logged out of administration by |P2Allan's |P3Admin mutator");
        }   
     }
   }
 }
 If (DX.bAdmin!=True)
 {
 return;
 }
}


Thanks to anyone who helps with this :D

PostPosted: Mon Mar 27, 06 7:41 pm
by Alex
Where does it define who 'DX' is.

PostPosted: Mon Mar 27, 06 7:50 pm
by Allan
At the start of Mutate function, it has "Local DeusExPlayer DX;" on each of them. Didn't see the point of making it a Var, as it's only used in one function. Or do you mean who, as in which player?

PostPosted: Mon Mar 27, 06 8:20 pm
by Alex
As in which player.

PostPosted: Mon Mar 27, 06 8:30 pm
by Allan
Isn't it the "if (DX!=None && DX!=Self)"<Should make all players affected but the person who triggered the mutator> , or does the Self bit in that refer to the actual mutator, instead of the player using it...?

PostPosted: Tue Mar 28, 06 7:25 am
by Alex
The player who calls the function is in Mutate ()
It is Player, not DX
You do have to use DX for the foreach, but if(DX.bAdmin==True) is impossible.

PostPosted: Tue Mar 28, 06 3:57 pm
by Allan
Ah, so the ones with the If(DX.bAdmin==True) don't work...

So how would i go about fixing these to make them only work for admins?
As i don't want just anyone coming into my server and blowing everybody up with invisible LAM's attached to each player :P, that would be anarchy!

PostPosted: Tue Mar 28, 06 7:11 pm
by Alex
Just replace
If (DX.bAdmin==True)
{
With
If (Player.bAdmin==True)
{

PostPosted: Tue Mar 28, 06 7:34 pm
by Allan
Ok, i'll give it a shot :)