A new Trespasser patch/update (Trespasser CE)

Discuss the game Trespasser here!

Moderators: TresCom Support Team, TresCom Board Managers

User avatar
TheIdiot
T-Rex
T-Rex
Posts: 4345
Joined: Thu Feb 20, 2014 9:13 pm
Location: Canada, eh?

Re: A new Trespasser patch/update (Trespasser CE)

Post by TheIdiot »

:D Thanks a ton, Lee! Hopefully I can use this to further understand how the .nut system works. Gonna give this a try now!

EDIT: Tested the script out in-game...it's perfect! Couldn't be happier with it, and the flashing stamina icon is a nice surprise as well. I'm glad you've got those easy-to-modify values up at the top for newbies like me, since there isn't really much I can figure out beyond that point. I quite like your HUD design, though I've already tweaked it a bit for my own liking:

Image

Probably still going to make a new ammo counter as well with more JP-esque numbers.

The only thing I found which was a bit odd was that you can sprint while moving sideways or backward. Would it be possible to make it work only when moving forward (i.e., holding the W key)? I also can't seem to get the custom keybind to stay when restarting the game, but that might be a problem on my part.

If you manage to find the time to complete the script, I would be extremely grateful. The only things missing are the sounds (there are quite a few unused "Tired" Anne sounds in the TPA - these are):
Spoiler: show
ANNETIRE1: *breathing* God, I'm out of shape.. (low, random chance to say instead of ANNETIRE4?)
ANNETIRE2 : *breathing* I really should have used that stair machine! (low, random chance to say instead of ANNETIRE4?)
ANNETIRE3 : *short heavy breathing* (play when Stamina at 80%?)
ANNETIRE4 : *long heavy breathing* (play when Stamina at 15%?)
ANNETIRE5 : *heavy breathing, slowing down* (play when Stamina regenerating?)
Ultimately, I'll end up using different sounds than in the retail TPAs, but having the framework estabilished to use multiple sounds for each event would be very useful in the future.
And - as I noticed you mentioned in the code - a flashing health icon when your health is low (<20% or so) would complete the HUD. If possible, I'd also like to ask that you make the Stamina icon flash only you try to do something which requires stamina but don't have enough, as sort of an indicator that you've run out.
Finally, I'd like to see if you could make a separate script (different file) which simply increases the player's overall speed by about 15%. Not a priority, but would be nice to have so that the bunny-hoppers can rest their jumping fingers. :)

Would it be possible to split the HUD script from the Stamina script into a separate file, by the way? Or are they tied together..? Just asking in order to keep things tidy and quickly accessible in the script folder.

EDIT 2: Finished the ammo count numbers:
Image
Lee Arbuco
Parasaurolophus
Parasaurolophus
Posts: 271
Joined: Tue Aug 05, 2014 7:09 pm

Re: A new Trespasser patch/update (Trespasser CE)

Post by Lee Arbuco »

The only thing I found which was a bit odd was that you can sprint while moving sideways or backward. Would it be possible to make it work only when moving forward (i.e., holding the W key)?
There currently isn't a way for the script to determine that. I might add some function that allows seeing if movement is forward/back/left/right, but I'd want to avoid a new update only for that alone. If/when I add it, the script can quickly be updated to handle it.
I also can't seem to get the custom keybind to stay when restarting the game, but that might be a problem on my part.
I tried changing my user1 bind here, just to double check, and that was saved properly. You could try again and if it still fails try changing one of the regular control binds to see if that gets saved. Are you using registry based or ini file (tpass.ini) based settings with CE?
Finally, I'd like to see if you could make a separate script (different file) which simply increases the player's overall speed by about 15%.
A player script that does nothing other than an overall 15% speed increase is simply:

Code: Select all

class CFasterPlayer
{
	function fGetSpeedFactor(fSpeedFactor)
	{
		return fSpeedFactor * 1.15;
	}
}
Would it be possible to split the HUD script from the Stamina script into a separate file, by the way? Or are they tied together..? Just asking in order to keep things tidy and quickly accessible in the script folder.
Depends on what you mean split. If you only mean separate files but still both used together, then that should be possible. If you mean separate so you can use only the HUD part on a different project, then that wouldn't the best idea.

There isn't really a "stamina script" as such. There is a CPlayer extension script, that allows scripting extended behavior for the player entity. That handles stamina stuff, but if you wanted other player functionality added to your project, it would have to go into the same player script. An entity can only have one script assigned to it.

So, yes, it's possible take the CPlayerTI script class and move it into a separate "nut" file and keep the game script - that deals with the HUD but also updating the custom player script about the sprint key - in its own file. The scripts will still be "tied" together in the sense that the game script can update the player script wbout the sprint key, and the HUD script can get the stamina info from the player script.


I've added the lines for the player saying stuff but I left them commented out. Felt like it could get a bit too much. For example if one jump already drops stamina by 25%, means it would make a jump sound and play the 80% sound all the time. You can uncomment and test them at your discretion. I'd like to note that the ANNETIRE sounds do not appear to be in the original TPA though. At least none of them were found by the engine when I tried, and I made sure in the debugger that it wasn't an issue with the script interface or the sound IDs. Replace them with something that actually is known to work, like ANNEJUMP, worked though so the script code is ok.
Attachments
game_ti.zip
(10.65 KiB) Downloaded 401 times
User avatar
TheIdiot
T-Rex
T-Rex
Posts: 4345
Joined: Thu Feb 20, 2014 9:13 pm
Location: Canada, eh?

Re: A new Trespasser patch/update (Trespasser CE)

Post by TheIdiot »

The only thing I found which was a bit odd was that you can sprint while moving sideways or backward. Would it be possible to make it work only when moving forward (i.e., holding the W key)?
There currently isn't a way for the script to determine that. I might add some function that allows seeing if movement is forward/back/left/right, but I'd want to avoid a new update only for that alone. If/when I add it, the script can quickly be updated to handle it.
Could you not make it so the key combination to sprint is both the "sprint" key and the "run forward" key, and only those keys?
I tried changing my user1 bind here, just to double check, and that was saved properly. You could try again and if it still fails try changing one of the regular control binds to see if that gets saved. Are you using registry based or ini file (tpass.ini) based settings with CE?
Nevermind, had the .ini set to Read Only. Turned it off and that fixed it.
A player script that does nothing other than an overall 15% speed increase is simply:

Code: Select all

class CFasterPlayer
{
   function fGetSpeedFactor(fSpeedFactor)
   {
      return fSpeedFactor * 1.15;
   }
}
Okaaay...I'll see about trying to implement that into the Game script with my meagre skills. I assume if I paste this under the CPlayerTI defines, it should apply to the current stamina-scripted player?
Depends on what you mean split. If you only mean separate files but still both used together, then that should be possible. If you mean separate so you can use only the HUD part on a different project, then that wouldn't the best idea.

There isn't really a "stamina script" as such. There is a CPlayer extension script, that allows scripting extended behavior for the player entity. That handles stamina stuff, but if you wanted other player functionality added to your project, it would have to go into the same player script. An entity can only have one script assigned to it.

So, yes, it's possible take the CPlayerTI script class and move it into a separate "nut" file and keep the game script - that deals with the HUD but also updating the custom player script about the sprint key - in its own file. The scripts will still be "tied" together in the sense that the game script can update the player script wbout the sprint key, and the HUD script can get the stamina info from the player script.
Yeah, that's what I meant. For example, I want to have two files: gamescript_player.nut and gamescript_hud.nut, each containing their respective elements. I'll try and break that down into separate files in the future. I don't want to use that HUD in a different level, just want two files for organization purposes.
I've added the lines for the player saying stuff but I left them commented out. Felt like it could get a bit too much. For example if one jump already drops stamina by 25%, means it would make a jump sound and play the 80% sound all the time. You can uncomment and test them at your discretion. I'd like to note that the ANNETIRE sounds do not appear to be in the original TPA though. At least none of them were found by the engine when I tried, and I made sure in the debugger that it wasn't an issue with the script interface or the sound IDs. Replace them with something that actually is known to work, like ANNEJUMP, worked though so the script code is ok.
Okay, excellent. I'll play around with it and see if I can get it more managable. The sounds I'll be using instead will be a bit less repetitive, so hopefully it doesn't get annoying.

EDIT: I noticed you already split them into separate scripts - excellent! Again, thanks a lot! :)
Lee Arbuco
Parasaurolophus
Parasaurolophus
Posts: 271
Joined: Tue Aug 05, 2014 7:09 pm

Re: A new Trespasser patch/update (Trespasser CE)

Post by Lee Arbuco »

TheIdiot wrote:Could you not make it so the key combination to sprint is both the "sprint" key and the "run forward" key, and only those keys?
If the mentioned functionality - to see movement directions - is added then it would be possible to have sprint only active when also moving forward. Currently it isn't.
Okaaay...I'll see about trying to implement that into the Game script with my meagre skills. I assume if I paste this under the CPlayerTI defines, it should apply to the current stamina-scripted player?
You can't use that little sample in your situation because there already is a player script, CPlayerTI. As mentioned, an entity can only have a single script assigned to them, and you already have CPlayerTI. It was just meant to demonstrate in a clean slate case, where/how such a speed increase is done.

If you look in the CPlayerTI class you'll notice there already is a "fGetSpeedFactor" function there. At the end of that function you can see

Code: Select all

return fSpeedFactor;
That's where it ends up for normal movement, when no sprinting or out-of-stamina slowdown is in effect. If you change that line to

Code: Select all

return fSpeedFactor * 1.15;
then you'll get a 15% increase on all normal movement.
User avatar
TheIdiot
T-Rex
T-Rex
Posts: 4345
Joined: Thu Feb 20, 2014 9:13 pm
Location: Canada, eh?

Re: A new Trespasser patch/update (Trespasser CE)

Post by TheIdiot »

You can't use that little sample in your situation because there already is a player script, CPlayerTI. As mentioned, an entity can only have a single script assigned to them, and you already have CPlayerTI. It was just meant to demonstrate in a clean slate case, where/how such a speed increase is done.
Yeah, I figured that out. Tried pasting part of the script you provided at the bottom of the file and broke the sprint mechanic. Thanks for the little fix - works like a charm! Looks like this mechanic is pretty much finished up then, aside from the forward sprint nitpick. :) Glad to have had your help!
User avatar
tatu
-=TresCom Website Manager=-
-=TresCom Website Manager=-
Posts: 5088
Joined: Fri Jun 24, 2005 9:40 pm
Antispam: No
Location: Sweden
Contact:

Re: A new Trespasser patch/update (Trespasser CE)

Post by tatu »

Interesting to follow this.

As TI brings up the "TIRED" sounds. There are some "IDLE" sounds for Anne, that definitely would play if Anne idle for too long, like in most games nowdays. I don't think we know of any way to implement those with the retail game as there is no idle check script. Would it be possible to implement this? A system that can track idle time? So you could script that if a player is idle for x amount of time, a sound plays?

AnneIdle1 - (Humming a tune)
AnneIdle2 - (Humming a tune)
AnneIdle3 - (Humming a tune) (Not in retail)
AnneIdle4 - (Sighing)
AnneIdle5 - Getting a little bored, here.
AnneIdle6 - Fine. I can wait as long as you can.
Active project: Trespasser: Isla Sorna
Status:
BE-PH1: Released
PH2-IT: Pre-released
PL-SUM: In production

"...there used to be more benches, but InGen's workers removed them during the evacuation in the name of framerate."
User avatar
Hilwo
Dilophosaurus
Dilophosaurus
Posts: 2644
Joined: Mon Nov 11, 2002 7:06 pm

Re: A new Trespasser patch/update (Trespasser CE)

Post by Hilwo »

Lee Arbuco wrote:I'd like to note that the ANNETIRE sounds do not appear to be in the original TPA though. At least none of them were found by the engine when I tried, and I made sure in the debugger that it wasn't an issue with the script interface or the sound IDs.
You mean the retail TPA? The ANNETIRE voiceovers are in both the retail and build 96 Stream.tpa file. I think ANNEJUMP is in Effects.tpa. Could that be why they didn't work for you? The ANNEIDLE voiceovers are also in Stream.tpa.
tatu wrote:AnneIdle6 - Fine. I can wait as long as you can.
I always pictured Anne sarcastically saying this to a raptor that would wait for her after having chased her up a tree :P
Lee Arbuco
Parasaurolophus
Parasaurolophus
Posts: 271
Joined: Tue Aug 05, 2014 7:09 pm

Re: A new Trespasser patch/update (Trespasser CE)

Post by Lee Arbuco »

tatu wrote:I don't think we know of any way to implement those with the retail game as there is no idle check script. Would it be possible to implement this? A system that can track idle time? So you could script that if a player is idle for x amount of time, a sound plays?
If you'd define idle as the player XYZ position remaining unchanged for N amount of time, then yes you could script that.
Hilwo wrote:The ANNETIRE voiceovers are in both the retail and build 96 Stream.tpa file. I think ANNEJUMP is in Effects.tpa. Could that be why they didn't work for you? The ANNEIDLE voiceovers are also in Stream.tpa.
Yeah that's the problem then. The Say() function for the player uses the/an effects tpa. While it would be possible to play sounds through the general engine sound playing functions, where you can control the type/tpa, you'd miss out on the internal handling and housekeeping that the player code does for Anne talking. I wouldn't recommend that.
User avatar
Draconisaurus
T-Rex Killer
T-Rex Killer
Posts: 14046
Joined: Mon Dec 06, 2004 5:21 pm
Antispam: No
Location: Isla Sorna
Contact:

Re: A new Trespasser patch/update (Trespasser CE)

Post by Draconisaurus »

What's the reason for the disrecommendation? Of course we as modders could simply make Effects.tpa versions of the TIRE vocals.
Lee Arbuco
Parasaurolophus
Parasaurolophus
Posts: 271
Joined: Tue Aug 05, 2014 7:09 pm

Re: A new Trespasser patch/update (Trespasser CE)

Post by Lee Arbuco »

Draconisaurus wrote:What's the reason for the disrecommendation?
The reason was as stated, "you'd miss out on the internal handling and housekeeping that the player code does for Anne talking".

Using the native Say function means that it uses the code as the game itself uses to make Anne say stuff. It's the proper way to make her talk. That code deals with not making her say multiple things at once and whatnot. Bypassing the player's own vocalization management code, requesting playback directly from the sound system, means you miss out on that. It becomes a more hacky and less polished (I know, a bit of irony using that term for this game) solution.
User avatar
tatu
-=TresCom Website Manager=-
-=TresCom Website Manager=-
Posts: 5088
Joined: Fri Jun 24, 2005 9:40 pm
Antispam: No
Location: Sweden
Contact:

Re: A new Trespasser patch/update (Trespasser CE)

Post by tatu »

Lee Arbuco wrote:
tatu wrote:I don't think we know of any way to implement those with the retail game as there is no idle check script. Would it be possible to implement this? A system that can track idle time? So you could script that if a player is idle for x amount of time, a sound plays?
If you'd define idle as the player XYZ position remaining unchanged for N amount of time, then yes you could script that.
Yes, that the player does not move for a specific time.
Active project: Trespasser: Isla Sorna
Status:
BE-PH1: Released
PH2-IT: Pre-released
PL-SUM: In production

"...there used to be more benches, but InGen's workers removed them during the evacuation in the name of framerate."
User avatar
Mof1234567890
Stegosaurus
Stegosaurus
Posts: 59
Joined: Mon May 14, 2018 7:51 pm
Location: Moscow,Russia

Re: A new Trespasser patch/update (Trespasser CE)

Post by Mof1234567890 »

I wander when the new version will come out…
Overall this was the great experience. CE patch is great and author is a genius :wink:
I believe I've spent enough time in the company of death
User avatar
DrShaw
Triceratops
Triceratops
Posts: 78
Joined: Thu Aug 28, 2014 3:41 am

Re: A new Trespasser patch/update (Trespasser CE)

Post by DrShaw »

Mof1234567890 wrote:I wander when the new version will come out…
Overall this was the great experience. CE patch is great and author is a genius :wink:
That depends on how much free time Lee has to work on the code. I have personally seen the original source (like a month before it was release source). I can say it horrifying to understand it and I took a college level C++/Javascript class.
~Dr.Shaw

We are tressers by heart like Anne. John made his dream come true as well as mine.
We trespass on his dream and to see the forgotten world that once was alive 65 million years ago now touchable. Who...dares to come trespass....?
User avatar
Mof1234567890
Stegosaurus
Stegosaurus
Posts: 59
Joined: Mon May 14, 2018 7:51 pm
Location: Moscow,Russia

Re: A new Trespasser patch/update (Trespasser CE)

Post by Mof1234567890 »

DrShaw wrote:
Mof1234567890 wrote:I wander when the new version will come out…
Overall this was the great experience. CE patch is great and author is a genius :wink:
That depends on how much free time Lee has to work on the code. I have personally seen the original source (like a month before it was release source). I can say it horrifying to understand it and I took a college level C++/Javascript class.
But still it is worth the waiting. And it will be flawless 8)
I believe I've spent enough time in the company of death
User avatar
TheIdiot
T-Rex
T-Rex
Posts: 4345
Joined: Thu Feb 20, 2014 9:13 pm
Location: Canada, eh?

Re: A new Trespasser patch/update (Trespasser CE)

Post by TheIdiot »

Hey, Lee, I've got a couple of feature requests for a future version of CE which may or may not be possible:

I'd like to know whether you would be able to allow Trespasser to play a different format of video than .smk. Those files are long outdated, and currently Tres only allows .smk files with terrible compression which tend to look quite bad. I'm not sure specifically what format would be best as a replacement, but preferably it would be something which allows a higher resolution and less compression, such as .bik, which was a popular format for games before pre-rendered cutscenes became more and more obsolete. The ideal would be something more modern, such as .mkv, but I'm not sure whether those are compatible with video games or not.

Also, I was wondering whether you could allow the game to load an actual level as the background for the main menu, or maybe a video file instead (which would go hand-in-hand with the above)? Right now, we're limited to a still image in the background, which looks really outdated by today's standards, especially considering a lot of modern ports of old games tend to add in the "Titlemap" feature. I guess you could add in a line to the FM.ini file like "MainMenuVideo" or "MainMenuMap" to enable this feature for mods.

Again, I don't even know if these are possible, and if they're too much work or completely impossible, it's not a huge deal. I'm just curious whether this might be something doable in the future.
Post Reply