Scripting using the .NUT format in Tres CE

Discuss the game Trespasser here!

Moderators: TresCom Support Team, TresCom Board Managers

Slugger
-=TresCom Developer=-
-=TresCom Developer=-
Posts: 4720
Joined: Sat Jun 12, 2004 6:52 pm
Antispam: No
Location: Atlanta

Re: Scripting using the .NUT format in Tres CE

Post by Slugger »

Draconisaurus wrote:Slugger, it might not hurt to post your chicken-scratch code about the computer screen code. Might come in handy.
I may take a crack at implementing that, for the dual purposes of seeing how it works for myself and providing an example. I'll just post the actual code here when I do. I'm traveling back to my parents' place this weekend, so I will see how much time I'll have while I'm there, but I'm going to schedule some time on Tuesday to delve into this regardless.

@TheIdiot: Maybe you (or anyone else) can help me out on this minor point: I haven't done too much with TresCE and defining custom levels, so I'm a little hazy on setting up the proper directory paths. Say I wanted to import the spitter into a level called 'mylevel', what does your directory tree look like and where do you place the spitter's .nut? Give me your absolute paths, please, e.g.:

c:/tres cd/data [...]

or is it

c:/Program Files/DWI/Tres/ [...]

?
0066521C: 'Cannot create local swap file - Is Trespasser installed??',0Ah,0
"Cold lino was the driving force behind world power!"
User avatar
TheIdiot
T-Rex
T-Rex
Posts: 4345
Joined: Thu Feb 20, 2014 9:13 pm
Location: Canada, eh?

Re: Scripting using the .NUT format in Tres CE

Post by TheIdiot »

Did you read? When using a scoped weapon or binoculars, it would happen automatically, and get back to the normal zoom (1.0) after putting them down or holstering them...
Yeah, I understand that, but I think it would be preferrable to not have the zoom happen automatically. In TC~Isle, for example, I find it hard to fight dinosaurs close-up with the hunting rifle because of the automatic zoom. Imagine trying to play any game with a gun that automatically zooms in when you take it out - it's disorienting. Having the ability to toggle zoom on and off would make the weapon viable both close-up and far away.
Why use zoom and not FOV? Because:
unlike zoom factor, the FOV isn't the same for all screens, but depends on the aspect ratio
Try the scoped guns in the Armory and you'll see... they were scripted back then when there was no provision for widescreen in Tres, and work by changing the FOV (which had to be previously calculated for each one and for the default screen), and now when they change "back", the resulting FOV turns out wrong when the screen aspect isn't 4:3 anymore...
Aah, I don't think I've noticed the aspect ratio problem. That's definitely preferrable then.
scopes, binoculars and other visual enhancement aids USE a zoom factor to indicate their capabilities
Again, I understand this, but the FOV pseudo-zoom seemed good enough for our purposes.
@TheIdiot: Maybe you (or anyone else) can help me out on this minor point: I haven't done too much with TresCE and defining custom levels, so I'm a little hazy on setting up the proper directory paths. Say I wanted to import the spitter into a level called 'mylevel', what does your directory tree look like and where do you place the spitter's .nut? Give me your absolute paths, please, e.g.:

c:/tres cd/data [...]

or is it

c:/Program Files/DWI/Tres/ [...]

?
Well, my game is installed in a different overall spot (which causes a few minor problems with TresEd not being able to find the TPA files), but it's:
E:\Games\Trespasser

with the data folder being:
E:\Games\Trespasser\Data

You'd put the scripts in a folder called "Scripts" in the base directory, like so:
E:\Games\Trespasser\Scripts

Or, if you want to keep the scripts specific to a mod, it might be:
E:\Games\Trespasser\Mods\TresComTrilogy\Scripts

Presumably, if you had the game installed to the typical directory, it would be:
C:\Program Files (x86)\DWI\Tres\Scripts

Hope that helps. :)
Last edited by TheIdiot on Fri Oct 06, 2017 10:07 pm, edited 1 time in total.
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: Scripting using the .NUT format in Tres CE

Post by machf »

TheIdiot wrote:
Did you read? When using a scoped weapon or binoculars, it would happen automatically, and get back to the normal zoom (1.0) after putting them down or holstering them...
Yeah, I understand that, but I think it would be preferrable to not have the zoom happen automatically.
The problem back then was that we couldn't assign an extra key to zoom in and out... now we can.
In TC~Isle, for example, I find it hard to fight dinosaurs close-up with the hunting rifle because of the automatic zoom. Imagine trying to play any game with a gun that automatically zooms in when you take it out - it's disorienting. Having the ability to toggle zoom on and off would make the weapon viable both close-up and far away.
Well, you could always try to see it as a disadvantage when you try to use a gun meant for long-distance shots in close quarters combat. ;)
Why use zoom and not FOV? Because:
unlike zoom factor, the FOV isn't the same for all screens, but depends on the aspect ratio
Try the scoped guns in the Armory and you'll see... they were scripted back then when there was no provision for widescreen in Tres, and work by changing the FOV (which had to be previously calculated for each one and for the default screen), and now when they change "back", the resulting FOV turns out wrong when the screen aspect isn't 4:3 anymore...
Aah, I don't think I've noticed the aspect ratio problem. That's definitely preferrable then.
Yep.
scopes, binoculars and other visual enhancement aids USE a zoom factor to indicate their capabilities
Again, I understand this, but the FOV pseudo-zoom seemed good enough for our purposes.
I say it because for each scope I was forced to previously calculate the FOV corresponding to its zoom in order to script them... it becomes much simpler if you can directly use the zoom factor in the script instead.
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
TheIdiot
T-Rex
T-Rex
Posts: 4345
Joined: Thu Feb 20, 2014 9:13 pm
Location: Canada, eh?

Re: Scripting using the .NUT format in Tres CE

Post by TheIdiot »

The problem back then was that we couldn't assign an extra key to zoom in and out... now we can.
Ah, okay, I see now what you were talking about, just got a bit confused.
Well, you could always try to see it as a disadvantage when you try to use a gun meant for long-distance shots in close quarters combat. ;)
Very true, and in that sense it works quite well, but it can be a bit of a hassle when you're trying to pick it up or drop it.
Again, I understand this, but the FOV pseudo-zoom seemed good enough for our purposes.
I say it because for each scope I was forced to previously calculate the FOV corresponding to its zoom in order to script them... it becomes much simpler if you can directly use the zoom factor in the script instead.
I never noticed that in the scripting. In that case, true zoom does sound like a much better option. :)
Slugger
-=TresCom Developer=-
-=TresCom Developer=-
Posts: 4720
Joined: Sat Jun 12, 2004 6:52 pm
Antispam: No
Location: Atlanta

Re: Scripting using the .NUT format in Tres CE

Post by Slugger »

So I can't seem to get my version of TresCE to load or run any .nut script (pretty sure I'm running the latest version which supports it). I placed .nut files inside the follow directories:

c:\tres cd\scripts & c:\tres cd\Scripts
c:\tres cd\data\scripts & c:\tres cd\data\Scripts
c:\Program Files\DWI\Tres\scripts & c:\Program Files\DWI\Tres\Scripts

I've tried a simple script to just print out to the debug log and the HUD script, neither of which seem to work.

Perplexing, this is...
0066521C: 'Cannot create local swap file - Is Trespasser installed??',0Ah,0
"Cold lino was the driving force behind world power!"
User avatar
TheIdiot
T-Rex
T-Rex
Posts: 4345
Joined: Thu Feb 20, 2014 9:13 pm
Location: Canada, eh?

Re: Scripting using the .NUT format in Tres CE

Post by TheIdiot »

So I can't seem to get my version of TresCE to load or run any .nut script (pretty sure I'm running the latest version which supports it). I placed .nut files inside the follow directories:
Iiiiiinteresting. Have you tried any of the test scripts..? And do you have the most recent version of CE?
c:\tres cd\scripts & c:\tres cd\Scripts
c:\Program Files\DWI\Tres\scripts & c:\Program Files\DWI\Tres\Scripts
Sounds like either of these should work.
I've tried a simple script to just print out to the debug log and the HUD script, neither of which seem to work.

Perplexing, this is...
Hmm, are you sure you have it running the debug console and not just "developer mode"? There should be a console running in the background while the game is active if you're in the real debug mode.
Post Reply