UT / Unreal single player gametype issue ...

Maps, mods and resources ported from or to Unreal.
Must run in UT99 or with Oldskool Amp'd.
Unreal 227 only projects are "Off-Topic"
Post Reply
User avatar
FraGnBraG
Inhuman
Posts: 930
Joined: Sun Jun 13, 2010 5:13 pm
Personal rank: Good news everyone!
Location: Canada
Contact:

UT / Unreal single player gametype issue ...

Post by FraGnBraG »

Okay, sorry if this is not the right place to ask this (since it is really an unreal thing)
-=BUT=-
What would you do if you wanted to kill (i.e. not show) the default weapon appearing when you enter a level set to "Unreal Single Player" gametype... ?
Similar i guess to the "Vortex rikers" gametype except having no view rotation...

I did a quick search but could not find anything about this ... I thought i'd ask the brains here first, before I go asking over at UnrealSP or OLDunreal etc..

Thanks in advance :)
-=FraGnBraG Level Design=- ***UPDATED! even works on your phone!***
User avatar
papercoffee
Godlike
Posts: 10443
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: UT / Unreal single player gametype issue ...

Post by papercoffee »

You mean the Dispersion Pistol?
User avatar
FraGnBraG
Inhuman
Posts: 930
Joined: Sun Jun 13, 2010 5:13 pm
Personal rank: Good news everyone!
Location: Canada
Contact:

Re: UT / Unreal single player gametype issue ...

Post by FraGnBraG »

papercoffee wrote:You mean the Dispersion Pistol?
yeah that one :)

I need to do this because I just split a gigantic SP level into 4 smaller ones. the game starts with vortext rikers gametype but i don't want to do the view rotation whenever i change from one "smaller" level to the next...

Thanks
-=FraGnBraG Level Design=- ***UPDATED! even works on your phone!***
User avatar
Dr.Flay
Godlike
Posts: 3347
Joined: Thu Aug 04, 2011 9:26 pm
Personal rank: Chaos Evangelist
Location: Kernow, UK
Contact:

Re: UT / Unreal single player gametype issue ...

Post by Dr.Flay »

Not sure if UTeamFix has anything that may help. It does extend the base gametypes and tweak SP, amongst many other things.
http://wolf.tcpclan.net/projects/Unreal/UTeamFix.html
http://www.oldunreal.com/cgi-bin/yabb2/ ... 1285952043
User avatar
FraGnBraG
Inhuman
Posts: 930
Joined: Sun Jun 13, 2010 5:13 pm
Personal rank: Good news everyone!
Location: Canada
Contact:

Re: UT / Unreal single player gametype issue ...

Post by FraGnBraG »

Dr.Flay wrote:Not sure if UTeamFix has anything that may help. It does extend the base gametypes and tweak SP, amongst many other things.
http://wolf.tcpclan.net/projects/Unreal/UTeamFix.html
http://www.oldunreal.com/cgi-bin/yabb2/ ... 1285952043
interesting stuff but unfortunately not what i'm looking for...

I will try scripting something...

*EDIT* Fixed it - Created a new version of VRikersGame where player looks straight ahead and keeps the "no gun yet" state... works :)

So all is good
-=FraGnBraG Level Design=- ***UPDATED! even works on your phone!***
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

Re: UT / Unreal single player gametype issue ...

Post by Higor »

Default gametype change?
Coop games like my CacusCoopGame detect if a map has the VRikersGame and does that effect, otherwise start normal gameplay.

Just put VRikersGame on the first map as default gametype in LevelInfo, then SinglePlayer in the others.
Then load the maps without a gametype parameter (Open map?game=), doing "Game=" will clear the gametype option on your local URL.
User avatar
FraGnBraG
Inhuman
Posts: 930
Joined: Sun Jun 13, 2010 5:13 pm
Personal rank: Good news everyone!
Location: Canada
Contact:

Re: UT / Unreal single player gametype issue ...

Post by FraGnBraG »

Higor wrote:Default gametype change?
Coop games like my CacusCoopGame detect if a map has the VRikersGame and does that effect, otherwise start normal gameplay.

Just put VRikersGame on the first map as default gametype in LevelInfo, then SinglePlayer in the others.
Then load the maps without a gametype parameter (Open map?game=), doing "Game=" will clear the gametype option on your local URL.
There's Higor :rock:

okay, so where would i put "Open map?game="?

Right now here is my set up:
Example: map1 connects to the map2 using a "favorites teleporter" - map1's exit teleporter URL property is set like this: "olympia102#map2enter?peer". map2 has a teleporter and playerstart (with Tag "map2enter") at the level's spawn point.
The LevelInfo of map2 has GameType set to either "UnrealGameInfo.SinglePlayer", if player has got a gun, or "VRikersFNB" if player still has not got a gun.

All the VRikersFNB.u does is removes the view rotation (set to zero) and does "PlayerWalking" instead of "PlayerWaking". There is no gun by default because VRikersFNB is based on VRikersGame gaemtype. I have to send the player through the first 4 maps with no gun. I needed VRikersFNB because SinglePlayer gametype ALWAYS equips the player with a dispersion pistol.

If my game was structured as the normal unreal campaigns usually are, the player(s) gets a gun pretty much right away so there is no problem, but that's not what i'm doing - player has to pass through the first 4 maps without a gun yet, after a BIG EVENT they will get some guns (but not before!)

Maybe you can show me a better way to do this stuff?

Cheers
-=FraGnBraG Level Design=- ***UPDATED! even works on your phone!***
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

Re: UT / Unreal single player gametype issue ...

Post by Higor »

Try adding this actor to the level, using VRikers in first map and SP on the others.

Code: Select all

class NoWeapons expands Info;

event PreBeginPlay()
{
	if ( Level.Game != none )
		Level.Game.DefaultWeapon = none;
}
User avatar
FraGnBraG
Inhuman
Posts: 930
Joined: Sun Jun 13, 2010 5:13 pm
Personal rank: Good news everyone!
Location: Canada
Contact:

Re: UT / Unreal single player gametype issue ...

Post by FraGnBraG »

Higor wrote:Try adding this actor to the level, using VRikers in first map and SP on the others.

Code: Select all

class NoWeapons expands Info;

event PreBeginPlay()
{
	if ( Level.Game != none )
		Level.Game.DefaultWeapon = none;
}
well i added this to mylevel in the map#2, adding the actor and then set SinglePlayer as the gametype and still showing a dispersionpistol.

I think for now i'll just keep the modified gametype until there's a better way ... i'll just continue and try to finish the 4 maps to some sort of beta stage ...

Thanks
-=FraGnBraG Level Design=- ***UPDATED! even works on your phone!***
Spectra
Masterful
Posts: 542
Joined: Tue Jan 22, 2013 5:23 pm
Personal rank: Nullified!
Location: (X) Unable To Locate....

Re: UT / Unreal single player gametype issue ...

Post by Spectra »

I found this code in UnrealShare.u -> VRikersGame.uc

Code: Select all

//=============================================================================
// VRikersGame.
//
// no default weapon
//
//=============================================================================
class VRikersGame extends UnrealGameInfo;

event playerpawn Login
(
	string Portal,
	string Options,
	out string Error,
	class<playerpawn> SpawnClass
)
{
	local PlayerPawn NewPlayer;
	NewPlayer = Super.Login(Portal, Options, Error, SpawnClass);
	if ( (NewPlayer != None)
		&& (NewPlayer.Health == NewPlayer.Default.Health)  )
	{
		NewPlayer.PlayerRestartState = 'PlayerWaking';
		NewPlayer.ViewRotation.Pitch = 16384;
		NewPlayer.Health = 12;
	}
	return NewPlayer;
}

function bool RestartPlayer(pawn aPlayer)	
{
	local bool result;

	result = Super.RestartPlayer(aPlayer);
	if ( result )
	{
		aPlayer.Health = 12;
		aPlayer.ViewRotation.Pitch = 16384;
	}
	return result;
}

function int ReduceDamage(int Damage, name DamageType, pawn injured, pawn instigatedBy)
{
	// no friendly fire always in coop
	if ( (instigatedBy != None) 
		&& instigatedBy.bIsPlayer && injured.bIsPlayer && (instigatedBy != injured) )
		return 0;

	return Super.ReduceDamage(Damage, DamageType, injured, instigatedBy);
}

function AddDefaultInventory(pawn PlayerPawn)
{
	return;
}

function bool PickupQuery(Pawn Other, Inventory item)
{
	if ( item.IsA('DispersionPistol') )
		DefaultWeapon = class'DispersionPistol';
	return Super.PickupQuery(Other, item);
}

defaultproperties
{
     bHumansOnly=True
     DefaultWeapon=None
}
Is this what you are looking for FNB??
User avatar
FraGnBraG
Inhuman
Posts: 930
Joined: Sun Jun 13, 2010 5:13 pm
Personal rank: Good news everyone!
Location: Canada
Contact:

Re: UT / Unreal single player gametype issue ...

Post by FraGnBraG »

Rocky wrote:I found this code in UnrealShare.u -> VRikersGame.uc

Code: Select all

//=============================================================================
// VRikersGame.
//
// no default weapon
//
//=============================================================================
class VRikersGame extends UnrealGameInfo;

event playerpawn Login
(
	string Portal,
	string Options,
	out string Error,
	class<playerpawn> SpawnClass
)
{
	local PlayerPawn NewPlayer;
	NewPlayer = Super.Login(Portal, Options, Error, SpawnClass);
	if ( (NewPlayer != None)
		&& (NewPlayer.Health == NewPlayer.Default.Health)  )
	{
		NewPlayer.PlayerRestartState = 'PlayerWaking';
		NewPlayer.ViewRotation.Pitch = 16384;
		NewPlayer.Health = 12;
	}
	return NewPlayer;
}

function bool RestartPlayer(pawn aPlayer)	
{
	local bool result;

	result = Super.RestartPlayer(aPlayer);
	if ( result )
	{
		aPlayer.Health = 12;
		aPlayer.ViewRotation.Pitch = 16384;
	}
	return result;
}

function int ReduceDamage(int Damage, name DamageType, pawn injured, pawn instigatedBy)
{
	// no friendly fire always in coop
	if ( (instigatedBy != None) 
		&& instigatedBy.bIsPlayer && injured.bIsPlayer && (instigatedBy != injured) )
		return 0;

	return Super.ReduceDamage(Damage, DamageType, injured, instigatedBy);
}

function AddDefaultInventory(pawn PlayerPawn)
{
	return;
}

function bool PickupQuery(Pawn Other, Inventory item)
{
	if ( item.IsA('DispersionPistol') )
		DefaultWeapon = class'DispersionPistol';
	return Super.PickupQuery(Other, item);
}

defaultproperties
{
     bHumansOnly=True
     DefaultWeapon=None
}
Is this what you are looking for FNB??
yes, this is the code I modified to create "VRikersFNB".

*EDIT* FYI -- here is my modified code (which does work):

Code: Select all

//=============================================================================
// VRikersGame - Modified by FNB 2014 DEC 18
//
// no default weapon, no rotation
//
//=============================================================================
class VRikersFNB extends UnrealGameInfo;

event playerpawn Login
(
	string Portal,
	string Options,
	out string Error,
	class<playerpawn> SpawnClass
)
{
	local PlayerPawn NewPlayer;
	NewPlayer = Super.Login(Portal, Options, Error, SpawnClass);
	if ( (NewPlayer != None)
		&& (NewPlayer.Health == NewPlayer.Default.Health)  )
	{
		NewPlayer.PlayerRestartState = 'PlayerWalking';
		NewPlayer.ViewRotation.Pitch = 0;
		NewPlayer.Health = 84;
	}
	return NewPlayer;
}

function bool RestartPlayer(pawn aPlayer)	
{
	local bool result;

	result = Super.RestartPlayer(aPlayer);
	if ( result )
	{
		aPlayer.Health = 84;
		aPlayer.ViewRotation.Pitch = 0;
	}
	return result;
}

function int ReduceDamage(int Damage, name DamageType, pawn injured, pawn instigatedBy)
{
	// no friendly fire always in coop
	if ( (instigatedBy != None) 
		&& instigatedBy.bIsPlayer && injured.bIsPlayer && (instigatedBy != injured) )
		return 0;

	return Super.ReduceDamage(Damage, DamageType, injured, instigatedBy);
}

function AddDefaultInventory(pawn PlayerPawn)
{
	return;
}

function bool PickupQuery(Pawn Other, Inventory item)
{
	if ( item.IsA('DispersionPistol') )
		DefaultWeapon = class'DispersionPistol';
	return Super.PickupQuery(Other, item);
}


-=FraGnBraG Level Design=- ***UPDATED! even works on your phone!***
Post Reply