TheCoolest7248 Posted November 20, 2017 Share Posted November 20, 2017 I am currently making something that is supposed to be repaired through the settlement menu before it can be used, but I am having trouble setting a stage to which it is already destroyed. I have made it so that it does self dps, I have tried editing its health perc, and I can't seem to get it to be able to be repaired without having to shoot it myself. I don't know what the issue is, as I've tried everything... Is there something I am missing?I am currently making something that is supposed to be repaired through the settlement menu before it can be used, but I am having trouble setting a stage to which it is already destroyed. I have made it so that it does self dps, I have tried editing its health perc, and I can't seem to get it to be able to be repaired without having to shoot it myself. I don't know what the issue is, as I've tried everything... Is there something I am missing? Link to comment Share on other sites More sharing options...
demonofsarila Posted November 22, 2017 Share Posted November 22, 2017 Sorry if this is an unhelpful question, but why do you want something that has to be repaired as soon as it has been made? If it's just to make the player spend more resources, why not change the recipe for it? Is it possible to have a script basically drop a small grenade on the object? A custom explosive with a tiny blast radius? My thinking being the game has some sort of logic against an object killing itself. What if you just damage the object via scripting and blame the damage on something besides the object itself? Idk if there's a function for that. Another idea, is this an object that a player is only going to build one of? You could add an activate via a perk that says repair, which grants them the ability to use the object. Link to comment Share on other sites More sharing options...
TheCoolest7248 Posted November 22, 2017 Author Share Posted November 22, 2017 Sorry if this is an unhelpful question, but why do you want something that has to be repaired as soon as it has been made? If it's just to make the player spend more resources, why not change the recipe for it? Is it possible to have a script basically drop a small grenade on the object? A custom explosive with a tiny blast radius? My thinking being the game has some sort of logic against an object killing itself. What if you just damage the object via scripting and blame the damage on something besides the object itself? Idk if there's a function for that. Another idea, is this an object that a player is only going to build one of? You could add an activate via a perk that says repair, which grants them the ability to use the object. Ever heard of repairable sanctuary? Yeah, trying to make an updated version. Link to comment Share on other sites More sharing options...
TheCoolest7248 Posted November 25, 2017 Author Share Posted November 25, 2017 Sorry if this is an unhelpful question, but why do you want something that has to be repaired as soon as it has been made? If it's just to make the player spend more resources, why not change the recipe for it? Is it possible to have a script basically drop a small grenade on the object? A custom explosive with a tiny blast radius? My thinking being the game has some sort of logic against an object killing itself. What if you just damage the object via scripting and blame the damage on something besides the object itself? Idk if there's a function for that. Another idea, is this an object that a player is only going to build one of? You could add an activate via a perk that says repair, which grants them the ability to use the object. I looked into a script that can damage the object and it is possible, however, I don't have much experience in scripts... Is there a tutorial you can recommend? Link to comment Share on other sites More sharing options...
TheCoolest7248 Posted November 27, 2017 Author Share Posted November 27, 2017 So I made a simple script that damages the object, but it failed to compile with just one error... Any help would be awesome! Here's the script: Scriptname DYDJC_DamageObject extends ObjectReference Native ; Damages bridge or house.Event OnInit() ObjectReference.DamageObject(100.0)EndEvent And the error: DYDJC_DamageObject.psc(5,17): cannot call the member function DamageObject alone or on a type, must call it on a variable. Link to comment Share on other sites More sharing options...
deadbeeftffn Posted November 27, 2017 Share Posted November 27, 2017 If the script is attached to the object which should be damaged, use: Self.DamageObject(100.0)or even shorter: DamageObject(100.0)The other thing is: I'm in doubt that you can use "Native" for your script. I think, you may use "Static" though. Scriptname DYDJC_DamageObject extends ObjectReference Native Link to comment Share on other sites More sharing options...
TheCoolest7248 Posted November 27, 2017 Author Share Posted November 27, 2017 It wont let me do anything but native... Going to try your solution now... Link to comment Share on other sites More sharing options...
TheCoolest7248 Posted November 27, 2017 Author Share Posted November 27, 2017 Holy crap I was so close.... Thank you, now to finish up restoring Sanctuary... Link to comment Share on other sites More sharing options...
TheCoolest7248 Posted November 27, 2017 Author Share Posted November 27, 2017 Okay, ran into another problem... When I repair the object, the script runs again, causing it to always be destroyed... Is there a way to make the script only run once? Link to comment Share on other sites More sharing options...
deadbeeftffn Posted November 28, 2017 Share Posted November 28, 2017 Scriptname DYDJC_DamageObject extends ObjectReference Native ; Damages bridge or house. Event OnInit() DamageObject(100.0) GotoState("destructionDone") EndEvent State destructionDone Event OnInit() ; EndEvent EndStateThis sholud do the trick. Link to comment Share on other sites More sharing options...
Recommended Posts