changing events for a particular loco
- robs on the job
- Posty: 19
- Rejestracja: 16 paź 2009, 13:37
changing events for a particular loco
Hi, is it possible to change one locos speed when in a block when in auto run? for example I have a loco that has trouble on certain parts of my layout. and I thought i could change the event in that block (6) to increase the speed of that particular loco (M7),I named the loco in event and set it to the increased speed and that works perfect but when i use the auto run for another loco when it gets to that block(6) it makes the M7 speed off even though it is not in that block and is not defined to any block So is there a way to set a locos own speed adjustments in a particular block to help it if it struggles on a certain part of the track within a block. or do I have to create a different auto run for every loco. that I wish to have different events
Rob the man who knows nothing about anything....I know!!! no I dont!
Re: changing events for a particular loco
I think it is possible.
First remark: normally block event are independent of autoruns, so if you create second autorun, it doesn't change block event.
The idea is to change block event in this way that for train M7 event doest other operation then for other trains.
To do it you should edit block6 event and add 'IfElseActivity'. This activity create two branches of event execution. Every branch has Condition. On first branch in Condition you should create Expression:
this.ActiveTrain.Name == "M7"
on second branch other condition expression:
this.ActiveTrain.Name != "M7"
This causes thet first branch will be executed for M7 train in block but second branch for others trains.
In first branch you should put change of M7 speed.
PS. I thing you cound send to me your current .plansza file and I will help you with create 'IfElseActivity' or you can try yourself
First remark: normally block event are independent of autoruns, so if you create second autorun, it doesn't change block event.
The idea is to change block event in this way that for train M7 event doest other operation then for other trains.
To do it you should edit block6 event and add 'IfElseActivity'. This activity create two branches of event execution. Every branch has Condition. On first branch in Condition you should create Expression:
this.ActiveTrain.Name == "M7"
on second branch other condition expression:
this.ActiveTrain.Name != "M7"
This causes thet first branch will be executed for M7 train in block but second branch for others trains.
In first branch you should put change of M7 speed.
PS. I thing you cound send to me your current .plansza file and I will help you with create 'IfElseActivity' or you can try yourself
Wiki: http://wiki.gbbkolejka.pl
Program do sterowania makietami: http://www.gbbkolejka.pl
Facebook: http://www.facebook.com/pages/Modelarst ... 0485039078
Program do sterowania makietami: http://www.gbbkolejka.pl
Facebook: http://www.facebook.com/pages/Modelarst ... 0485039078
- robs on the job
- Posty: 19
- Rejestracja: 16 paź 2009, 13:37
Re: changing events for a particular loco
Hi ive sent you my planza file via email as forum would not allow it to upload.
Thanks
Rob
Thanks
Rob
Rob the man who knows nothing about anything....I know!!! no I dont!
Re: changing events for a particular loco
Procedure how put if-else tool to workflow:
1. drag IfElse tool from toolbox to workflow
2. select left 'ifElseBranchActivity1'
3. On right panel on property 'Condition' select 'Declarative Rule' (and expand 'Condition')
4. select 'Condition Name' and press '...' button to enter form to define all condition on this workflow (not only this one)
5. Press 'New' button to define first condition
6. type in following text (during typing you can see some helping system):
this.ActiveTrain.Name=="M7"
and press "OK" button
7. Rename just created condition as 'M7' (there is mistacke on picture )
8. In the same way create second condition and name it as 'not M7'
this.ActiveTrain.Name!="M7"
9. After creating all condition select condition 'M7' and press OK to assign it to Branch
10. Next select right 'ifElseBranchActivity2', select 'ConditionName', press '...' button, select 'not M7' condition and press 'OK button
11. Drag 'Train_ChangeSpeedDirFx' to left branch, select 'Speed change' as 'SetSteps' and 'Speed' as '110'
The end.
1. drag IfElse tool from toolbox to workflow
2. select left 'ifElseBranchActivity1'
3. On right panel on property 'Condition' select 'Declarative Rule' (and expand 'Condition')
4. select 'Condition Name' and press '...' button to enter form to define all condition on this workflow (not only this one)
5. Press 'New' button to define first condition
6. type in following text (during typing you can see some helping system):
this.ActiveTrain.Name=="M7"
and press "OK" button
7. Rename just created condition as 'M7' (there is mistacke on picture )
8. In the same way create second condition and name it as 'not M7'
this.ActiveTrain.Name!="M7"
9. After creating all condition select condition 'M7' and press OK to assign it to Branch
10. Next select right 'ifElseBranchActivity2', select 'ConditionName', press '...' button, select 'not M7' condition and press 'OK button
11. Drag 'Train_ChangeSpeedDirFx' to left branch, select 'Speed change' as 'SetSteps' and 'Speed' as '110'
The end.
Wiki: http://wiki.gbbkolejka.pl
Program do sterowania makietami: http://www.gbbkolejka.pl
Facebook: http://www.facebook.com/pages/Modelarst ... 0485039078
Program do sterowania makietami: http://www.gbbkolejka.pl
Facebook: http://www.facebook.com/pages/Modelarst ... 0485039078
Re: changing events for a particular loco
There is a list of interesting properties of 'this' object:
For events in blocks:
ActiveTrain - this is current train in block
ActiveBlock - this is block itself
for events on trains:
ActiveTrain - this is train itself
ActiveBlock - this is current block
Train and Block has a lot of interesing properties (eg. Name)...
For events in blocks:
ActiveTrain - this is current train in block
ActiveBlock - this is block itself
for events on trains:
ActiveTrain - this is train itself
ActiveBlock - this is current block
Train and Block has a lot of interesing properties (eg. Name)...
Wiki: http://wiki.gbbkolejka.pl
Program do sterowania makietami: http://www.gbbkolejka.pl
Facebook: http://www.facebook.com/pages/Modelarst ... 0485039078
Program do sterowania makietami: http://www.gbbkolejka.pl
Facebook: http://www.facebook.com/pages/Modelarst ... 0485039078
- robs on the job
- Posty: 19
- Rejestracja: 16 paź 2009, 13:37
Re: changing events for a particular loco
Many thanks for doing that
Rob the man who knows nothing about anything....I know!!! no I dont!