Page 3 of 6

Posted: Wed Nov 12, 2008 12:48 am
by <GF>-REX!!
gopostal wrote:Most coders could care less for wealth but a simple "thank you" means the world.
That's the truth, it feels good knowing that code that I wrote is good enough to be implemented into something else.

I probably don't have time to code much, but if you have any questions, I might be able to help you out.

Good plan with that readme, I hate it when people steal code and don't even bother to give credit to the original author.

Posted: Wed Nov 12, 2008 7:43 am
by gopostal
I've been plinking some with your code but I think this is what is messing everything up (this is from the base monsterhunt mod):

Code: Select all

function bool RestartPlayer( pawn aPlayer )	
	local NavigationPoint startSpot;
	local bool foundStart;
	local Pawn P;

	if (MonsterReplicationInfo(GameReplicationInfo).bUseLives)
		if( bRestartLevel && Level.NetMode!=NM_DedicatedServer && Level.NetMode!=NM_ListenServer )
			return true;

		if ( aPlayer.PlayerReplicationInfo.Deaths < 1 )
			BroadcastMessage(aPlayer.PlayerReplicationInfo.PlayerName$" has been lost!", true, 'MonsterCriticalEvent');
			For ( P=Level.PawnList; P!=None; P=P.NextPawn )
				if ( P.bIsPlayer && (P.PlayerReplicationInfo.Deaths >= 1) )
					P.PlayerReplicationInfo.Deaths += 0.00001;
			if ( aPlayer.IsA('Bot') )
				aPlayer.PlayerReplicationInfo.bIsSpectator = true;
				aPlayer.PlayerReplicationInfo.bWaitingPlayer = true;
				return false;

		startSpot = FindPlayerStart(None, 255);
		if( startSpot == None )
			return false;
		foundStart = aPlayer.SetLocation(startSpot.Location);
		if( foundStart )
			startSpot.PlayTeleportEffect(aPlayer, true);
			aPlayer.ViewRotation = aPlayer.Rotation;
			aPlayer.Acceleration = vect(0,0,0);
			aPlayer.Velocity = vect(0,0,0);
			aPlayer.Health = aPlayer.Default.Health;
			aPlayer.ClientSetRotation( startSpot.Rotation );
			aPlayer.bHidden = false;
			aPlayer.SoundDampening = aPlayer.Default.SoundDampening;
			if ( aPlayer.PlayerReplicationInfo.Deaths < 1 )
				aPlayer.bHidden = true;
				aPlayer.PlayerRestartState = 'PlayerSpectating';
				aPlayer.SetCollision( true, true, true );
		return foundStart;
		return Super.RestartPlayer(aPlayer);
Shrimp created aPlayer as a way to hack around the PRI stuff but I'm having trouble accessing it directly. Most mods that alter inventory simply are ignored as they are coded to look for Player.Player so they just don't see the MH player as a pawn that is alterable. The hard part of this is that some things are default about a player, but some things are hacked and you have to know which is which.
I'm wondering how tough this will be. I looked at Excalibur's MH mod and they didn't directly address the problem either. I emailed a couple of the authors but got no response so I'm kinda swinging in the wind on knowing how to deal with this. It's a lot of trial and error, so if it goes slow it's not that I'm infrequent with my efforts, it's just that there is a lot of testing going on.

Posted: Wed Nov 12, 2008 1:11 pm
by BoBstah
<GF>-REX!! wrote: Good plan with that readme, I hate it when people steal code and don't even bother to give credit to the original author.
I agree completly...
--=BliZz=-- wrote:here is the destination unreal Monsterhunt version this has a integrated radar
If you could at least ask before de-compiling other peoples code and posting on a public forum, that would be appreciated. This also applies to the MH version of the nexgen controller that you imply is yours.
--=BliZz=-- wrote:here you can download a special version of nexgen its the mh edition you can only find it here and nowhere else
PS: this version needs to work cause i tested it

Posted: Wed Nov 12, 2008 4:22 pm
by Skillz
I have never used NexGen, but I will look into it. :cool:

Posted: Wed Nov 12, 2008 8:17 pm
by Flatus
Thx Skillz. :)

As for the versions said on here, it makes more sense now. ;)

Btw, sorry if there was any slight deviation from the topic, carry on as usual. :wiggle:

Posted: Thu Nov 13, 2008 5:25 pm
by Alucard
I split this thread to make it easier to follow, I agree with GoPostal that the copyright banter was obscuring the view of the rest of the thread.

Posted: Thu Nov 13, 2008 8:02 pm
by gopostal
Thank you Al.

Posted: Fri Nov 14, 2008 9:57 am
by gopostal
Just a quick update: I'm still working on the pinata mod, but it's getting there. I actually want pinata to be done perfectly because it will be the basis for most code used to deal with monsterhunt. In a nutshell here's the problem:
The following was posted by Azura HERE :
If Scorekill isn't being called properly you can try to work around this by using other functions relating to Damage (if player health <=0 AND attacker is a monster then ...). Also, if I remember correctly, Monsterhunt places Playerpawns in one team and monsters in another.[/url]
So you can see that in effect, two entirely different sets of commands have to be issued depending on the team. The reason pinata wont work on a monster killing of you is that Scorekill is not accessed. If I can't figure out a parent class that covers both death by suicide/map and death by the monsters in the MH map, I may have to actually make two mods to get it to work right.

If anyone wants to jump in, please feel free. To a certain extent I am shooting in the dark over how to address this issue best.

Posted: Mon Nov 17, 2008 12:34 am
by <GF>-REX!!
This is a mutator, right? I've had issues with this as well, ScoreKill does not work with monsters.

You could use the function, PreventDeath. That's called right before anyone gets killed. MutatorTakeDamage could also be used, just check if the Victim.Health minus ActualDamage is less than or equal to zero.

Theres no need to use two functions, either one should work for both monster deaths and player deaths. Just don't forget to register the mutator with the following line:

Code: Select all

EDIT: If you are doing this in a GameType, function Killed is the one to use.

Posted: Mon Nov 17, 2008 12:53 am
by gopostal
I fixed it using preventdeath as a matter of fact. Skillz has had it a couple of days, but I think I'll throw it out for anyone who wants to test it. let me know good or bad ok? :


This is only the beta so please let me know of ANY issues that arise if you test it. Also if you do play around with it, check your log for any errors. If you get some flagged pinata, would you copy it to me? I'm very interested in any accessed nones if they are caused by the mod.

The pinata is limited to monster-caused deaths. This is to keep the BT sections of maps from collecting too many weapons (they will not destroy themselves). My next thing is to add a timer to destroy the weapons so I can include falls and suicides into pinata. This could prove a bit difficult though as timers can screw up the netcode if you do them wrong.

Also the original mod would not pinata a deemer if you had it. I put that back in. If you run it server-side you can configure it via webadmin. It's self-explanatory, you'll see. If you just play offline, it will pinata all items (sans impact hammer).

I will hopefully put out a final in a few days after I see if this part is OK. Thanks you guys if anyone gives it a whirl. Also for clarification, this is NOT my mod originally. I simply altered it to work with the way monster hunt deals with players.