PDA

View Full Version : pbs with log : help please ;(


Sg_Jack
15th Nov 2001, 12:55 PM
Hi,

I have a problem with my Mod's codes. We are working on an upcoming mod called Atlantis. The codes work well, but when i look at the log file, i have some warnings. The first problem occur with the postrender function i have in my weapon class. I write on the screen infos like current accuracy and firemod. But if i look at the log file, i get :

"..sgplayer0(function Atlantis.ATFireArms.postrender:000E) Accessed Array out of bounds (10/10)"

Do you know what it is refer to ? Here is my postrender function :

simulated function PostRender( canvas Canvas )
{
local PlayerPawn P;

MFTexture = MuzzleFlashVariations[(10)];

Super.PostRender(Canvas);
P = PlayerPawn(Owner);
if (P != None)
{

Super.PostRender(Canvas);
Canvas.SetPos(0.11 * Canvas.ClipX , 0.92 * Canvas.ClipY);
Canvas.Style = ERenderStyle.STY_Translucent;
Canvas.Font = Canvas.SmallFont;

Canvas.DrawColor.R = 0;
Canvas.DrawColor.G = 255;
Canvas.DrawColor.B = 0;
Canvas.DrawText(FireModeMessage);
}

if (P != None)
{

Super.PostRender(Canvas);
Canvas.SetPos(0.11 * Canvas.ClipX , 0.90 * Canvas.ClipY);
Canvas.Style = ERenderStyle.STY_Translucent;
Canvas.Font = Canvas.SmallFont;

Canvas.DrawColor.R = 0;
Canvas.DrawColor.G = 255;
Canvas.DrawColor.B = 0;
Canvas.DrawText("Accuracy: "$WeaponAccuracy);
}
}

To my mind, there is no errors, but i don't know anything with log... Also, i get another error (when i don't compile this part of code) with my player class. I don't know too what is the problem since i have only exec funstions... Here is what i get :

"...sgplayer0(function engine.playerpawn.playerwalking.processMove:00B5) GetAnimGroup = no mesh"

Is anybody know what it is ??? You would hep me a lot if you could find the problem :) Thx


Jack Oneill
Atlantis Leader
www.unrealism.com/modstargate

Raeled
15th Nov 2001, 01:07 PM
1st error: i think the array you have called MuzzleFlashVariations has no 10th item

if you added it like this:

var texture MuzzleFlashVariations[10];

this means you will get an array with textures numbered from 0 to 9.

for the 2nd one
the playerclass asks for info about the animation, while there is no mesh (mesh=None)

2COOL4-U
15th Nov 2001, 01:07 PM
Getting an array out of bound warning means that you were trying to access a value of the array that does not exist

for example you have an array with 10 parts, and you try to access the 11th you will get a warning in your log.

MFTexture = MuzzleFlashVariations[(10)];
This one is the problem maker I think

Btw why do you use [(10)] instead of [10]? I never saw someone using [(10)] before in my entire coding career. UnrealScript doens't complain about it(I could compile).

Sg_Jack
16th Nov 2001, 04:40 AM
Well, thanks for this infos. I'll see if it delete the problem.

By the way, i don't know why i put [(10)] ! It must be an error of write ! I hope it will work like that :)

Also, i think it have find out the second problem, but i don't know how to fix it.... It refers to my player class. If i change the viewport to behindview (behindveiw 1), i see no models... Nevertheless, i put in defaultproperties the default models of UT...

Here is my code :

defaultproperties
{
Deaths(0)=Sound'Botpack.MaleSounds.(All).deathc1'
Deaths(1)=Sound'Botpack.MaleSounds.(All).deathc51'
Deaths(2)=Sound'Botpack.MaleSounds.(All).deathc3'
Deaths(3)=Sound'Botpack.MaleSounds.(All).deathc4'
Deaths(4)=Sound'Botpack.MaleSounds.(All).deathc53'
Deaths(5)=Sound'Botpack.MaleSounds.(All).deathc53'
drown=Sound'Botpack.MaleSounds.(All).drownM02'
breathagain=Sound'Botpack.MaleSounds.(All).gasp02'
HitSound3=Sound'Botpack.MaleSounds.(All).injurM04'
HitSound4=Sound'Botpack.MaleSounds.(All).injurH5'
GaspSound=Sound'Botpack.MaleSounds.(All).hgasp1'
UWHit1=Sound'Botpack.MaleSounds.(All).UWinjur41'
UWHit2=Sound'Botpack.MaleSounds.(All).UWinjur42'
LandGrunt=Sound'Botpack.MaleSounds.(All).land01'
VoicePackMetaClass="BotPack.VoiceMale"
CarcassType=Class'Botpack.TMale1Carcass'
JumpSound=Sound'Botpack.MaleSounds.(All).jump1'
HitSound1=Sound'Botpack.MaleSounds.(All).injurL2'
HitSound2=Sound'Botpack.MaleSounds.(All).injurL04'
Die=Sound'Botpack.MaleSounds.(All).deathc1'
VoiceType="BotPack.VoiceMaleTwo"
Mesh=LodMesh'Botpack.Commando'
}

It is a subclass of my SgPlayer. I don't know why it don't works... If you have an idea :) Thx

aspie
16th Nov 2001, 06:21 AM
But is your player class a direct subclass of Tournament Player (which has no mesh) or from TMale1 (or something equivalent which does have a mesh).

Sg_Jack
16th Nov 2001, 01:07 PM
My player class is a subclass of Tournament Player. But i refer it to the commando mesh... The problem is that i get no skins.. I have a commando male mesh, but without skin !

And i still have this "no mesh" warning in the log...

2COOL4-U
16th Nov 2001, 01:12 PM
lol subclass TMale1 then :) It basicly only contains the mesh information. It's a tournamentplayer with a mesh

Sg_Jack
16th Nov 2001, 02:18 PM
that's what i'll make :) !

Oh, i have noticed that i have always the same access none error... And i have ten muzzleflash sinks with [10] !

2COOL4-U
17th Nov 2001, 02:14 AM
Post the funtion which causes the error here please

Sg_Jack
17th Nov 2001, 04:36 AM
Hey !

it's work :) MFTexture = MuzzleFlashVariations[(10)]; This line was not needing so it was making access none !

Thanks for that :)

Eater1
24th Nov 2001, 11:54 PM
Oh, by the way, I know this is about as unimportant as anything can get, but [(10)] is exactly the same as [10] since just about any language will handle the ( ) as a method for grouping something... so (10) = 10 just like (10+10) = 10+10 = 20 and just like (10*2)+10=10*2+10=30... get it? I myself often use ( ) in places where it's not needed simply to make my code easier to read.

Eater.