My map for Test-server

Topics to existing maps/new maps/map secrets, ...
Aphex
Posts: 29
Joined: Sun Jun 08, 2025 10:31 am
Has thanked: 6 times
Been thanked: 2 times

Re: My map for Test-server

Post by Aphex »

BeerVial
The code is same as original, BUT there is 1 more line, so they also add Fatness to player. This was done to see who was playing, and who was hanging out in the "bar" instead.
MedPlant
This acts as an "antidote" to BeerVial -- resets Fatness to default (0%).

P.s. I'm not really a programmer, so if you know a way to really "expand" class (add just what's changed without rewriting from scratch), I'd be grateful.
Barbie
Site Admin
Posts: 274
Joined: Thu Nov 08, 2018 7:12 am
Has thanked: 4 times
Been thanked: 16 times

Re: My map for Test-server

Post by Barbie »

Ah, didn't notice the fatness change code.

But another point here:

Code: Select all

P.Fatness +=1;
if (P.Fatness >= 255) P.Fatness = 255;
What will happen if Player's fatness is already at 255, what is the maximum value of type BYTE? An overflow happens, what might set the value to 0 (depening on engine code). Worst case would be that the neighbour memory cell is changed, too.
Better approach:

Code: Select all

if (P.Fatness < 255) P.Fatness++;
Aphex wrote: Tue Jul 29, 2025 9:54 am if you know a way to really "expand" class (add just what's changed without rewriting from scratch), I'd be grateful.
Try this:

Code: Select all

class BeerVial expands HealthVial;

auto state MyPickup expands Pickup
{	
	function Touch(actor Other) {
	local Name CurrentState;
	
		if (IsInState('Sleeping')) // nothing to do for me
		{
			Super.Touch(Other);
			return;
		}	
		CurrentState = GetStateName();
		Super.Touch(Other);
		// has item been picked up so that the state has changed to 'Sleeping'?
		if (GetStateName() != CurrentState && GetStateName() == 'Sleeping')
			if (Pawn(Other) != None && Pawn(Other).Fatness < 255)
				Pawn(Other).Fatness++;
	}
}

defaultproperties {
	PickupMessage="You drank a Health Beer +"
	ItemName="Health Beer"
	PickupSound=Sound'CompuSFX.(All).drinkgulp'
	MultiSkins(0)=Texture'GenFluid.Water.Water'
	MultiSkins(1)=WetTexture'FireEng.redlavax'
	MultiSkins(2)=WetTexture'FireEng.PitLava'
}
Barbie
Site Admin
Posts: 274
Joined: Thu Nov 08, 2018 7:12 am
Has thanked: 4 times
Been thanked: 16 times

Re: My map for Test-server

Post by Barbie »

Barbie wrote: Tue Jul 29, 2025 9:19 am
small NaliFruit
Oops, that has to be fixed on server.
Done.
Aphex
Posts: 29
Joined: Sun Jun 08, 2025 10:31 am
Has thanked: 6 times
Been thanked: 2 times

Re: My map for Test-server

Post by Aphex »

Wow, thanks!

Question:
When further editing the map, should I download "patched" version from your server instead of using original files? So I'd work with Actors introduced by Map Patcher (such as the Creature Factory you mentioned).
Barbie
Site Admin
Posts: 274
Joined: Thu Nov 08, 2018 7:12 am
Has thanked: 4 times
Been thanked: 16 times

Re: My map for Test-server

Post by Barbie »

Aphex wrote: Sat Aug 09, 2025 8:45 pm When further editing the map, should I download "patched" version from your server instead of using original files?
All these changes exist only in memory! The map file is not changed in any way.
Aphex wrote: Sat Aug 09, 2025 8:45 pm such as the Creature Factory you mentioned
An improved version of SBProperyChanger will be released soon - with that you can also change descendants of stock classes, for example by using FilterTag=myTag and FilterIsOfClass=CreatureFactory.
Post Reply