prideslayer Posted March 12, 2015 Posted March 12, 2015 Yes, the events seem like they'll work wonderfully for this. I will see about implementing at least a few, starting with the ready notification and global notifications in the current beta cycle.
Halstrom Posted March 12, 2015 Author Posted March 12, 2015 Yeah I found a lot of stuff like formlists, GetDead checks etc don't fill properly till up to 9 seconds, so all my stuff waits a few seconds before filling formlists, then doesn't start running till at least 9 seconds. This sounds like a cool way to do it, currently I use a globalcounter in SCR and I have my mods check it has been under 9 seconds and is now over it before starting, because the global wasn't being reset to 0 in time, but that's not perfect either.
Guest tomm434 Posted March 13, 2015 Posted March 13, 2015 Wanted to share this script with you - it automaticly adds version# in MCM menu mod name. string_var sv_SubmitVersion begin GameMode if GetGameRestarted if IsModLoaded "The Mod Configuration Menu.esp" set iMaster to GetModIndex "The Mod Configuration Menu.esp" set rList to BuildRef iMaster 2790 let sv_SubmitVersion := "Sexout Submit v1.0" + $SexoutSubmitVersion ; SexoutSubmitVersion -short global variable Setname $sv_SubmitVersion SubmitQuestMCMToken ListAddForm rList SubmitQuestMCMToken sv_destruct sv_SubmitVersion endif endif end Also another script (based on Odessa's debug log) which makes debug filename look better (in my opinion) - it adds zeroes before numbers if they are less than 10 let aUT := GetUserTime foreach entry <- (Ar_List "Year", "Month", "Day", "Hour", "Minute", "Second") let sv_svkey := entry["value"] if eval sv_svkey == "Hour" let sv_file_name += "-" endif if eval aUT[sv_svkey] < 10 let sv_file_name += "-0" + $aUT[sv_svkey] else let sv_file_name += "-" + $aUT[sv_svkey] endif loop Old version (without addition) FalloutTTWQuestOverhaul-Debug--2015-2-20--11-3-49 New version FalloutTTWQuestOverhaul-Debug--2015-02-20--11-03-49
Guest Posted March 14, 2015 Posted March 14, 2015 To Halstrom and the Windows 8 users: http://forums.bethsoft.com/topic/1515231-geck-problems-in-windows-8-gone-name-of-the-topic/?do=findComment&comment=23914293
Halstrom Posted March 14, 2015 Author Posted March 14, 2015 To Halstrom and the Windows 8 users: http://forums.bethsoft.com/topic/1515231-geck-problems-in-windows-8-gone-name-of-the-topic/?do=findComment&comment=23914293 Damnit, I had this problem fix itself when I updated from windows 8 to windows 8.1, 18 months ago, my hard drive crashed at Xmas and I had windows 8 re-installed on a new drive and updated to 8.1 and the GECK columns have never worked since, long before the march updates mentioned, stupid windows people
Guest luthienanarion Posted March 15, 2015 Posted March 15, 2015 Scn SexoutOffSpring0RenameTokenScript ref rPlayer ref rMsgA ref rMsgB ref rTarget int bMenu int sAdded int iRemoving Begin OnAdd Set rTarget to GetContainer Set rPlayer to PlayerREF Set rMsgA to SexoutOffSpringNameMsgA Set rMsgB to SexoutOffSpringNameMsgB SetNameEx "%n" rPlayer rMsgA SetNameEx "%n" rTarget rPlayer GetPlayerName Set sAdded to 1 End Begin GameMode if (0 == sAdded) Return endif if (1 == bMenu) && iRemoving < 1 SetNameEx "%n" rPlayer rMsgB rTarget.SetActorFullName SexoutOffSpringNameMsgB PlayerREF.SetActorFullName SexoutOffSpringNameMsgA rTarget.NX_SetEVFo "SOF:rOffSpringName" SexoutOffSpringNameMsgB RemoveMe Set iRemoving to 1 endif End Begin MenuMode 1051 Set bMenu to 1 End Here's the original version of that script (with comments intact) from my Renamer Rifle mod: scn lutRenamerTokenOS ref playername ref itemname1 ref itemname2 ref actorname short namemenu short invalidref short remove short removed begin gamemode if(remove) ; Prevent RemoveMe being called more than once. if(removed) else set removed to 1 removeme endif endif if(invalidref) ; Abort the script and set the token for removal if the target is invalid. set remove to 1 return endif if(namemenu == 1) ; Wait for the text input to close before renaming actors. setnameex "%n" playername itemname2 ; Copy the new player name to the "name" of MSG2. actorname.setactorfullname lutRenamerMSG2 ; Set the actor's name to the "name" of MSG2. player.setactorfullname lutRenamerMSG1 ; Set the player's name back to what we saved in MSG1. set remove to 1 ; Set the token for removal. else set playername to player set itemname1 to lutRenamerMSG1 ; SetNameEx requires a ref variable for input, while SetActorFullName requires a MESG object. set itemname2 to lutRenamerMSG2 ; Point our ref variables to our MESG objects. set actorname to getcontainer ; Get the actor the token is on. if(actorname) if(gettype actorname != 42 && gettype actorname != 43) set invalidref to 1 ; Don't rename non-actor containers. return endif setnameex "%n" playername itemname1 ; Copy the player's name to the "name" of MSG1. setnameex "%n" actorname playername ; Copy the actor's name to the player so that GetPlayerName shows the name of the actor. getplayername ; Open the player-name input box. This uses MenuMode 1051 endif endif end ; gamemode begin menumode 1051 ; "Text-Edit" mode used by GetPlayerName. set namemenu to 1 end ; menumode 1051It could probably be simplified, but it predates NVSE4. The player's name displayed in the Pip-Boy stats menu is updated by GetPlayerName but not by SetActorFullName; that's why the displayed name changes until the game is reloaded. (SetActorFullName is used instead of SetNameEx for renaming the actor because the change is permanent.) The correct name is used everywhere else. The extra guard against calling RemoveMe twice is included because an object script that calls it may or may not run an extra time and hit the RemoveMe call again, which crashes the game.
Guest Posted March 16, 2015 Posted March 16, 2015 To Halstrom and the Windows 8 users: http://forums.bethsoft.com/topic/1515231-geck-problems-in-windows-8-gone-name-of-the-topic/?do=findComment&comment=23914293 Damnit, I had this problem fix itself when I updated from windows 8 to windows 8.1, 18 months ago, my hard drive crashed at Xmas and I had windows 8 re-installed on a new drive and updated to 8.1 and the GECK columns have never worked since, long before the march updates mentioned, stupid windows people This guy removed that update and solved the problem, so another confirmation of what stated above here. http://forums.nexusmods.com/index.php?/topic/2679079-geck-error-dialogue-topics-and-conditions-invisible-and-uneditable/&do=findComment&comment=23514774
Guest tomm434 Posted March 22, 2015 Posted March 22, 2015 So after item is dropped by player inventory it becomes temp reference (reference starts with 'ff'). So is there any way I can check ref for that except for transforming reference into a string and checking if it starts with "ff"?
prideslayer Posted March 22, 2015 Posted March 22, 2015 Refs are just integers. Check if the value is >= 0xFF000000.
Guest tomm434 Posted March 22, 2015 Posted March 22, 2015 Refs are just integers. Check if the value is >= 0xFF000000. What value ? How do I extract value from reference?
prideslayer Posted March 22, 2015 Posted March 22, 2015 NVSE doesn't like it as it's more strict, so you have to resort to the old way of doing things. int iRef ref rRef ; .... rRef contains some ref set iRef to rRef if iRef >> 24 == 255 ; ref is dynamic endif I also don't remember if you can do the shift and compare in one line or not. If not: int iRef int iShifted ref rRef ; .... rRef contains some ref set iRef to rRef let iShifted := iRef >> 24 if iShifted == 255 ; ref is dynamic endif Or if you'd rather avoid the shift. int iRef ref rRef ; .... rRef contains some ref set iRef to rRef if iRef >= 4278190080 ; this is 0xFF000000 ; ref is dynamic endif
jaam Posted March 22, 2015 Posted March 22, 2015 Use GetSourceModIndex: if GetSourceModIndex MyRef == 255 ; It is a temporary ref endif
Guest tomm434 Posted March 22, 2015 Posted March 22, 2015 Thanks you both! BTW when NPC activates items (via find package) which is dropped by player game CTDs.
Guest tomm434 Posted March 22, 2015 Posted March 22, 2015 hm I tested it with NVSE enabled of course. I set Target item via "SetPackageTargetReference".
Synthael Posted March 24, 2015 Posted March 24, 2015 I've been developing a few mods lately, and one of the more complex ones is the Armor Switcher. In my game I have 5 different body replacers running simultaneously, each is tied to a race (or a few). Armor Switcher is supposed to scan all actors and equip armor modeled after that replacer. Basic framework for it works, armors are reequipped depending on the race / body combination, but as I didn't test it out on a longer game yet, I'm curious if I'm missing out on something. I was initially trying to make it work on cell changing, but there's no block function that'll help me with that. Here's the basic part of the code with one of the switching conditions (I'm going to move all the switches on different scripts, one for each replacer): array_var people array_var switcher ref woman begin GameMode let people := GetRefs 42 -1 ForEach switcher <- people Let woman := switcher["value"] if woman.GetIsSex female if woman.GetIsRace Hispanic if woman.GetEquipped ArmorLeather woman.additem T6ArmorLeather 1 1 woman.unequipitem ArmorLeather woman.removeitem ArmorLeather 1 woman.equipitem T6ArmorLeather endif endif endif Loop end I still need to refine the parts for unequipping the armor and reverting it to a normal one and copying the condition for the armors being switched, so you don't get magically repaired armor every time you equip it. My question is: Will it work on random spawning enemies, like raiders, patrols and other like that, or I need to add/remove something?
prideslayer Posted March 24, 2015 Posted March 24, 2015 Looks fine to me at a glance. You may want to add in a gethealth/sethealth so that they don't get 'new' armor whenever you swap one.
DoctaSax Posted March 24, 2015 Posted March 24, 2015 Looks fine, yeah. I'm guessing this is only related to women, so you may want to skip males with a continue command at the top end of your loop, rather than go through a bunch of conditions that don't apply. foreach .... if woman.getissex male continue elseif someothercondition endif loop
Guest Posted March 24, 2015 Posted March 24, 2015 This scrap checks for cell change, in case you need it: Let rNewCell := Player.GetParentCell if rNewCell == rOldCell PrintC "Same cell" else Let rOldCell := rNewCell PrintC "Cell changed" endif
Synthael Posted March 24, 2015 Posted March 24, 2015 Thanks, your suggestions are really useful, now I know how to improve things. When I refine the mod and make it work as I want, might put it up here, I know people were asking for stuff like this, but nobody delivered, hehe...
Halstrom Posted March 24, 2015 Author Posted March 24, 2015 Thanks, your suggestions are really useful, now I know how to improve things. When I refine the mod and make it work as I want, might put it up here, I know people were asking for stuff like this, but nobody delivered, hehe... If you do it on NPC's there's a nasty GECK trick that an object token script on a NPC can't add an item to an NPC for some reason, it causes CTD, but it works on a player fine, I had to use an effect or token script instead in Pregnancy and damaged armor swapping.
Halstrom Posted March 25, 2015 Author Posted March 25, 2015 Aggh.... just spent 3 hours chasing this causing a script freeze, it compiles fine of course: if iCurrDebug <> iPrevDebug instead of this: if iCurrDebug != iPrevDebug Something left over in my brain from VIC20 BASIC days.........
prideslayer Posted March 25, 2015 Posted March 25, 2015 Haha nice That's also the pascal way, and works in most SQL flavors.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now