TresCom Forums
http://www.trescomforum.org/

Scripting using the .NUT format in Tres CE
http://www.trescomforum.org/viewtopic.php?f=6&t=11129
Page 2 of 2

Author:  Slugger [ Fri Oct 06, 2017 6:11 pm ]
Post subject:  Re: Scripting using the .NUT format in Tres CE

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/ [...]

?

Author:  TheIdiot [ Fri Oct 06, 2017 6:48 pm ]
Post subject:  Re: Scripting using the .NUT format in Tres CE

Quote:
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.

Quote:
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.

Quote:
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.

Quote:
@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. :)

Author:  machf [ Fri Oct 06, 2017 10:01 pm ]
Post subject:  Re: Scripting using the .NUT format in Tres CE

TheIdiot wrote:
Quote:
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.

Quote:
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. ;)
Quote:
Quote:
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.
Quote:
Quote:
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.

Author:  TheIdiot [ Fri Oct 06, 2017 10:06 pm ]
Post subject:  Re: Scripting using the .NUT format in Tres CE

Quote:
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.

Quote:
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.

Quote:
Quote:
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. :)

Author:  Slugger [ Sat Oct 14, 2017 11:30 pm ]
Post subject:  Re: Scripting using the .NUT format in Tres CE

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...

Author:  TheIdiot [ Sat Oct 14, 2017 11:37 pm ]
Post subject:  Re: Scripting using the .NUT format in Tres CE

Quote:
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?

Quote:
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.

Quote:
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.

Page 2 of 2 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/