Jump to content

FiftyTifty

Premium Member
  • Posts

    1274
  • Joined

  • Last visited

Everything posted by FiftyTifty

  1. So the GECK only does signed integers. What would be best, now that I think about it, is for NVSE to add unsigned integers. Wonder if NVSE is still developed.
  2. Floats are imprecise, and the bigger the value, the more imprecise they become. Integers, on the other hand, are the exact opposite. What you're better off doing, is sticking to ints and then converting it to float when you set the value.
  3. It's a terrible scripting system with terrible performance that runs every GameMode script every frame. You absolutely should not have a constant loop running every frame.
  4. I did a quick string search of FalloutNV.exe and didn't find any results for "INTObservitory". So might involve a bit of work.
  5. Having a timer run in the background like that is a horrible idea, the scripting system is not designed for that as it has woeful performance. It's much better to go with Mktavish's suggestion.
  6. DXT1 Has no alpha channel, so it has a much lower file size. DXT3 Has a 1-bit alpha channel, so it's somewhat bigger. DXT5 has a full 8-bit alpha channel, so it's much bigger. Odds are that the originals use DXT1.
  7. Seeing IStewieAI come out with these welcome small tweaks, I figured I'd have a shot at making one of my own. I learned Pascal and C# by modding ES and Fallout, so this would be a good stab at working with C++. Problem is, I can't find any documentation on making baby's first plugin. There is source code for an example plugin with NVSE, but no documentation. There's no explanation of functions, how to run code at specific game events, how to create a thread that constantly checks the game state, nada. So there's no real good starting point. The plugin I have in mind, is to adjust the AI accuracy GMST records depending on the time of day. If it's noon, they are set to high values. If it's midnight, they are set to very low values. And as the time changes, so do the values for the GMST records. It's small in scope, so it shouldn't require a couple hundred lines of code. So, I got to ask: are there any tutorials on starting out with making NVSE plugins?
  8. Another benefit to using ESMs, is that pre-Fallout 4 Bethesda games have all temporary forms, that are in ESP files, permanently in the memory heap unlike ESM files. In Fallout 4, Bethesda just made it so that all ESP files are treated as ESM files when the game loads.
  9. Try setting their aggression to 0, then calling ResetAI. int iDefaultAggression int iTempAggression let iDefaultAggression := Victim.GetAV Aggression let iTempAggression := 0 Victim.SetAV Aggression iTempAggression Victim.StopCombat Victim.ResetAI if (Timer >= 30) Victim.SetAV Aggression iOldAggression Victim.ResetAI endif
  10. You could try changing the aggression. int iDefaultAggression int iTempAggression let iDefaultAggression := Victim.GetAV Aggression let iTempAggression := 0 Victim.SetAV Aggression iTempAggression if (Timer >= 30) Victim.SetAV Aggression iOldAggression endif
  11. So my next conundrum in making my robot followers mod, is that the spawned robots attack anything nearby, regardless of their relation to the player. I made sure for the robots to have the same AI data as the player, and their only faction being allied to the PlayerFaction faction, so they shouldn't just attack innocents willy nilly, but they do. Here's how the AI Data tab is set up: Any idea what's causing the instantaneous combat? Edit: Nvm, fixed it. Had to set the aggression to "Aggressive" rather than "Very Aggressive".
  12. The intention is that the player will be able to have as many robots as they want, rather than just one of each type. That's why they gotta be spawned dynamically.
  13. Yeah, it's weird. I also tried adding the packages to the npc through the console and calling evp, but that had the exact same behaviour. It would work for the first time, but not subsequently. Calling resetai, however? Suddenly it works. It's not a problem with the calls being from a UDF.
  14. I'm so god damn big brained. I just have to call resetai after changing the number of tokens.
  15. The further implication is that a package added by that function is removed once it has completed, period. Such added packages are intended to be "temporary". Also: Your function is removing "AAAFyTyCompanionToken 13". The purpose of that is not clear, but unless you are restoring it elsewhere, one would expect that statement to "fail" after the first execution. As it is a valid statement the first time, you won't get a compiler error. I'm not clear on what will happen the second time through, but it might be causing the UDF function to fail at that point. -Dubious- I'll clarify. The packages are arranged top-down as per the wiki, and each of them rely on a specific number of these item tokens to be present in their inventory. For example, the waiting package requires 1 token present in the NPC's inventory, and the far sandbox package requires 10 tokens to be present. The highest number of tokens that can be present is 13 (i.e, 13 is what the last package requires). Through dialogue, the player sets the number of tokens in the NPC's inventory. I do this by removing the max number of tokens that could possibly be in an NPC's inventory. All the packages have one condition, i.e, GetItemCount AAAFyTyCompanionToken == 7 According to the wiki, packages are re-evaluated every ten seconds. With the number of tokens being different, the actor doesn't change his package, even after calling EVP and waiting ten seconds. I've no clue about that recursive thing. I guess I could just copy-paste the script into the dialogue entries, but that doesn't solve the fact that EVP isn't working, even when done through the console.
  16. Aye it works fine. Just now I have to figure out why subsequent EVP calls aren't working on the spawned NPCs. The first time I call EVP, the NPC selects the proper new package. But if I change the number of tokens (the item that the packages' conditions look at), it doesn't change, it sticks with the old package.
  17. Aye that script works, and it's better since it's got iWait as a failsafe.
  18. So I've made a companion framework, and it works by having a wee UDF that changes the number of tokens in the NPC's inventory, and then calls EVP afterwards. This works once, but calling EVP subsequently doesn't do anything, the NPC continues with their old package despite it's conditions no longer being valid. There are two sets of package flags: Sandbox & Follow packages - Continue if PC Near Guard packages - Continue if PC Near, Weapon Drawn The script that calls EVP is: scn AAAFyTySetActivePackage int iNumTokensToAdd ref refInventory Begin Function {iNumTokensToAdd, refInventory} refInventory.RemoveItem AAAFyTyCompanionToken 13 refInventory.AddItem AAAFyTyCompanionToken iNumTokensToAdd refInventory.EvaluatePackage End And this is one of the dialogue scripts: call AAAFyTySetActivePackage 5 GetActionRef As it works the first time it's called on the NPC, it should work just fine. The appropriate number of items are given to the NPC depending on it's package, so it's not an issue of residual tokens staying in the NPC's inventory. Any idea what the problem is?
  19. Alright, I made the script like so, after setting the effect duration to one hour: scn AAAFyTyRoboticianProtectronKitScript int iButton Begin ScriptEffectStart Print "Showing Message" ShowMessage AAAFyTyRoboticianMessageRepairProtectron Print $GetButtonPressed End Begin ScriptEffectUpdate let iButton := GetButtonPressed Print $iButton if iButton == 0 Player.PlaceAtMe AAAFyTyFactoryProtectron 1 Dispel AAAFyTyRoboticianProtectronKit elseif iButton == 1 Player.PlaceAtMe AAAFyTyMetroProtectron 1 Dispel AAAFyTyRoboticianProtectronKit elseif iButton == 2 Player.PlaceAtMe AAAFyTyNukaColaProtectron 1 Dispel AAAFyTyRoboticianProtectronKit elseif iButton == 3 Player.PlaceAtMe AAAFyTyProtectronArmy 1 Dispel AAAFyTyRoboticianProtectronKit elseif iButton == 4 Player.PlaceAtMe AAAFyTyProtectronArmyDC 1 Dispel AAAFyTyRoboticianProtectronKit elseif iButton == 5 Player.PlaceAtMe AAAFyTyProtectronDC 1 Dispel AAAFyTyRoboticianProtectronKit elseif iButton == 6 Player.PlaceAtMe AAAFyTyProtectronNV 1 Dispel AAAFyTyRoboticianProtectronKit elseif iButton == 7 Player.PlaceAtMe AAAFyTyProtectronEnclaveDC 1 Dispel AAAFyTyRoboticianProtectronKit elseif iButton == 8 Player.PlaceAtMe AAAFyTyProtectronOutcast 1 Dispel AAAFyTyRoboticianProtectronKit elseif iButton == 9 Player.PlaceAtMe AAAFyTyVaultProtectron 1 Dispel AAAFyTyRoboticianProtectronKit endif End The ScriptEffectUpdate block is called five times, all of them returning GetButtonPressed as -1, except for the fourth time, where it returns the number selected in the message. Now there's another problem that needs to be fixed, which is that the spawned actor doesn't re-evaluate it's AI after EVP has been called on it once before. I'll make a new thread.
  20. I changed the script to: scn AAAFyTyRoboticianProtectronKitScript int iButton Begin ScriptEffectStart Print "Showing Message" ShowMessage AAAFyTyRoboticianMessageRepairProtectron Print $GetButtonPressed End Begin ScriptEffectFinish let iButton := GetButtonPressed Print $iButton if iButton == 0 Player.PlaceAtMe AAAFyTyFactoryProtectron 1 elseif iButton == 1 Player.PlaceAtMe AAAFyTyMetroProtectron 1 elseif iButton == 2 Player.PlaceAtMe AAAFyTyNukaColaProtectron 1 elseif iButton == 3 Player.PlaceAtMe AAAFyTyProtectronArmy 1 elseif iButton == 4 Player.PlaceAtMe AAAFyTyProtectronArmyDC 1 elseif iButton == 5 Player.PlaceAtMe AAAFyTyProtectronDC 1 elseif iButton == 6 Player.PlaceAtMe AAAFyTyProtectronNV 1 elseif iButton == 7 Player.PlaceAtMe AAAFyTyProtectronEnclaveDC 1 elseif iButton == 8 Player.PlaceAtMe AAAFyTyProtectronOutcast 1 elseif iButton == 9 Player.PlaceAtMe AAAFyTyVaultProtectron 1 endif End Both blocks run, but since GetButtonPressed is always returning -1, the if iButton == block doesn't have a result.
  21. Begin MenuMode 1001 doesn't do anything with the script, unfortunately. That code block isn't processed. Same with GameMode. And GetButtonPressed is still returning -1.
  22. But that's the problem. The ScriptEffectStart block doesn't fire; the message doesn't appear. Even just having a Print "It works!" as the only line of code inside it doesn't work. Edit: Ah, I think I found the issue. I didn't attach the base effect to the ingestible. But that brings another problem; there's no option for me to add the base effect to the ingestible. I can add an effect time of the Script Effect type, but that's it, I don't get an option to select my base effect. 2nd Edit: Okay, I'm dumb. Didn't go to the beginning of the effect list. Now the message shows, but GetButtonPressed still returns -1. I'll try that ScriptEffectUpdate block next. 3rd Edit: So it turns out that GetButtonPressed still returns -1, despite the message being called before it. And ScriptEffectUpdate is called three times instead of once. This is getting to be a real pain in the arse. Could it be that GetButtonPressed is bugged?
  23. Ah yeah, my mod requires TTW, and my damage overhaul. The reason I needed variables, was because I was storing GetButtonPressed into an integer variable called iButton. There were two problems with the perk entry point script. Variables cannot be filled in entry point scripts, so iButton was always 0. And GetButtonPressed always returned -1 despite being called right after ShowMessage. Here's the script that is used on the item's base effect to spawn a sentry bot: scn AAAFyTyRoboticianSentryBotKitScript int iButton Begin ScriptEffectStart ShowMessage AAAFyTyRoboticianMessageRepairSentryBot let iButton := GetButtonPressed if iButton == 0 Player.PlaceAtMe AAAFyTySentryBotGL 1 elseif iButton == 1 Player.PlaceAtMe AAAFyTySentryBotGLArmyDC 1 elseif iButton == 2 Player.PlaceAtMe AAAFyTySentryBotGLArmyNV 1 elseif iButton == 3 Player.PlaceAtMe AAAFyTySentryBotGLEnclaveDC 1 elseif iButton == 4 Player.PlaceAtMe AAAFyTySentryBotGLOutcastDC 1 endif End The perk entry point script was almost identical. The base effects didn't have self enabled, so I changed that. It makes no difference, the script still doesn't run.
  24. I've been working on this for a couple of days to no avail. The mod I'm making is intended to be a replacement for Robco Certified, without all the bugs it entails. But I've hit several snags. The first was that I tried to make it so that you would directly repair robots through a perk entry point script, but that doesn't support variables. So I then tried calling a UDF through the entry point script, which didn't work either. Now I'm resorting to having the player salvage an item from the robot (which works just fine), and then have the player get shown a message, with a robot being spawned after the player picks a choice from the message. I did this by making the salvaged item an aid item, which the player then activates to show the message. But that doesn't work at all. I made the item which has the base effect that has the script to show the message. But the base effect doesn't run at all, as evidenced by my Print command not printing to the console. So how do I go about this? Here's a link to the mod: https://drive.google.com/open?id=1FeN45X75aD62ityuIh5c9Vx9t_OVH1KR
×
×
  • Create New...