Vanderbildts Dummy NML questions

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
Vanderbildt
Engineer
Engineer
Posts: 37
Joined: 24 Feb 2016 16:40

Vanderbildts Dummy NML questions

Post by Vanderbildt »

Hello
how do I find these errors and solve them
It is NML 6
thanks

nmlc info: Concurrent Action10 labels: 1/240 ("6030.nml", line 55421) // Concurrent to what?
nmlc info: Concurrent spritesets: 24/255 ("6030.nml", line 83985)
nmlc info: Concurrent spritegroups: 74/256 ("6030.nml", line 33628)
nmlc info: Concurrent Action2 registers: 99/127 ("6030.nml", line 149350)
nmlc info: Concurrent ActionD registers: 51/64 ("6030.nml", line 34390)
User avatar
JGR
Tycoon
Tycoon
Posts: 2603
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: Vanderbildts Dummy NML questions

Post by JGR »

Vanderbildt wrote: 18 Oct 2024 17:33 Hello
how do I find these errors and solve them
It is NML 6
thanks

nmlc info: Concurrent Action10 labels: 1/240 ("6030.nml", line 55421) // Concurrent to what?
nmlc info: Concurrent spritesets: 24/255 ("6030.nml", line 83985)
nmlc info: Concurrent spritegroups: 74/256 ("6030.nml", line 33628)
nmlc info: Concurrent Action2 registers: 99/127 ("6030.nml", line 149350)
nmlc info: Concurrent ActionD registers: 51/64 ("6030.nml", line 34390)
These are not errors, they're just some statistics about the GRF file you've just made.
Ex TTDPatch Coder
Patch Pack, Github
Vanderbildt
Engineer
Engineer
Posts: 37
Joined: 24 Feb 2016 16:40

Re: Vanderbildts Dummy NML questions

Post by Vanderbildt »

Thank you very much for the answer. I thought these were indications of possible conflicts. But now I have another question:
Is it possible to return several times with one event and if so, how?
So:
If A then return B and return C...
Thanks for Help
WenSim
Engineer
Engineer
Posts: 43
Joined: 02 Sep 2023 08:38
Location: Wenzhou

Re: Vanderbildts Dummy NML questions

Post by WenSim »

Vanderbildt wrote: 22 Oct 2024 13:48 Thank you very much for the answer. I thought these were indications of possible conflicts. But now I have another question:
Is it possible to return several times with one event and if so, how?
So:
If A then return B and return C...
Thanks for Help
A typical switch looks like this:

Code: Select all

switch (FEAT_WAKAWAKA, SELF, switch_name, condition) {
	1: return 3;
	foo: return 4;
	bar: return 5;
}
The switch block returns a value based on the condition.
On top of that, passing arguments is also possible,

Code: Select all

switch (FEAT_WAKAWAKA, SELF, switch_name, argument1, argument2, condition) {
	0: return 0;
	1: return 114514;
}

call this switch using switch_name(arg1, arg2)
whereas condition is something like

Code: Select all

some_variable + argument1 == argument2
Find me on GitHub or on Discord (wensimehrp, or WenSim)
Also find me via QQ: 1049170778, or email: wensimehrp@gmail.com
Green stuff here, may be helpful for content creators.
User avatar
jfs
Tycoon
Tycoon
Posts: 1865
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Vanderbildts Dummy NML questions

Post by jfs »

If you are asking if it's possible to return more than one value for the same condition, then no, not in general. Consider for example a callback that asks a vehicle what it's maximum speed right now is, and the vehicle returns "80 km/h and also 300 km/h" - so how fast can the vehicle go? Callbacks are when the game needs to ask a vehicle/other thing about something, and needs a single, unambiguous answer.
Vanderbildt
Engineer
Engineer
Posts: 37
Joined: 24 Feb 2016 16:40

Re: Vanderbildts Dummy NML questions

Post by Vanderbildt »

Thanks.
foo and bar I found it in C++ descriptions. But unfortunately NML 6 doesn't know them. But after your answer I came up with a solution.
It's purely cosmetic.
I'm just a noob, working with copy and paste trails and errors.
The task was to display 2 different basic parameters in one window.

Here's my solution:
[+] Spoiler
switch (FEAT_INDUSTRIES, SELF, oil_wells_extra_text_2, [
STORE_TEMP(((2500+LOAD_PERM(21))/5000)*5, 260),
STORE_TEMP((LOAD_PERM(21)*100)/LOAD_PERM(23), 261),

STORE_PERM ((LOAD_PERM(1)-(prodover *4))/4 ,74),
STORE_PERM ((LOAD_PERM(1)-(prodhigh *3))/3 ,73),
STORE_PERM ((LOAD_PERM(1)-(prodnorm *2))/2 ,72),
STORE_PERM ((LOAD_PERM(1)-(prodreduced)) ,71),

STORE_PERM ((LOAD_PERM(74)>=1 ? LOAD_PERM(74):0),84),
STORE_PERM ((LOAD_PERM(73)>=1 ? LOAD_PERM(73):0),83),
STORE_PERM ((LOAD_PERM(72)>=1 ? LOAD_PERM(72):0),82),
STORE_PERM ((LOAD_PERM(71)>=1 ? LOAD_PERM(71):0),81),

STORE_TEMP (LOAD_PERM(84),256),
STORE_TEMP (LOAD_PERM(83),257),
STORE_TEMP (LOAD_PERM(82),258),
STORE_TEMP (LOAD_PERM(81),259),

((((LOAD_PERM(74)) >= 1) ? 4 :
((LOAD_PERM(73)) >= 1) ? 3 :
((LOAD_PERM(72)) >= 1) ? 2 :
((LOAD_PERM(71)) >= 1) ? 1 :
((LOAD_PERM(71)) <= 1) ? 0 : 0 ) + param_mine_resources_decay * 0)

]) {

4 : return string(STR_CONCAT, string(STR_PRODUCTION_LEVEL3OVER_TURNS), string(STR_OIL_STATUS_OVER), string(STR_EXTRA_OIL_WELLS_4));
3 : return string(STR_CONCAT, string(STR_PRODUCTION_LEVEL3HIGH_TURNS), string(STR_OIL_STATUS_HIGH), string(STR_EXTRA_OIL_WELLS_3));
2 : return string(STR_CONCAT, string(STR_PRODUCTION_LEVEL3NORM_TURNS), string(STR_OIL_STATUS_NORMAL), string(STR_EXTRA_OIL_WELLS_2));
1 : return string(STR_CONCAT, string(STR_PRODUCTION_LEVEL3HALF_TURNS), string(STR_OIL_STATUS_REDUCED), string(STR_EXTRA_OIL_WELLS_1));
0 : return string(STR_CONCAT, string(STR_PRODUCTION_LEVEL3LOW_TURNS ), string(STR_OIL_STATUS_LOW), string(STR_EXTRA_OIL_WELLS));

}
[+] Spoiler
before.png
before.png (18.41 KiB) Viewed 2738 times
after.png
after.png (23.22 KiB) Viewed 2738 times
PS. The basic Code is from SPI 1.32c by 3Iff
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 14 guests