The forum has been set to read-only mode. For community discussion and questions, head over to our Discord: https://discord.taleoftwowastelands.com

Creating an alternative to Robco Certified, hit an issue with scripting

General mod discussion and requests.
Post Reply
User avatar
FiftyTifty
Posts: 493
Joined: Tue Apr 09, 2013 7:36 pm

Creating an alternative to Robco Certified, hit an issue with scripting

Post by FiftyTifty » Sat Nov 17, 2018 6:18 pm

The way Robco Certified handles the robot followers is extremely convoluted, script heavy, and has a couple of very bizarre bugs. So I figured I'd make an alternative that is lightweight, fully functional, and supports TTW out of the box.

But I've hit a snag. For some reason, the GECK (even with GECK Extender) won't compile a script's if condition block. Originally, I used GetIsVoiceType, and it didn't work, so I tried using IsInList. That didn't work either.

The problem isn't the code inside the if condition block, but the if condition itself. No error is thrown, the GECK just refuses to compile it.

The script is to be attached to my perk AAAFyTyRoboticianSalvageRobot via a perk entry point. I thought that could be the issue, so I tried making a UDF instead. But the same issue occurred; the script does not get compiled, and no error is shown in the error window.

Here's the mod: https://drive.google.com/file/d/1FeN45X ... sp=sharing

Here's the script in question: https://pastebin.com/raw/gVLWdZ7Y

I'm using the latest NVSE and JIP plugin, and I launch the GECK via a bat file calling NVSE_Loader.exe -editor, so it's not an issue of the functions not existing.

User avatar
FiftyTifty
Posts: 493
Joined: Tue Apr 09, 2013 7:36 pm

Re: Creating an alternative to Robco Certified, hit an issue with scripting

Post by FiftyTifty » Sat Nov 17, 2018 9:45 pm

I changed the script to use IsRefInList, and the script compiled. However, none of the if checks returned true, so the code wasn't processed in-game. I then tried IsInList, and it also compiled, but none of the if checks passed either.

Here's the script that compiles: https://pastebin.com/2V1sxUxS

User avatar
FiftyTifty
Posts: 493
Joined: Tue Apr 09, 2013 7:36 pm

Re: Creating an alternative to Robco Certified, hit an issue with scripting

Post by FiftyTifty » Sat Nov 17, 2018 9:56 pm

Did a bit of poking around, and the reason why it's not working even though it compiles, is that the let refRobotToRepair := GetActionRef command is failing. Why it's failing? No idea.

It throws the following error in the console:

Error in script 00000000
An expression failed to evaluate to a valid result
File: FalloutNV.esm Offset: 0x0000 Command: Let

User avatar
FiftyTifty
Posts: 493
Joined: Tue Apr 09, 2013 7:36 pm

Re: Creating an alternative to Robco Certified, hit an issue with scripting

Post by FiftyTifty » Sat Nov 17, 2018 10:38 pm

Right, so it turns out that you can't use variables in perk entry scripts. Easy enough to work around, I just keep calling the function that returns what I want. Not great for performance, but this isn't being run on a per-frame basis.

The trouble now, is that GetButtonPressed always returns -1 for some reason.

Here's the current incarnation of the script, which is now a UDF called by the perk: https://pastebin.com/raw/zn0J8Ufr

Post Reply