ID:146142
 
I am having a problem when i try to add in the public transportation demo into my game for some reason the train/tram system doesnt move at all

heres the coding for the train

    Railway
icon='railway.dmi'
israil=1
N_S
icon_state="n-s"
E_W
icon_state="e-w"
N_E
icon_state="n-e"
N_W
icon_state="n-w"
E_S
icon_state="s-e"
W_S
icon_state="s-w"
E_W_S
icon_state="e-w-s"
E_W_N
icon_state="e-w-n"
N_S_E
icon_state="n-s-e"
N_S_W
icon_state="n-s-w"
Train_Stations
name="Train Station"
Entered(var/mob/m)
..()
if(ismob(m) && loading==1)
m.riding=trains
trains.passengers.Add(m)
m.icon_state="n"
m.justgotin=1
Stationn
icon_state="stationn"
Statione
icon_state="statione"

mob
var/obj/train/riding=0
var/justgotin=0
Move()
if(riding && riding.loading==0) return 0
..()
if(riding && riding.unloading==1 && justgotin==0)
riding.passengers.Remove(src)
riding=0
icon_state=initial(icon_state)


How can i fix this it just stays there and doesnt move
Well, don't copy and paste demos. They are there for you to learn. Not copy and paste.
In response to Polaruis
Things u need to use a demo:
-Minor Coding Experience
-Know how to translate coding to english

Parts u are missing
-Know how to translate coding to english, thus understanding what it says
Augh. The type path setup for that code is frickin' awful. It has the same problem as in your Zeta pbag thread, namely that there's too much redundant code and too many classes. The redundant code part isn't so bad here, but it should go away.

You need to ax all of the subtypes from N_S down to N_S_W. They're completely useless. All that's changing is the icon_state, and you can do that on the map. There's no reason to make all those different types. Granted, that was probably all in the demo, but clearly it's a crap demo.

As further examples of why it's a crap demo:

  • var/obj/train/riding=0 is totally wrong. Why in the world would you want to set an obj var to a number? It should stay null by default, not 0.
  • if(riding && riding.loading==0) is using one of those bogus ==1 or ==0 checks. Clearly this person knows nothing of robust code. That should be if(riding && !riding.loading) instead.
  • Likewise, the next if() should read if(riding && riding.unloading && !riding.justgotin).
  • Within that last if() block, riding is reset to 0 instead of null.

    Lummox JR
In response to Lummox JR
Why doesnt anyone wanna help this guy give him a break
In response to William22sa
William22sa wrote:
Why doesnt anyone wanna help this guy give him a break


YOU ARE THE SAME PERSON.
In response to Polaruis
NO I AM NOT
In response to William22sa
[link] You posted questions about your own programming on two seperate keys. Don't even play the game.
In response to Polaruis
How would you know? hmm?

Maybe i play when ur offline
In response to William22sa
DUde, u ARe Govegtos. We all have recognized that... What idiots do you think we are... Wait, better said as, "What idiot do we KNOW you are."
In response to Lou
No ur a complete retard who isnt willing to help him out
In response to William22sa
William22sa wrote:
Why doesnt anyone wanna help this guy give him a break

Govegtos, do NOT pretend to be different people under two different keys. You've posted the same code questions under these two keys, and have in some cases outright admitted being the same. Beyond that, I can outright see that you're the same.

The only reason you're pulling this stunt is because you want a second identity who can 1) bump your posts for you illegally, 2) post your code questions a second time illegally, and 3) be on your side when others get on your case about Zeta and for never learning anything when people do try to help you.

If you're still having trouble with your code, by all means post about what parts you don't understand and continue to seek help. But don't play this identity game. All you're doing is spamming the forums.

Lummox JR
In response to William22sa
What I find really funny is, I take it the "William" part of your key came from your real name.

And, beleive it or not, but Govegtos happens to have the same name as you. How odd...
In response to Smoko
Well,There are over more than different williams in the world doesnt mean i am govegtos
In response to Govegtos
Oops, wrong key there. Unless having the key name Govegetos means you aren't necessarily Govegetos.
In response to Lummox JR
Ouch... I think that's MY code.

*Goes looking*

Yep, something I wrote several years ago. I'm going to have to fix this...

EDIT:
Fixed most of that. The only thing left is the variety of types of track, road, etc. I may fix that later.

I now have a sudden urge to go back through old code and see what horrible, horrible mistakes I made...
Govegtos wrote:
Well,There are over more than different williams in the world doesnt mean i am govegtos

Busted.

That made me giggle. And I refer you to Lummox JR's post.

I, probably as well as quite a few others, now refuse to help you anymore. You ignore constructive criticism, you meander on and on about how people won't help you, you attempt to swap identities to back yourself up when it's OBVIOUS that you are the same person - childish. We try damned hard to help you. You just ignore us. You refuse to learn. You also insult other people, calling them retarded and stupid when obviously it's quite the contrary.

~Love Sinyc.
In response to Govegtos
Govegtos wrote:
Well,There are over more than different williams in the world doesnt mean i am govegtos

govegtos-- just give up, and learn to code like (almost)everyone else does. just give it up. what you're doing now is useless, I mean what's the point?
first you go look for a demo, then you copie+paste it in your game, you get an error and you come running to the dev. forums asking what wrong is with the code. Thats just not right, the way I see you is as a complete idiot(no offence).

just start to learn code on the way like everyone else.

a few links that you might find usefull:
Govegetos, if you'd understood my crappy demo (I wrote it along the lines of a year ago. Maybe two years. I was new to programming. Sue me! Incidentally, now that its crappiness has been pointed out to me, I'll be fixing it.), you'd have realised that that isn't the bit that moves trains. You need to look at /obj/train. I suspect the problem is that you've overidden its New() or Move() procedures without ..(). Or you haven't put it one train tracks.
In response to William22sa
The community doesn't help you, William22sa/Gogvetos(spelling?), because you rip snipets of coding and when you come across an error you show it in here. And when we know that it's a rip we decided not to help you, because you don't learn that way. Then your gave youself away when you made the same post about your Saga System under the key 'William22sa'. Take O-matics advise. Read up on tutorials, before continueing your "projects".
Page: 1 2