Did you know? UBerserker loves the Dispersion Pistol.

Basic Coding Gameinfo question.

For questions and discussion about UnrealEd, UnrealScript, and other aspects of Unreal Engine design.

Moderators: Semfry, ividyon

User avatar Lightning Hunter
Skaarj Elder Skaarj Elder
Posts: 1291
Joined: 11 Nov 2007, 22:12
Location: Pervert.

Subject: Basic Coding Gameinfo question.

Post Posted: 21 Feb 2015, 04:38

So, really basic question here, and I feel silly I couldn't figure it out myself. In VrikersGame Info, you have this following code that will give the player 12 health, but only if they had 100 health when exiting the previous map. I just need to transform this code so that it gives the player 12 health no matter what their health was in the previous map.

Code: Select all


{
   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;
}



I tried changing this: && (NewPlayer.Health == NewPlayer.Default.Health) )

to this, but it didn't work:

&& (NewPlayer.Health >= 1 ) )


What am I missing?
For High-Res Unreal skins, click here.
For the RTNP "Ultimate Edition" HD, click here.

Image

User avatar Buff Skeleton
>:E >:E
Posts: 4173
Joined: 15 Dec 2007, 00:46

Subject: Re: Basic Coding Gameinfo question.

Post Posted: 21 Feb 2015, 05:15

Just leave out the whole && (NewPlayer.Health == NewPlayer.Default.Health) bit and it should be fine
Image

User avatar Lightning Hunter
Skaarj Elder Skaarj Elder
Posts: 1291
Joined: 11 Nov 2007, 22:12
Location: Pervert.

Subject: Re: Basic Coding Gameinfo question.

Post Posted: 21 Feb 2015, 05:43

I just realized I don't think it has to do with the code. If I launch the map by itself, the player starts with 12 health as they should. However, if I exit the previous map, the player keeps the old health, EVEN if they have 100 when exiting the previous map. In other words, with VRikersGame, if you exit the previous map with 100 health, you will enter the next map with 12. If I create a subclass if VRikersGame and change absolutely nothing, then the player can exit the previous map with 100 health and enter the new map with 100 health. :?

Is there some kind of default property that is modified with VRikersGame? When I create a subclass, a certain default property that is needed may be lost... That's the only reason I can think of this happening.
For High-Res Unreal skins, click here.
For the RTNP "Ultimate Edition" HD, click here.

Image

User avatar Lightning Hunter
Skaarj Elder Skaarj Elder
Posts: 1291
Joined: 11 Nov 2007, 22:12
Location: Pervert.

Subject: Re: Basic Coding Gameinfo question.

Post Posted: 21 Feb 2015, 17:51

I guess the real question I should be asking is, what code do I need to reset the players health to 12 and remove the players weapons when they enter a new map?
For High-Res Unreal skins, click here.
For the RTNP "Ultimate Edition" HD, click here.

Image

User avatar Lightning Hunter
Skaarj Elder Skaarj Elder
Posts: 1291
Joined: 11 Nov 2007, 22:12
Location: Pervert.

Subject: Re: Basic Coding Gameinfo question.

Post Posted: 03 Mar 2015, 04:37

I'm surprised nobody knows the answer to this! :shock:

I thought it would be rather easy coding a game type that resets the players inventory and health, but maybe I'm dead wrong!
For High-Res Unreal skins, click here.
For the RTNP "Ultimate Edition" HD, click here.

Image

User avatar []KAOS[]Casey
Skaarj Berserker Skaarj Berserker
Posts: 426
Joined: 25 Sep 2008, 07:25

Subject: Re: Basic Coding Gameinfo question.

Post Posted: 03 Mar 2015, 06:12

the Travel flag is what your issue was.

► Show Spoiler

User avatar Lightning Hunter
Skaarj Elder Skaarj Elder
Posts: 1291
Joined: 11 Nov 2007, 22:12
Location: Pervert.

Subject: Re: Basic Coding Gameinfo question.

Post Posted: 03 Mar 2015, 06:29

That code works fine if I start the map from scratch. However, if I exit the previous map and teleport to this map with this gameinfo, it does not reset the inventory or the health. Is this maybe an oldskool issue?
For High-Res Unreal skins, click here.
For the RTNP "Ultimate Edition" HD, click here.

Image

User avatar []KAOS[]Casey
Skaarj Berserker Skaarj Berserker
Posts: 426
Joined: 25 Sep 2008, 07:25

Subject: Re: Basic Coding Gameinfo question.

Post Posted: 04 Mar 2015, 08:43

I subclassed regular old unrealgameinfo, tested it on unreal 1.

Oldskool is pretty much a major hackjob... I wouldn't be surprised if it's breaking the entry point somehow.

The tl;dr is your health/inv get set from traveling after Login happens, so you could try PostLogin, but AcceptInventory should be the proper place.


Who is online

Users browsing this forum: No registered users and 28 guests

Copyright © 2001-2024 UnrealSP.org

Powered by phpBB® Forum Software © phpBB Limited