Page 2 of 2

Re: Scripting using the .NUT format in Tres CE

Posted: Fri Oct 06, 2017 6:11 pm
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/ [...]

?

Re: Scripting using the .NUT format in Tres CE

Posted: Fri Oct 06, 2017 6:48 pm
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. :)

Re: Scripting using the .NUT format in Tres CE

Posted: Fri Oct 06, 2017 10:01 pm
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.

Re: Scripting using the .NUT format in Tres CE

Posted: Fri Oct 06, 2017 10:06 pm
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. :)

Re: Scripting using the .NUT format in Tres CE

Posted: Sat Oct 14, 2017 11:30 pm
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...

Re: Scripting using the .NUT format in Tres CE

Posted: Sat Oct 14, 2017 11:37 pm
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.