TheBlackShadow Posted October 7, 2015 Posted October 7, 2015 Edit: Thanks Astymma and Doctasax, question Answered. I'll leave the post up if someone wants to read over it Oct-7-15 Hey guys and gals, I've been half way over the net looking for help to a problem that I have been having with some scripts on a mod I'm putting together. In the files of New Vegas there is a creature named NVCrSentryBotToy (More on it here: I can't post links but you can search it on the fallout wiki or search the sentry bot toy in you search engine of choice) it is a sentry bot that is a few inches tall and I have always had a fondness for it and added it to my inventory in all of my playthroughs of Vegas. I have tweaked the scripts and the creature itself to give it more of a purpose. A mod on the nexus site gave it a BB Mini-gun and I added a mini laser weapon as well (I'm sorry to ramble). The problem that I'm having is in it's creature script there is a "Begin OnActivate" line that is preventing dialogue with the bot from showing up, the script is essential to the inner workings of the bot, is there a way to keep the creature script and my dialogue in place for the bot? I hope I'm posting in the right place, I haven't been to this site much but I come to you hat in hand asking for help. Please and thank you guys. Here is the Pastbin with my script: pastebin com/SpUwf4zE PS. if anyone wants to know anything about this or the files just ask, any and all help is appreciated :3
DoctaSax Posted October 7, 2015 Posted October 7, 2015 I can't see your script - you may need a post or two more in order to be able to link around here. Vanilla's, for reference: scn NVCrSentryBotToyScript int Following ref ActivatingObject ref SentryBot ref SpawningObject begin OnActivate set ActivatingObject to GetActionRef set SentryBot to GetSelf ; If the sentry bot is healthy, pick it up if ActivatingObject.GetIsReference player && SentryBot.GetDead == 0 NVSentryBotToyREF.MoveTo NVSentryBotToyMarker player.additem NVSentryBotToyItem 1 ; Otherwise, player picks up a broken version elseif ActivatingObject.GetIsReference player && SentryBot.GetDead == 1 ; Place broken sentry bot in player's inventory NVSentryBotToyREF.MoveTo NVSentryBotToyMarker player.additem NVSentryBotToyItemBroken 1 endif ; Make toy stop following set Following to 0 NVSentryBotToyREF.evp end This means that when you activate it, a version gets added to your inventory, depending on whether it was dead or not. If you want to be able to talk to it, you could probably just remove the if-block. Not sure what exactly you're trying to achieve in terms of interaction with the thing.
TheBlackShadow Posted October 7, 2015 Author Posted October 7, 2015 Testing Thanks for the reply DoctaSax :3 This is the script I'm using as the creature script, I moved the pickup option into the result end script for a dialogue option called "Pick up" I have also added a goodbye option and intend to add a home option, sandbox, guard option, and search options for items like water, chems, and meds once a day. I enjoy the little bot very much and would love for it to have a purpose :3 I would also like to upload the bot so other may get a chance to use the little guy. ScriptName NVCrSentryBotToyScript int Following ref ActivatingObject ref SentryBot ref SpawningObject Begin OnActivate if SentryBot.GetDead == 1 set ActivatingObject to GetActionRef set SentryBot to GetSelf if ActivatingObject.GetIsReference player set Following to 0 NVSentryBotToyREF.MoveToMarker NVSentryBotToyMarker NVSentryBotToyREF.SetPlayerTeammate 0 NVSentryBotToyREF.EvaluatePackage ; If the sentry bot is dead, pick it up broken and resurrect sentrybottoy if SentryBot.GetDead == 1 ResurrectActor 0 resethealth restoreav perceptioncondition 100 restoreav endurancecondition 100 restoreav leftattackcondition 100 restoreav leftmobilitycondition 100 restoreav rightattackcondition 100 restoreav rightmobilitycondition 100 if player.GetItemCount NVSentryBotToyItemBroken < 1 player.AddItem NVSentryBotToyItemBroken 1 NVSentryBotToyREF.EvaluatePackage endif endif endif endif endif End Begin OnCombatEnd if(GetPlayerTeammate == 1 && GetDead == 0) resethealth restoreav perceptioncondition 100 restoreav endurancecondition 100 restoreav leftattackcondition 100 restoreav leftmobilitycondition 100 restoreav rightattackcondition 100 restoreav rightmobilitycondition 100 endif End How to I post the script with proper indention so it's easy to read like you did? Sorry for being so new : P
astymma Posted October 7, 2015 Posted October 7, 2015 To get proper indentation, post the code inside a BBCode CODE block. Just highlight the text in your post and click the button that looks like <>. Also, you should remember that an OnActivate block blocks further activation... which includes dialogue. If you want an OnActivate block to continue normal activation and produce dialogue on a creature (robot), then add an Activate call like so: Begin OnActivate ;do a bunch of stuff Activate End That way, all the "do a bunch of stuff" code gets done, but it will continue with normal activation. This applies to all OnActivate blocks. They should include a call to Activate to allow for whatever their normal behavior would be if the OnActivate didn't exist if your intent is to allow that.
TheBlackShadow Posted October 8, 2015 Author Posted October 8, 2015 Thanks for the tips astymma :3 I really appreciate it, I'll definitely try out what you suggested.
TheBlackShadow Posted October 8, 2015 Author Posted October 8, 2015 To get proper indentation, post the code inside a BBCode CODE block. Just highlight the text in your post and click the button that looks like <>. Also, you should remember that an OnActivate block blocks further activation... which includes dialogue. If you want an OnActivate block to continue normal activation and produce dialogue on a creature (robot), then add an Activate call like so: Begin OnActivate ;do a bunch of stuff Activate End That way, all the "do a bunch of stuff" code gets done, but it will continue with normal activation. This applies to all OnActivate blocks. They should include a call to Activate to allow for whatever their normal behavior would be if the OnActivate didn't exist if your intent is to allow that. I think that did the trick! Thank you so much my friend you are my hero :3 I need to do a little more fiddling but I think it's golden! Thanks again astymma!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.