Mutators and... the rest of mutators

Development assistance and tutorials here.
Post Reply
Nelsona
Posts: 793
Joined: Sat Sep 30, 2017 5:03 am

Mutators and... the rest of mutators

Post by Nelsona » Sun Mar 15, 2020 7:16 pm

Idea of a Revenge mutator it's cute in a way - IF WE HAVE codes not excuses.
These:

Code: Select all

ScriptWarning: Revenge DM-[BBST]-Thailand-Rmx.Revenge0 (Function Revenge.Revenge.listPlayers:0032) Accessed array out of bounds (32/32)
ScriptWarning: Revenge DM-[BBST]-Thailand-Rmx.Revenge0 (Function Revenge.Revenge.listPlayers:0032) Accessed array out of bounds (33/32)
ScriptWarning: Revenge DM-[BBST]-Thailand-Rmx.Revenge0 (Function Revenge.Revenge.listPlayers:0032) Accessed array out of bounds (34/32)
ScriptWarning: Revenge DM-[BBST]-Thailand-Rmx.Revenge0 (Function Revenge.Revenge.listPlayers:0032) Accessed array out of bounds (35/32)
ScriptWarning: Revenge DM-[BBST]-Thailand-Rmx.Revenge0 (Function Revenge.Revenge.listPlayers:0032) Accessed array out of bounds (36/32)
For some coding start if exist a candidate we can discuss what is this... you'll find words at your will.
Mutators contains variables in fixed arrays

Code: Select all

var pawn killers[32], player[32];
var config int  iRevengeBonus;
Then we have some wrapping... or less wrapping

Code: Select all

function listPlayers()	//assigns each pawn a unique ID
{
	local Pawn P;
	local int pnum;
	pnum = 0;
	for(P = Level.Pawnlist; P != None; P = P.Nextpawn)
	{ 
		player[pnum] = P;	//.playerreplicationinfo.playername;
		pnum++;
	}
}
Can you see the problem ?
Hint from log:

Code: Select all

ScriptWarning: WSRabbit DM-[BBST]-Thailand-Rmx.WSRabbit0 (Function Animal_PACK1.WSRabbit.Evade.PickDestination:000D) Accessed None
Did you get the problem ? No ? Okay, let me in.
Map has some "decoration" pawns - of course with codes copied from stock which are sh!tty if you look at internal state and function. By any matter, at these pawns we cannot speak about "//.playerreplicationinfo.playername;" and then we don't have anything but we can even move over a 32 elements array. Can we have revenge messages ? Maybe not, as long as we drop variables to nowhere... out of array, yeah... array, array.

What's the deal ?

#1 We can discard any crow, bird, rabbit, crappit, stupidizour, fartizant, pig, elephant and so on by not allowing non-players in stage and reducing design originality - server setup
#2 We can wrap code - even if we don't have a MonsterHunt, Coop here, we won't have a pain in butt guaranteed if we are using some checker

Code: Select all

function listPlayers()	//assigns each pawn a unique ID
{
	local Pawn P;
	local int pnum;
	pnum = 0;
	for(P = Level.Pawnlist; P != None; P = P.Nextpawn)
	{ 
		if ( P.PlayerReplicationInfo != None && P.bIsPlayer && !P.IsA('Spectator') ) //or such
		{
			player[pnum] = P;	//.playerreplicationinfo.playername;
			pnum++;
		}
	}
}
We have... let me count... 3 new lines > 1 code checker and 2 brackets or even a bit more for various speed-up executions.
Not often maintained
My UT Mapping works...
Learn the rules like a pro, so you can break them like an artist.
- Pablo Picasso -

User avatar
SC]-[WARTZ_{HoF}
Site Admin
Posts: 298
Joined: Wed May 10, 2017 7:08 am

Re: Mutators and... the rest of mutators

Post by SC]-[WARTZ_{HoF} » Sun Mar 15, 2020 8:18 pm

Thanks for looking at that code Nels. Will you be uploading the fix for this?

Nelsona
Posts: 793
Joined: Sat Sep 30, 2017 5:03 am

Re: Mutators and... the rest of mutators

Post by Nelsona » Sun Mar 15, 2020 8:31 pm

Update will self-operate at rebooting time by server itself.

Big Ass Sniper Server is updated, this is Generation 2 - no version mismatch has been encountered so far.
Not often maintained
My UT Mapping works...
Learn the rules like a pro, so you can break them like an artist.
- Pablo Picasso -

Post Reply