TrainsWhistle

by Hermios

Allows you character to call a train, when he is near rails

Content
11 days ago
0.15.10 - 1.1
278
Transportation

b Error on research

5 years ago

I got an error after a couple of seconds that I finish the research for the whistle.

I got this error:
""
The mod TrainsWhistle caused a non-recoverable error.
Please report this error to the mod author.

Error while running event TrainsWhistle::on_train_changed_state (ID 23)
TrainsWhistle/methods/globalEvents.lua:7: attempt to index field 'globalData' (a nil value)
stack traceback:
TrainsWhistle/methods/globalEvents.lua:7: in function 'OnTrainStateChanged'
TrainsWhistle/control.lua:125: in function <TrainsWhistle/control.lua:121>
""

Help me please XD

5 years ago

Hi Ax
I couldn't reproduce the issue but tried to secure it anyway. Please try again with the last version and tell me if it works
Thanks

Niko

5 years ago

I tried in a sandbox world and now doesn't crash when I research it but crash when I put in the power armor (vanilla). Maibye are other mods the problem and I don't know but if you want I can give you the list of mods that I'm using because it doesn't seems other players have the same problem.

Sorry I don't want to disturbe you but this mod is a very cool implementation.

""
The mod TrainsWhistle caused a non-recoverable error.
Please report this error to the mod author.

Error while running event TrainsWhistle::on_player_placed_equipment (ID 38)
LuaEquipmentGrid doesn't contain key type.
stack traceback:
TrainsWhistle/methods/globalEvents.lua:62: in function 'OnEquipmentPlaced'
TrainsWhistle/control.lua:97: in function <TrainsWhistle/control.lua:91>
stack traceback:
[C]: in function 'index'
__TrainsWhistle
/methods/globalEvents.lua:62: in function 'OnEquipmentPlaced'
TrainsWhistle/control.lua:97: in function <TrainsWhistle/control.lua:91>
""

P.s. sorry for some error in my english

5 years ago

No way you apologize, I am very happy that you use it, and even more that you like it!
This bug us different. I will have a look at it and let you know
And no apologize for your english either, I am not a native english myself, therefore, I cannot find your mistakes :D
Thanks!

5 years ago

Hum, this is not a problem of mods, but of scenario.
Can you tell me what you did? (Step by step)

5 years ago

I simply created a sandbox world. created a character with the command "/c game.player.character = game.player.surface.create_entity{name="player", position = {0,0}, force = game.forces.player}", researched with cheat all the techs and played around with much thing. I use that world for testing mods or other things. I tried right now in a new sandbox creating the character, giving myself the armor and the whistle but when I put it in the slot of the power-up of the armor it instantly crashes.
I'm using some mods for trains and maibye can be these that causes the crash?

And thanks a lot for the help :D

5 years ago

Ok
This is a problem. The whistle is not for you but for the train. Therefore, only trains with this whistle can anwser your call
However, I will fix it, so you cannot give the whistle to you anymore.

5 years ago

wait a minute. the whistle have to be in the train? I was thinking that I have to keep in the armor... XD
and I tried now this but it don't let me to put in the train the whistle. it says only in the armor. I'm a little bit confused XD

5 years ago

oh, that is not normal... Which version of Factorio and of my mod do you use?

5 years ago

Factorio I use the latest version in the test branch
your mods I use train caller, train signal sender and the train whistle

5 years ago

Well, I cannot reproduce this problem. How did you try to insert it? First open the gui of the train, or directly insert it into the loco?

5 years ago

It don't let me insert the whistle in the loco. with shift-left click nothing, when hand inserting nothing. only in the armor I can put it

5 years ago

fix in the next version. Be careful, now, this requires new mods

5 years ago

sorry but now it let me insert the whistle in the train but when I try to call it near the rails with the train is in manual mode it give me another error:

"""
The mod TrainsWhistle caused a non-recoverable error.
Please report this error to the mod author.

Error while running event TrainsWhistle::on_train_whistled (ID 156)
TrainsWhistle/methods/globalEvents.lua:42: attempt to index local 'entity' (a nil value)
stack traceback:
TrainsWhistle/methods/globalEvents.lua:42: in function 'calledFunction'
HermiosLibs/controlLib.lua:269: in function <HermiosLibs/controlLib.lua:265>
"""

New response