I need some help on creating an activity

General discussions

Moderator: senjer

User avatar
macaronny
Posts: 15
Joined: 25 Apr 2020, 08:43
Location: Hong Kong

I need some help on creating an activity

Post by macaronny »

I want to create an activity that Line C in Simvliet 2020 is the London Underground S7 trains and Overground trains in Line D. I have changed it in the file but the game doesn't show the activity that I have created. I think there is some problem in the code. Can somebody help me to have a look to see what's wrong in my code. It's my first time to create activity on my own, if there is some skills that I need to know please tell me :D .Many thanks indeed.
Attachments
Line C with LU S7.zip
(2.19 KiB) Downloaded 169 times
User avatar
Sjoerd
Posts: 5647
Joined: 26 Dec 2014, 21:14
Location: Alphen aan den Rijn

Re: I need some help on creating an activity

Post by Sjoerd »

I see you made the same XML error multiple times.

Example:

<train pack="London" file="LUS7.xml"/>
<cab id="0" enabled="true" ai="410"/>
<car id="0" scrollsign2="10"/>
<car id="6" scrollsign2="10"/>
</train>

Do you see it? No?
Let me explain;

First, you open a 'chapter' "train", with <train. Then, you tell the simulator which train to load; pack="London" file="LUS7.xml". And after that, you close of the 'chapter' with /.

Now, you continue with this:
<cab id="0" enabled="true" ai="410"/>
<car id="0" scrollsign2="10"/>
<car id="6" scrollsign2="10"/>


The simulator won't know what to do with that; you already closed of the loading of the train, so these lines won't apply to that train.

And then, you place another train-chapter-closure with </train>. The simulator doesn't understand this, as no train-chapter is open at the moment. So you are closing something that, according to the simulator, doesn't exist at this moment. That is an XML error, and therefore the activity won't show up in the menu.

So what to do.... Don't close off the "train" chapter in that first line.

Your code should become:

<train pack="London" file="LUS7.xml">
<cab id="0" enabled="true" ai="410"/>
<car id="0" scrollsign2="10"/>
<car id="6" scrollsign2="10"/>
</train>


So... <train opens up the chapter "train", and /> in the same line closes it. If you do not use the /, it will remain open into the next code lines, until you close it with </train>.

You made this mistake multiple times, so go through your code again to filter them out.

Hope this helps ;)
CEO of the Rijndam Electrical Transport company :D
PetttRocket
Posts: 346
Joined: 01 Jan 2020, 21:48

Re: I need some help on creating an activity

Post by PetttRocket »

I need also help
Attachments
AI_Mega.zip
that's only the M1 of the Activity
(3.76 KiB) Downloaded 166 times
Hi
User avatar
perfecttrains1000
Posts: 496
Joined: 30 Apr 2018, 17:50

Re: I need some help on creating an activity

Post by perfecttrains1000 »

Tell me whats wrong with it? Does it show up in simulator? Do trains not run?
- Likes London Underground
- Somehow relates anything to trains
PetttRocket
Posts: 346
Joined: 01 Jan 2020, 21:48

Re: I need some help on creating an activity

Post by PetttRocket »

perfecttrains1000 wrote: 01 May 2020, 12:44 Tell me whats wrong with it? Does it show up in simulator? Do trains not run?
It doesn't show up
Hi
User avatar
Sjoerd
Posts: 5647
Joined: 26 Dec 2014, 21:14
Location: Alphen aan den Rijn

Re: I need some help on creating an activity

Post by Sjoerd »

Same type of problem; opening two 'chapters' "car", and not closing them:

<train pack="RET" file="5000-1982.xml" number="5001">
<car id="0" scrollsign1="0.0" scrollsign2="01">
<car id="1" scrollsign1="0.0" scrollsign2="01">
</train>

Should be:

<train pack="RET" file="5000-1982.xml" number="5001">
<car id="0" scrollsign1="0.0" scrollsign2="01"/>
<car id="1" scrollsign1="0.0" scrollsign2="01"/>
</train>


And... Rename the ACT-file, to not overwrite existing activities ("M1 day.act") ;)
CEO of the Rijndam Electrical Transport company :D
User avatar
perfecttrains1000
Posts: 496
Joined: 30 Apr 2018, 17:50

Re: I need some help on creating an activity

Post by perfecttrains1000 »

that feeling when you get beat in activity help.
- Likes London Underground
- Somehow relates anything to trains
User avatar
Sjoerd
Posts: 5647
Joined: 26 Dec 2014, 21:14
Location: Alphen aan den Rijn

Re: I need some help on creating an activity

Post by Sjoerd »

:D Okey, I'll leave the next "activity doesn't work" up to you ;)
CEO of the Rijndam Electrical Transport company :D
User avatar
Michiel
Site Admin
Posts: 2469
Joined: 11 Sep 2011, 13:32

Re: I need some help on creating an activity

Post by Michiel »

To be honest, 80% of the "my activity doesn't work" issues reported here can be resolved by copying your act file into https://www.freeformatter.com/xml-validator-xsd.html and seeing whats wrong.
PetttRocket
Posts: 346
Joined: 01 Jan 2020, 21:48

Re: I need some help on creating an activity

Post by PetttRocket »

Sjoerd wrote: 01 May 2020, 12:46 And... Rename the ACT-file, to not overwrite existing activities ("M1 day.act") ;)
That’s just the beginning of the activity
I first try one line And see if it works, then I make the second one
And when all works I put everything into a new activity
Michiel wrote: 01 May 2020, 13:00 To be honest, 80% of the "my activity doesn't work" issues reported here can be resolved by copying your act file into https://www.freeformatter.com/xml-validator-xsd.html and seeing whats wrong.
Then I can use it next time and don’t spam into the forum🙃
Thx
Hi
Post Reply