Including (@include) question

Forum rules
SCS as a company do not wish to have paid mods on this forum. While we understand that not all paid mods use the Intellectual Property of other companies/people, it is very hard to moderate what is and isn't acceptable when money is involved. There are also concerns that it could look unfavorable to potential work partners going forward if SCS allow mods that may potentially use unlicensed branding.
Posting in the Mods forum (ATS and ETS2) is restricted to sharing free-to-the-public mods and providing support for mods. For more details, please check the Forum Rules.
tonaz
Posts: 93
Joined: 16 Dec 2019 12:35

Including (@include) question

#1 Post by tonaz » 27 Jun 2022 14:37

Hello!
I am working on a small mod of mine, and i would like to include a value inside many .sui files.
For example i have interior_renault_t.sui starting:

Code: Select all

vehicle_interior_camera: camera.interior.renault.t
{
# basic def START
mouse_right_limit: -180
mouse_left_limit: 210
mouse_up_limit: 73
mouse_down_limit: -65
camera_fov: 72
near_plane: 0.1
far_plane:  1600
I would like that value "far_plane" to change for every vehicle .sui.
So i tried:

Code: Select all

... ...
camera_fov: 72
near_plane: 0.1
@include "custom_draw_distance.sui"
and in the same folder i have that file custom_draw_distance.sui containing this:

Code: Select all

SiiNunit
{
far_plane:  2000
}
but game crashes on loading :(
Any help would be very appreciated. Thanks!!
User avatar
Etrusan
Posts: 648
Joined: 04 Sep 2014 15:29
Location: Brno, Czech Republic
Contact:

Re: Including (@include) question

#2 Post by Etrusan » 27 Jun 2022 15:26

Seasonic SSR-650TD; Intel Core i5-6700K; Gainward GTX 1060 6GB Phoenix GS; 2x Kingston HyperX Fury 8GB; 2x Crucial MX500 2TB; 3x Seagate IronWolf Pro; Corsair Force MP510 960GB; 2x 24" AOC I2481FXH; Windows 10

www.etrusan.net
User avatar
Reinhard
Posts: 4711
Joined: 20 Dec 2012 16:46
Location: Berlin, Germany

Re: Including (@include) question

#3 Post by Reinhard » 27 Jun 2022 15:44

The include statement does a textual conversion. All text of the file you are including is placed where the statement was.

So you are replacing something like

Code: Select all

far_plane:  1600
with this:

Code: Select all

SiiNunit
{
far_plane:  2000
}
When the original file didn't need a new sii unit at that very place, your included text doesn't either. Get rid of it and just use the line

Code: Select all

far_plane:  2000
as included text, with nothing else.

By the way, there is a typo in "SiiNunit". Not that it does matter.
tonaz
Posts: 93
Joined: 16 Dec 2019 12:35

Re: Including (@include) question

#4 Post by tonaz » 27 Jun 2022 15:47

Whats the typo?
Bythewaynow it work, it was because the @include statement MUST be in first column, without any spaces before...
User avatar
Reinhard
Posts: 4711
Joined: 20 Dec 2012 16:46
Location: Berlin, Germany

Re: Including (@include) question

#5 Post by Reinhard » 27 Jun 2022 15:56

SIIUnit, not SiiNunit.
tonaz
Posts: 93
Joined: 16 Dec 2019 12:35

Re: Including (@include) question

#6 Post by tonaz » 27 Jun 2022 16:03

are you sure?
in the wiki they write SiiNunit

https://modding.scssoft.com/wiki/Docume ... gine/Units
User avatar
Reinhard
Posts: 4711
Joined: 20 Dec 2012 16:46
Location: Berlin, Germany

Re: Including (@include) question

#7 Post by Reinhard » 27 Jun 2022 16:40

Sure? Not really. Currently, I'm on vacation, and don't have access to my modding stuff.

Every talk about it mentioned "SII units". If SiiNunit is correct, copy and paste without really looking saved me from noticing it. Can't remember to have ever heard something about N-Units, but who knows.

A quick look into the extracted definitions from the base should tell - which I'm not able to do right now.
User avatar
xXCARL1992Xx
Posts: 16462
Joined: 17 Aug 2016 12:18
Contact:

Re: Including (@include) question

#8 Post by xXCARL1992Xx » 27 Jun 2022 16:41

it was always SiiNunit
| !!!NO SUPPORT OR REQUESTS OF ANY SORT VIA PM!!! | Screenshot Thread | Steam Workshop | World of Trucks Profil |
[ external image ]
User avatar
Reinhard
Posts: 4711
Joined: 20 Dec 2012 16:46
Location: Berlin, Germany

Re: Including (@include) question

#9 Post by Reinhard » 27 Jun 2022 16:52

Then I've misread that bugger for many years. I'm just celebrating this with a nice cold beer! :lol:
al_batros
Posts: 175
Joined: 05 Jan 2022 16:50

Re: Including (@include) question

#10 Post by al_batros » 29 Jun 2022 15:50

tonaz wrote: 27 Jun 2022 15:47 it was because the @include statement MUST be in first column, without any spaces before...
There is "one more thing": An @include cannot have a #comment behind it.

Code: Select all

# works:
@include "somefile"
# doesn't work
@include "somefile" #comment
# works: comment out @include, so it is not loaded:
#@include "somefile"
I think the Wiki is missing this info about the comment not being allowed behind the @include - or it is a bug in the parser...
Post Reply

Return to “Help requests”

Who is online

Users browsing this forum: No registered users and 6 guests