How I creat an activity

General discussions

Moderator: senjer

User avatar
Sjoerd
Posts: 5646
Joined: 26 Dec 2014, 21:14
Location: Alphen aan den Rijn

Re: How I create an activity

Post by Sjoerd »

perfecttrains1000 wrote: 20 Jul 2019, 08:59 Special Service NDP-SWP.zip

I have a problem with my activity and i searched over activities to find what was wrong but i found no problem (it happens with 1011PS and 1021SP reach their destinations are don't swap to 1011SP and 1021PS)
The problem is quite simple; first, you refer to the default "Rijndam 2022.ctd" file:

<controldata system="0" pack="Rijndam2022" file="Rijndam2022.ctd">

Then, you say in your services "have service 101 run route S-PS at 07:39:00 followed by S-SP at 07:51:00:

<duty code="101-1" number="101#PS" route="S-PS" time="07:39:00" ai="true"/>
<duty code="101-1" number="101#SP" route="S-SP" time="07:51:00" ai="true"/>

The problem; These routes do not exist in the default CTD file, so the simulator can not find them.

What will happen instead; the simulator sees train 1011PS, looks at the "S", and gives you paths towards Station Westplein. Once arrived there, your train number will not change, as the CTD route information it looks for (which it can't find as it isn't there) would have told the simulator that the route "S-PS" would have ended at the reversing track at Station Westplein (807). It does not have that information, and therefore the train number won't change.
You will also get no departure information on the screens on the platforms along the way (only the destination, as you pass the platforms).

So what you need to do:
1) Copy the default CTD file
2) Add the routes S-PS and S-SP
3) Refer in your activity to your new CTD file
4) Test it
5) When all is well, include it in your download package


For example, this is the route in de CTD file for M2, from Central Station to Westplein ("2-GS"):

Code: Select all

  <route code="2-GS" end="807" totaltime="886" reversetime="30" scrollsign="2-swp" >
   <aimarkers>
    <marker block="808" marker="808-1"/>
   </aimarkers>
   <times>
    <depart platform="RCSK" time="   0" destinationcode="28"  station="rcsk" actions="stop"         stops="RCSK"/>
    <stop   platform="RCS2" time="  90" destinationcode="28"  station="rcs"  actions="stop"         stops="RCS1,RCS2,RCS3,RCS4"/>
    <stop   platform="WHP2" time=" 184" destinationcode="28"  station="whp"  actions="stop"         stops="WHP1,WHP2"/>
    <stop   platform="NOP2" time=" 274" destinationcode="28"  station="nop"  actions="stop"         stops="NOP1,NOP2"/>
    <stop   platform="GGH4" time=" 229" destinationcode="28"  station="ggh"  actions="stop"         stops="GGH3,GGH4"/>
    <stop   platform="MKW2" time=" 387" destinationcode="28"  station="mkw"  actions="stop"         stops="MKW1,MKW2,MKW3,MKW4"/>
    <stop   platform="DMP2" time=" 469" destinationcode="28"  station="dmp"  actions="stop"         stops="DMP1,DMP2,DMP3,DMP4"/>
    <stop   platform="WSP2" time=" 556" destinationcode="28"  station="wsp"  actions="stop"         stops="WSP1,WSP2,WSP3"/>
    <stop   platform="BSL2" time=" 666" destinationcode="28"  station="bsl"  actions="stop"         stops="BSL1,BSL2"/>
    <stop   platform="BGW2" time=" 746" destinationcode="28"  station="bgw"  actions="stop"         stops="BGW1,BGW2"/>
    <stop   platform="SWP2" time=" 826" destinationcode=" 1"  station="swp"  actions="stop"         stops="SWP1,SWP2,SWP3" scrollsign="0-bd"/>
    <arrive platform="SWPK" time=" 886" destinationcode=" 1"  station="swpk" actions="stop,finish"         stops="SWPK"/>
   </times>
  </route>
CEO of the Rijndam Electrical Transport company :D
User avatar
perfecttrains1000
Posts: 496
Joined: 30 Apr 2018, 17:50

Re: How I create an activity

Post by perfecttrains1000 »

Sjoerd wrote: 20 Jul 2019, 09:24
The problem is quite simple; first, you refer to the default "Rijndam 2022.ctd" file:

<controldata system="0" pack="Rijndam2022" file="Rijndam2022.ctd">

Then, you say in your services "have service 101 run route S-PS at 07:39:00 followed by S-SP at 07:51:00:

<duty code="101-1" number="101#PS" route="S-PS" time="07:39:00" ai="true"/>
<duty code="101-1" number="101#SP" route="S-SP" time="07:51:00" ai="true"/>

The problem; These routes do not exist in the default CTD file, so the simulator can not find them.

What will happen instead; the simulator sees train 1011PS, looks at the "S", and gives you paths towards Station Westplein. Once arrived there, your train number will not change, as the CTD route information it looks for (which it can't find as it isn't there) would have told the simulator that the route "S-PS" would have ended at the reversing track at Station Westplein (807). It does not have that information, and therefore the train number won't change.
You will also get no departure information on the screens on the platforms along the way (only the destination, as you pass the platforms).

So what you need to do:
1) Copy the default CTD file
2) Add the routes S-PS and S-SP
3) Refer in your activity to your new CTD file
4) Test it
5) When all is well, include it in your download package

I did what you asked and it worked Thanks :D
- Likes London Underground
- Somehow relates anything to trains
Lyon
Posts: 241
Joined: 06 Jul 2019, 22:14
Location: Lisboa

Re: How I creat an activity

Post by Lyon »

Helllo, i create my activity, but is not start in the simulator, i need your Help
You dont love tram much i love✌🏾✌🏾
User avatar
MP 85
Posts: 546
Joined: 02 Jan 2017, 16:11
Location: France

Re: How I creat an activity

Post by MP 85 »

Lyon wrote: 30 Jul 2019, 13:41 Helllo, i create my activity, but is not start in the simulator, i need your Help
Does your activity appear in the simulator when you have to choose an activity? if this is not the case, there is probably an XML error in your actvity (errors that do not show your activity in the simulator). You can send your activity on the forum so that we can find the XML errors.
Image
Lyon
Posts: 241
Joined: 06 Jul 2019, 22:14
Location: Lisboa

Re: How I creat an activity

Post by Lyon »

i need help with this, is not start in the simulator
Attachments
xTram T3 Special Service - Tours.rar
(4.43 KiB) Downloaded 156 times
You dont love tram much i love✌🏾✌🏾
User avatar
MP 85
Posts: 546
Joined: 02 Jan 2017, 16:11
Location: France

Re: How I creat an activity

Post by MP 85 »

I was able to solve all the XML problems of your activity.

Code: Select all

  <consist start="EES1">
   <train pack="TramCitadis" file="Citadis302_Lyon.xml"/>
    <cab id="0" enabled="true" ai="904"/>
    <pantographs raised="true"/>
   </train>
  </consist>
You put an "/" in too much when you put things associating with the rolling stock
"<train pack="TramCitadis" file="Citadis302_Lyon.xml"/>".

Code: Select all

  <consist start="EES1">
   <train pack="TramCitadis" file="Citadis302_Lyon.xml">
    <cab id="0" enabled="true" ai="904"/>
    <pantographs raised="true"/>
   </train>
  </consist>
So code </ train> is needed, no need to put a "/".

Code: Select all

  <consist start="TRM_RBP1">
   <train pack="K4500" file="K4500_Koln.xml">
    <cab id="0" enabled="true" ai="916"/>
    <pantographs raised="true"/>
   </train>
You forgot to close the code consists of forgetting "</consist>"

Code: Select all

  <consist start="TRM_RBP1">
   <train pack="K4500" file="K4500_Koln.xml">
    <cab id="0" enabled="true" ai="916"/>
    <pantographs raised="true"/>
   </train>
  </consist>
Attachments
xTram T3 Special Service - Tours.zip
Fixed XML problem
(5.59 KiB) Downloaded 155 times
Image
Lyon
Posts: 241
Joined: 06 Jul 2019, 22:14
Location: Lisboa

Re: How I creat an activity

Post by Lyon »

Thanks
You dont love tram much i love✌🏾✌🏾
Lyon
Posts: 241
Joined: 06 Jul 2019, 22:14
Location: Lisboa

Re: How I creat an activity

Post by Lyon »

Now im going to show how my activity
You dont love tram much i love✌🏾✌🏾
Lyon
Posts: 241
Joined: 06 Jul 2019, 22:14
Location: Lisboa

Re: How I creat an activity

Post by Lyon »

Just need to test
You dont love tram much i love✌🏾✌🏾
Lyon
Posts: 241
Joined: 06 Jul 2019, 22:14
Location: Lisboa

Re: How I creat an activity

Post by Lyon »

Thanks one more time
You dont love tram much i love✌🏾✌🏾
Post Reply