Sign in to follow this  
Eject

Can you please look at a Code? :/

Recommended Posts

Hello friends

 

I added now new custom wagons, own style for individual players, i added the first wagon and it works pefect, then added the second in the same code, and now i cant see one of both wagons, than i can just see the last wagon in the code. What i try, nothing is working to put both wagons in one code.

 

Hopefully one of you can take a little look over the code and explayin me my fail....i would be very happy.

 

https://pastebin.com/6PsnSv78

 

Thanks in advance

Eject

Share this post


Link to post
Share on other sites

You are closing the function in line 77, this causes a Syntax Error and the whole code is ignored. 

 

Remove line 77, also use some kind of IDE which warns you for syntax errors, you will not jump very far without IDE.

I am not really into javascript but I can imagine that declaring variables multiple times like var builder will lead to errors too. Use var builder1, var builder2 and so on instead.

Edited by Sklo:D

Share this post


Link to post
Share on other sites

Thank you Sklo:D

Minutes ago i got it to work, but for the second wagon i got just this (?) item (no template found.

Could it be that this is because the same names of var builder? than what i see, the mappings text is correct and all graphics are at the right place in the jar file.

 

Eject

Share this post


Link to post
Share on other sites

This is my new code, the second wagon doesnt work (no graphics)

 

https://pastebin.com/QMVbckQF

 

Add: oh, i see now, just the second wagon (that not work) is in the creation menu from the wand)

 

better i make different mods for each wagon

Edited by Eject

Share this post


Link to post
Share on other sites

If you use builder1 as name you also need to change all later occurences of it too...

 

for example

builder.name("klara Wagon", "klara Wagon", "A private wagon created by klara");

 

must be changed into

 

builder1.name("klara Wagon", "klara Wagon", "A private wagon created by klara");

Edited by Sklo:D

Share this post


Link to post
Share on other sites
3 minutes ago, Eject said:

Oooops

 

 

Use an IDE to have an automated code check running over your code.

Share this post


Link to post
Share on other sites

I am working with dreamweaver, find no way with google to highlight the syntax correct.

Also i have intelliJ, but never used for js

 

Eject

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this