Resource check problem

doker

New member
I am trying to use the resource check rule to send a train from a coal mine to power plant when the coal at the power plant drops below a certain level. The rule works fine the first time but I cannot get it to repeat when the coal drops below the set level again. I have tried the reset rule but to no avail. How do I get the train to go to the power plant a 2nd, 3rd, time?
 
If you figure out a way, let me know :)

The resource check rule is only meant to run one time, and I have yet to figure out how to reset it successfully.
 
The resource check rule runs continuously, but it needs an indented rule below it to detect the "low level" condition.
I use the "session variable rule" to set a named variable's value from 0 to 1.
Then I use the "ChangeSVariables" Driver command (122381:10015:1) to test the variables value, this makes the driver wait until the resource check rule has operated. Once the commodity is delivered to the industry use the same driver command to reset the variable to 0. It requires the worktable rule (131986:230102:3).
Below are the instructions as per the config.txt of the "ChangeSVariables" command.

"A Driver schedule command to create and change session variables. The session variables are created by using the WorkTable rule (kuid:131986:230102) available on DLS. In order to create (and)or change session variables, do the following steps. (1) Download and install the WorkTable rule from the DLS. (2) Edit the WorkTable rule, add a new line, and type the following:
svar,SVNAME,SVOPER,SVNUM
where 'svar' : the command name recognized by the driver schedule command.
'SVNAME' : session variable name
'SVOPER' : arithmetical operations on SVNAME. It be set to 'set' to assigns an integer,
'inc' to increase and 'dec' to decrease value of the session variable..
'SVNUM' : corresponding value to assign, increase, or decrease the svname. Must be an integer.
ex: svar,myvar,set,5 (equivalent to setting myvar=5)
svar,myvar,inc,1 (equivalent to setting myvar=myvar+1)
svar,myvar,dec,1 (equivalent to setting myvar=myvar-1)
(3) Once a set of such command style statements are added to the WorkTable, they will appear once the ChangeSVariables command is launched.
PREREQUISITE: WorkTable rule to create items in the command's add menu list.
VERSION 0
SIMILAR COMMANDS/RULES: SessionVariables rule, SetScoreXtoY, IncreaseScoreXbyY, and DecreaseScoreXbyY commands.
NOTES: Session variables only be of integer type. DO NOT USE floating point numbers/operations. "

andyz
 
Hi,
I tried to set that up, but when I go into driver, there is no variable in the wait until SVar thing. Only thing I got offered was my add one to myvar and subtract one from myvar.

Perhaps you could post a detailed example of how to set this up for folks?

Thanks,
Steph
 
Steph,

You'll need to use the "work table" rule in TRS2004 and the "Input Table" rule in TRS2006 to set up the variable actions in advance.

Smiley.
 
I have 06. Switched to input table. I can set it to a value, display it in the custom HUD, which reflects my changes, but the "wait until SVar" driver command has the little -> like there are choices, but nothing shows up. Thoughts?
 
There are 2 versions of the "waituntilsvariable" command on the DS, one for TRS04 and one for TRS06.

The author usually states the differences between his 04 and 06 versions, but on this occasion he says they are identical
Still might be worth checking you're using the 06 version, because there might be something in it (he did after all upload a separate version for 06, so maybe what he meant was identical functionality).

Other than that nothing springs to mind.

If it's not as simple as the wrong version of the asset, then I'll have a go at it tomorrow and see what I can come up with.
Or maybe Andyz will have come across this before and will have a solution.

Cheers,
Smiley.
 
Ok, I will try to explain in more detail.
The commands I use are:

ChangeSVariables (131986:155581)
WaitUntilSVariable (131986:155583)
(I missed that last one out in my original post)

The rules I use are as follows:

Work Table Rule
Session Variables (set variable "power" to 0)
resource check rule
Session Variables (indented, set "power" to 1)

In the worktable rule 2 lines of code are required:

svar,power,set,0
svar,power,gt,0

These will create the options in the command submenus.

"wait until svariable power is greater than 0"
"change svariable power to 0"

In the driver setup I use "WaitUntilSVariable" until "power" is greater than 0, deliver the comodity, and then use "ChangeSVariables" to reset "power" to 0.

I am using TRS2004 but this should work in 2006.

andyz
 
I missed the line with the gt in it. that got it working, but it only runs once. I deliver, set it back to 0, and when the resource drops below the value, it doesn't set the variable to 1 again. I have the show svar in hud so I can watch it. The next question is can I watch another commodity in another nested list below that one?

Thanks!
 
I also display the variable in the hud, and in 2004 it works continually! Maybe some difference between versions?

You should be able to run duplicate instances of the resource check rule, each with their own unique variables and code lines in the work table rule.

andyz
 
Today i saw this thread. For 06 you must use Transiberiano's rules Resource verify rule and Driver scedule rule V8. Doker with this two rules you will solve your problem.
Cheers
Celje
 
Could you also find his Driver Schedule Rule version 8? I'd like to see that session in action, but need version 8.
Norm

i just reprogrammed the drivers using the version 7 rule which is on the DLS. works just fine with that. cant find the ver 8 one.
 
Open Resources 2006 in surveyor-edit session and you will see that both rules are there.
When you start test in driver, you must wait about one minute before train start.
Regards
Celje
 
Yeah, so did I. Works pretty good, variations of it will definitely be useful. Sorry Celje, the version 8 rule is not there, the icon shows but it's empty and you aren't able to edit it.
Norm
 
Last edited:
I can't get this to work. I think I don't have enough knowledge.
For example when it comes to the Input Table I don't know what to enter.
Child Rules I do understand.

Could I ask someone to write a step-by-step instruction for this please.
I mean, an explanation which a child could understand. Then I might get it.
I will understand if it is considered it too trivial to bother with.
Maybe there is a more up-to-date way of doing it than when this Thread was first posted?
I am using 2006.

Thanks.
 
nahgalaco said :''I can't get this to work''

which one, resource verify rule, demo resource 2006 or rule Inputtable?

Inputtable is a very strong rule for using together with various driver commands such as:
-wait until time
-create custom schedule
-wait for user
-split consist
-move turntable
-change SVariables
-CommWithTTable

All this was made by atilabarut.

regards
 
I was trying to get the coal train to wait outside the Power until the resource level fell to a set quantity.
I have tried to set out instructions as per the above but when it comes to the Input table I don't know what to enter there.
The other rules I think I understand but I won't know if they work for me until I find out how to enter what is needed in the Input Table.
It is going to be something obvious and I will feel suitably foolish but I just haven't been able to work it out as yet.
Thanks
Stuart.
 
Back
Top