I need some help on creating an activity

General discussions

Moderator: senjer

User avatar
perfecttrains1000
Posts: 497
Joined: 30 Apr 2018, 17:50

Re: I need some help on creating an activity

Post by perfecttrains1000 »

Sjoerd wrote: 01 May 2020, 12:55 :D Okey, I'll leave the next "activity doesn't work" up to you ;)
Nah im joking, to be far it would be better for someone with more experience like you to find errors :D
Plus i seem to ask for help on my activities so im not generally the best :lol:
- Likes London Underground
- Somehow relates anything to trains
User avatar
Sgt_DeBones
Posts: 653
Joined: 05 Apr 2019, 15:23
Location: Los Angeles, California
Contact:

Re: I need some help on creating an activity

Post by Sgt_DeBones »

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.
Pin this comment.
WW3 is at our doorstep. Gear up just in case. PROTECT THE METROS!
PetttRocket
Posts: 346
Joined: 01 Jan 2020, 21:48

Re: I need some help on creating an activity

Post by PetttRocket »

Michiel
Pin the new topic and close it

@ Sgt_DeBones
Then the link is everytime on the first page of the forum
Hi
User avatar
macaronny
Posts: 15
Joined: 25 Apr 2020, 08:43
Location: Hong Kong

Re: I need some help on creating an activity

Post by macaronny »

I made correction but still can't work and I tried to check the validation that Michiel gives and stated 'The Content Of Elements Must Consist Of Well-formed Character Data Or Markup' and I don't understand what that means. If you don't mind to help me to check again the code that will be great thanks.
Attachments
Screenshot.png
Screenshot.png (337.76 KiB) Viewed 4100 times
Line C with S7.zip
(2.2 KiB) Downloaded 158 times
User avatar
Sjoerd
Posts: 5669
Joined: 26 Dec 2014, 21:14
Location: Alphen aan den Rijn

Re: I need some help on creating an activity

Post by Sjoerd »

It tells you were the problem is located; line 153. So simply look up line 153:

<<train pack="London" file="LUS7.xml">

There's your problem: you started with two times "<".
CEO of the Rijndam Electrical Transport company :D
User avatar
macaronny
Posts: 15
Joined: 25 Apr 2020, 08:43
Location: Hong Kong

Re: I need some help on creating an activity

Post by macaronny »

I have put the </consist> here but it still catch the same error somehow. Sorry for keep asking questions :(
Attachments
螢幕擷取畫面 (396).png
螢幕擷取畫面 (396).png (315.28 KiB) Viewed 4040 times
螢幕擷取畫面 (397).png
螢幕擷取畫面 (397).png (240.09 KiB) Viewed 4040 times
User avatar
Sjoerd
Posts: 5669
Joined: 26 Dec 2014, 21:14
Location: Alphen aan den Rijn

Re: I need some help on creating an activity

Post by Sjoerd »

In the screenshot I see you have made the same error multiple times, which I have explained here already: http://sim.bemined.nl/forum/viewtopic.p ... 643#p27060
The problem here is not the "consist" element, it's the "train" element; You open and close a 'chapter' "train" two times within the blue marked bit in your screenshot (opening with <train and closing with /). As it should be; for every train you place, so this is correct. The option of leaving out / and replacing it with a </train> later, is just so you can add in extra properties for that train (like an enabled cab).

But then you put in a train-closure </train> after that. What are you closing now? Not the placement of a train, as you already closed that with /.

->>>
Sjoerd wrote: 01 May 2020, 12:22 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.
And I see you keep repeating this error.
Re-check the entire coding, as I think you may have made this error all throughout, and the activity won't show up in the menu screen until all XML errors have been solved. ;)
Last edited by Sjoerd on 03 May 2020, 09:00, edited 1 time in total.
CEO of the Rijndam Electrical Transport company :D
User avatar
brozma
Posts: 489
Joined: 11 Sep 2013, 16:27
Location: Prague, Czech Republic

Re: I need some help on creating an activity

Post by brozma »

And that's, why I never made a fully functional activity. I just don't understand XML programming language at all.
TBH, when Sjoerd released an blank activity, which allowed you to enjoy the MVG type A train with pantographs freely, I had a pretty though time making a copy for Rijndam map (Sjoerd made an activity for Simvliet map). I had to use a "trial-error copy-paste" method where I copied a functional code from another activity and placed it into blank one with MVG type A train, then I booted up Metrosim to see, if it's correct. When it wasn't (it didn't show up in Metrosim), then I closed the Metrosim and started over again.
Michiel wrote: 03 May 2020, 08:56 https://www.w3schools.com/xml/
Maybe this will help me to finally understand XML language. So thnx Michiel for posting it here. If I could, I'll pin it, so everybody, who wants to make an activity and have no idea, how XML language works, can go there and learn it.
If you want to make a very fast ride, just disable ATB/ZUB, put trottle to 1.00 and enjoy.
In my Avatar is a Logo of a Prague metro.
Sorry for my bad English. I am Czech and i am learning English
SGJDW_472006
Posts: 64
Joined: 31 May 2019, 20:29

Re: I need some help on creating an activity

Post by SGJDW_472006 »

can someone help me with this activity because when I play the activity I get the time that a metro has to arrive I get 2x shown on the DRIMs
Attachments
drim-img (1).png
drim-img (1).png (195.13 KiB) Viewed 3115 times
Activities.rar
(4.29 KiB) Downloaded 167 times
Post Reply