Jump to content

EDIT: NEVERMIND [PartModule OnStart() fires multiple times]


Recommended Posts

I've run into something I just can't get my head around. I created a custom event and wanted to have my parts module listen for it, but I got some errors because it was "listening" for the event 3 times.

On investigation, I found that the OnLoad(), OnStart() and OnStartFinished() methods was called exactly 3 times on startup of scene for my module. Now I can find anywhere where I do anything more that use those methods once.

Therefore my question is. Have anybody seen this behaviour before? Are anybody aware why this could happen. Normally it does not mess up my plugin is it is executed more than once, but in this case it is important that it is only done once!

An observation I had was, that even if I introduce a bool, which I switch on first execution, the next one does not recognize that, and reports it to the log as false still - it's like it is a new instance, but why..... I've gone through my save file to see if my module was there more than once on my vessel, but I could only identify the one.

I'm testing on the simplest craft I can think of. Command module, fuel tank, engine. My module is in the engine part.

 

So again, have anybody observed anything like this? I'm definitely still working on the assumption that the error is mine, but I'm trying to gather information.

 

EDIT: LOL....... Just notice, I had another craft at my space center on the runway, and it had two engines...... Nevermind!

Edited by Warezcrawler
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...