Jump to content

Script Compiles, Doesn't Work as Intended (noob)


CompGuyJMB

Recommended Posts

BiggAndFlabby already has noticed the problem an he is right. The script is for your radio. It should be attached to the radio.

The generator requires a power pylon or conduit. Just like when you build in the workshop. Without conduit, it can only work for objects that are wired to it. The radio should be in the active radius of the conduit that is wired to the generator.

Edited by kitcat81
Link to comment
Share on other sites

  • Replies 57
  • Created
  • Last Reply

Top Posters In This Topic

J4YI,

 

CK doesn't handle powerlines very well. When i tired last time, i had to fix the power-grid/connection points in xEdit :-\

 

Edith: I think, it would be okay to add the PowerRadiation AV to the generator. Thus you don't have to fiddle with powerlines.

Edited by deadbeeftffn
Link to comment
Share on other sites

The script is attached to the Reference box, under the Scripts tab. When you double-click the item in the Render Window, and scroll to the last tab. It's the box before you click the Edit Base button (which is the image shared above)

 

Photo below:

 

https://www.dropbox.com/s/i7vhquang5xxcjn/ReferenceBox.png?dl=0

ReferenceBox.png?dl=0

 

Is this the wrong location to attach the script?

 

If you want it to only work on that one reference then that could work. Normally one would put the script on the base object and let the reference inherit it. Then set any specific property changes there. For your particular situation since you're only making a static radio and not a craftable one and such it shouldn't matter. Then the only issue is if you set the properties correct and as kitkat mentions setup a pylon/conduit. Though I believe doing it that way you can get rid of the linking directly to the generator as the radio will then be setup to draw ambient radiated power. The power radiation will be killed when the generator is shut off even though the generator is technically still powered.

 

Though like deadbeeftffn said you can't get power wire attachments to work directly in CK. You would have to go edit some things in xEdit to get the linking to work. So setting up your generator to radiate might work. Though I'm not sure how it would respond to powering it off.

Edited by BigAndFlabby
Link to comment
Share on other sites

So... still not working by moving the script to the base...

 

When switched on, my generator does add power to the workshop. With kitkat's script, the radio just sits there and won't turn on when activated.

 

This time I'm posting all the info I can (in the below images). Hopefully you guys can see what I'm missing? Remember, I'm new, so it could be something you'd assume I know.

 

Radio Info: https://www.dropbox.com/s/tjv4s0muiahjatd/RadioInfo.png?dl=0

 

Generator Info: https://www.dropbox.com/s/xat6hb1adsajq9a/GeneratorInfo.png?dl=0

 

Oh, and really - thanks for all the help so far!

 

Edit: Here's a link to the current ESP: https://www.dropbox.com/s/3lxifp1pnnz44i8/JMB.esp?dl=0

Edited by CompGuyJMB
Link to comment
Share on other sites

Hi there. I installed your mod to test it. There are few things I have found that seemed weird:

1 The generator was already on when I entered the bunker. The power button on the wall did not work.So I could not turn it off at all. I was able to z-key the fusion core, but it also did not turn the generator off.

2 The radio that is staying near the generator has no scripts attached to it at all. You can easily check it by clicking it in console and typing SV. It just works as a usual Diamon city radio.

 

Possible reasons :

1 You have not used a clean save to test it so you can't see the real state of things. You need to go back to any save where the mod was not installed and test there.

2 Can't comment on the script issue..I have almost no experince with building in the render window, hopefully someone else will be able to tell you how to attach a script to your object so it actually appears in game.

 

Edit: Some more results:

The power is not delivered to the radio unless you build a wire from your generator to the conduit on the ceiling. Then power works properly ( I built a light bulb nearby to see if it works), but the radio has no scripts on it so it does not react on power and just keeps working as a vanilla radio.

 

 

 

Just one question not related to your mod :wink: ..I'm trying to build something in the CK. But I'm really horrible with it and feel frustrated with the lack of tools to adust things to the required position. It drives me crazy how I can't snap objects in the way I need. Is there any secret I'm missing ?

Edited by kitcat81
Link to comment
Share on other sites

Hi Kitcat,

 

Thanks for taking the time to check it out. Yes, the button is "detached" at the moment - it's still present but I isolated it from the script for troubleshooting. I have the generator running as it normally would until I get the radio thing figured out. It can be turned on / off by activating the generator itself. The fusion core is simply aesthetic. Down the line, I want to experiment with making the generator "consume" fusion cores, so you have to replenish them so often.

 

The script is added to the radio. Double click on it, and then click on the "Edit Base" button. This is where think you as well as BigAndFlabby suggested I attach it. It was originally in the Reference Box, on the Scripts tab. This is the box before you click the "Edit Base" button. The power connection on the ceiling is left over from my first attempt at making the generator power the cell. I decided to go with the PowerRadiation keyword to avoid wires in the cell.

 

As your question regarding snapping, the 5th button in (a finger pointing), and clicking on the Movement tab allows you to modify the Snap "grid" in the render window, so things align. Pressing Q toggles the snap on and off. I prefer to set the snap at 16 for walls and floors, and 4 when decorating. Pressing Shift + Q will allwo you to double-click on a reference point (say a floor piece) to set that as the "home" for the grid. If things are close but won't quite snap, Press Shift + Q, then double click on the floor piece you want to snap to. Then move the other piece and it will snap.

 

Also for decorating, you can press F to make things "drop" to the floor or a counter, so they're not floating above it. Some surfaces will let things fall though, so be cautious of that. Just press CTRL + Z to undo the drop, and move it manually by holding Z (for Z-Axis).

 

Edit: Updated my ESP to address some of the things you pointed out (as well as add tonight's changes). When I test my mod, I have been loading a save that was created before I began developing my mod. This way, I know my save file isn't contaminated.

Edited by CompGuyJMB
Link to comment
Share on other sites

Ok so just threw in the esp and made the script locally. The good news, the script is working as intended for me. Well mostly. More on that in a bit. Your power radiation on your generator seems funky or broken. I didn't play with it much but it seems like it's too low. For reference the power conduits use 500 radiation in contrast to the 50 you chose. Though 500 is a pretty big radius.

 

I couldn't test turning your generator on and off as something was causing the generator to malfunction for activation (I suspect the enable marker was the culprit).

 

So now the qwerky things.

 

I noticed If I picked up the radio and moved it closer to the generator it would trigger that it had power and then turn on and off properly. But at first spawn it wouldn't until either another power source was provided or it was picked up and re-placed down in workshop mode.

 

I built a regular generator and a power conduit for testing. Turning the generator on and off caused the radio to turn on and off as desired. So I would say the script is working properly as written.

 

Now the problem: If you had the radio on, and pick it up in workshop mode, then drag out away from the generator it won't properly turn off. For some reason it isn't getting the OnPowerOff event consistently when done that way and I don't understand why. However the workshop power icon status shows it as unpowered. Found it was due to having 2 power sources within range that were giving power. So it was incorrectly showing it had no power when it in fact did. Removing all generators and rebuilding just 1 allowed for it to switch on and off via dragging as it should.

Link to comment
Share on other sites

Ok,thanks for the explanation, activating the generator seem to work and affect the lightbulb I built in the workshop mode ( only after connecting the generator to the conduit), but not the one you already have there. I suppose it was not set up to work yet. Then the only problem I can see is that the radio is missing the script. Maybe you need to delete the radio and add it back to the cell in order to get it updated ..Not really sure. I know how it should be done with craftable objects...But no idea about pre-build refs. But the script should be on the radio in order to work.

 

And about the clean save. The fact that you could not make the radio play and I was able to do it in my game tells me that something is baked in your saves...Maybe start a new game to test it?

 

Great thanks for all the info about snapping. I wil try to use all this options. i have tried one of them before. Tried to use Q and changed the value to 4, 8 or 16..But was unable to snap floors...There was always a small gap or overlap. Will try your methof with shift+q.

 

 

Edit ...I see now what BigAndFlabbyHas posted so will have to check again..But for some reason there is no script on the placed radio in my game.

Maybe I'm turning on the wrong radio ? :D I'm trying the one right next to the generator.

 

Both scripts I posted - i have tested them . The short one is for non craftable objects the long on is for buildable/draggable objects. But I have tested in the workshop. It might need some additional steps in order to make it work on a pre-built object. Need to think about this.

Edited by kitcat81
Link to comment
Share on other sites

See, that's weird, because when you first enter the cell, the generator is running. I can tell because it adds 10 to the workshop power. If I turn it off, the workshop power drops to zero. It could be the PowerRadiation Range, I'll have to look at that.

 

The enable marker is no longer tied to the generator (though it is named as such). Initially, when you hit that switch, it would Enable the generator (there was a static one there so that the enable / disable didn't make it disappear), and it also activated the enable/disable marker for the lights. I eliminated the generator control portion until the radio thing got worked out - reducing variables. Now, all that switch does is enable the marker for the lights.

 

To make my generator, I used the workshop large generator, and just re-skinned it (changed the model). It should be the same as the large generator, just look different...

 

I'll delete my generator and try placing one in workshop mode and see if that makes a difference. Sounds like it may have for you guys, so maybe something is funky with the generator. If that works, I'll try placing one of the "vanilla" ones without re-skinning it to see if that's the culprit.

 

I'll also try a fresh game as Kitcat suggested.

 

Thanks again guys!

 

One more thing, I threw a bunch of Workshop Keywords at it too. Nothing worked... even tried linking the radio to the workshop as a WorkshopKeywordItem.

Edited by CompGuyJMB
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...