Guest Posted June 28, 2014 Posted June 28, 2014 Same, you need to set variables. My best bet still remains using Lutana's plugin. It is redistributable, it has permissions, just (obviously) credits. One of these days I'm going to script that, I really need it and I delayed too much. Willow, JT, Niner, Delilah and Gilbert, really, they have no reasons to change their Ref (well, ok, Willow's last updates were quite an exception in my opinion, I bet it won't happen for the next years)
Nessa Posted June 28, 2014 Posted June 28, 2014 I think Willow has some kind of auto-reset packages on her. Perhaps in one of her scripts. She is a real pain to deal with! Thought about it too but there are no script like that in her object script. Hmm. Well I don't know why Willow is such a pain then. I know working with Brisa is nothing in comparison. (Also neither was Wendy Gilbert which I believe is the same author as Brisa.) Of course, my usual preference is to just shoot Willow dead and that solves all kinds of problems. (Most notably her singing and commentary.) But I doubt that will be an acceptable result for other players! It couldn't hurt to give Lutana's plugin a try with this. If it works perhaps one could throw in checks for each specific non-vanilla companion. Just in the off chance somebody has a companion that does something crazy. EDIT: Oh I see! Make a list of known references, THEN use Lutana's plugin to set the appropriate variable. Worth a try!
Guest tomm434 Posted June 28, 2014 Posted June 28, 2014 Nessa, welcome to the club. EDIT: Oh I see! Make a list of known references, THEN use Lutana's plugin to set the appropriate variable. Worth a try! keep in mind that Willow uses 2 variables -one for being hired after player gave her beauty and another for the just following. When I was making Willow pluign, I set both of them to 0 just in case. imho better go with restrain . What you do is called intervention in other mods.And what about simple disable? Shoudn't cause any trouble.
Nessa Posted June 28, 2014 Posted June 28, 2014 Nessa, welcome to the club. keep in mind that Willow uses 2 variables -one for being hired after player gave her beauty and another for the just following. When I was making Willow pluign, I set both of them to 0 just in case. imho better go with restrain . What you do is called intervention in other mods. And what about simple disable? Shoudn't cause any trouble. Heh, oh so I'm not the only one that likes the "bullet to head" solution? :angel: Hmmm. Disable. I like this idea. Though it could be a little dangerous. That would work very nicely for scenarios where your companions aren't supposed to be there. Though it's going to probably mean messing with uh.. whatever arrays are called in NVSE-speak. Or perhaps not, I could just set the limit to 7 followers and just handle those. If vanilla, warp somewhere, wait. If non-vanilla, disable. Then when the scenario runs it's course, warp vanilla to player, enable non-vanilla and warp them to player. So far that might be the easiest for me to try. I'm not the greatest at scripting in GECK-zone.
Guest tomm434 Posted June 28, 2014 Posted June 28, 2014 On the second thought disable might be daneroud indeed. I still don't understand why sometimes after disable-enable actor he's got his Base Object items and in other cases he has what he had before being disabled. Anyway, if you decide not to go with disable, I think setunconsious will be better than setrestrained because actor can still talk while being retsrained but while unconscious, he is a dummy.
Nessa Posted June 28, 2014 Posted June 28, 2014 Well in the first two scenarios (BAD ends that is) companions should be able to speak. The trouble is, if you start warping the player around the non-vanilla followers like to insert themselves in the middle of the player if not restrained. But I've got another scenario rummaging around in my head where the player should be alone for a good portion of it. (Plus in my mind it's a little more exciting to be stuck alone and have to free your friends.) So on that one perhaps I'll try set unconscious/setrestrained.
Odessa Posted June 28, 2014 Posted June 28, 2014 There is also SetActorsAI 0. I've never tried it. If checking the IsPlayerTeamMate or factions is unreliable, another option: Assuming you created the cell, or otherwise know all the actors that should be in it: array_var Interlopers array_var PermittedActors ref rActor let PermittedActors := Ar_List PlayerREF, PermittedActor1, PermittedActor2..... let Interlopers := Ar_Construct "array" let rActor := GetFirstRef 200, 0 while rActor != 0 if eval (Ar_Find rActor, PermittedActors) == Ar_BadNumericIndex ; * Not Found Ar_Append Interlopers, rActor ; * remember them ; * then get rid of interloper rActor somehow endif let rActor := GetNextRef ; * apparently Pencil01 is unnecessary.. loop ; When you're done you can just loop through the Interlopers array to reset them Arrays are quite easy, its definitely worth reading the good doctor's tutorial. Also someone ( ) is adding them to the GECK wiki
Halstrom Posted June 29, 2014 Author Posted June 29, 2014 Has anyone seen a way to add base effects to Actor or Object effects by script? So we could avoid dirty editing of Armor, Weapons & Ammo to add new effects. I'm thinking the conditions part could be the real show stopper from this being plausible.
Xilandro Posted June 29, 2014 Posted June 29, 2014 Has anyone seen a way to add base effects to Actor or Object effects by script? So we could avoid dirty editing of Armor, Weapons & Ammo to add new effects. I'm thinking the conditions part could be the real show stopper from this being plausible. Nope =\ Maybe there's something like that in OBSE?
Guest Posted June 29, 2014 Posted June 29, 2014 Assuming you created the cell, or otherwise know all the actors that should be in it: It was the case of the station door in Alice, it was scripted so that for few seconds, a bunch of minutes, the player was triggering the video when going out. I didn't put a GetRef because I thought "who the hell should enter through that door? it's completely outside anyone else's range, it can't be affected by sandbox too..." I was wrong: Al fled from the king's guy, you know the one that gives you gifts around Freeside, so the guy stalked him and entered in that door when the script could be executed, firing the script. What happened after that, was something completely unbelievable, Al was continuously teleported back and forth, something very strange, something that wasn't concerned to the script itself... it was broken, in a bad way Anyway, just to say that's hard to find who should be in a place and who shouldn't be, in games like these where too many factors can influence npc's behaviours. An example could be the ghoul that reaches you randomly after some time, in The Inheritance quest, but also that other guy in vanilla that follows you with the star bottlecaps, I forgot the name... if there's a possibility in 1000 that he arrives in the wrong moment, be sure he will do... ... unless of course you don't want to restrain everyone else and not only companions
jaam Posted June 29, 2014 Posted June 29, 2014 A) you cannot use scripted effect on actor/creature, they stop working as soon as the character looses focus. Non scripted effect works fine. Why not just create a perk ? Adding perk by script is fully supported Looks like this was bad advice, as AddPerk and HasPerk only work on the PlayerRef.
Guest tomm434 Posted June 29, 2014 Posted June 29, 2014 Somebody plays with GetHair\SetHair functions? ; Greensethaircolor 007700update3d; Goldsethaircolor 808080update3d; Redsethaircolor 000080update3d; Maroon;sethaircolor 800000update3dendif The problem is - I can't get Brown color! (I need to switch NPC to original hair color and I don't know the number) There is the site http://www.colorhexa.com Th numbersof hair color in GECK for brown is: (I took it right from NPC form id) rgb 40 34 23 HEX color for them is 282217. But ingame this color is something like yellow! but if you type all the colors above to this site, it will return perfect match of how these color will look ingame. But this doesn't applies only for Brown. And getHair function doesn't help. let hair := LunetteRef.GetHairColor 1 Lunette printC "String hair is %i" hair let hair2 := LunetteRef.GetHairColor 1 Lunette printC "String hair is %2f" hair2 ;Lunette==FormID ;This code gives me mistake(engine can't execute "let" in both cases) I need to type "1" or script won't comply. But what's the use of thic function then if I have to mention hair color myself? GetHairColor gets an NPCs hair color (code: 1=Red, 2=Green, 3=Blue, other=color) [ref.]GetHairColor hairColorCode:int [NPC:npc]
jaam Posted June 29, 2014 Posted June 29, 2014 RGB values should be specified as Decimal, not Hexadecimal. The engine does not have a hexadecimal notation. Why do you specify both a ref and a NPC ? It's supposed to be one or the other. In that case the ref should be ignored, and the NPC used logically. Maybe let got confused, but in most case the ref is automatically implied by the owner of the script.
Guest tomm434 Posted June 29, 2014 Posted June 29, 2014 No, in both cases let hair := GetHairColor 1 Lunette and let hair := LunetteRef.GetHairColor 1 I get mistake. But printC "String hair is %2f" hair2 from the script above returns number which depends on NPC current hair color For example SetConsoleOutputFilename >> 'HairCOlor'FalloutTTWQuestOverhaul loaded at index (hex): 27 or (dec): 39Error in script 2901681eOperator := failed to evaluate to a valid resultFile: Lunette.esp Offset: 0x00BA Command: LetError in script 2901681eAn expression failed to evaluate to a valid resultFile: Lunette.esp Offset: 0x00BA Command: LetString hair is 00000000String hair is 244.000000Error in script 2901681eOperator := failed to evaluate to a valid resultFile: Lunette.esp Offset: 0x00BA Command: LetError in script 2901681eAn expression failed to evaluate to a valid resultFile: Lunette.esp Offset: 0x00BA Command: LetString hair is 00000000String hair is 144.000000 but I use 144 for sethaircolor function "sethaircolor 144" it will set the wrong color. ps. and hair2 is an int variable, hair1 is a string update. I converted 282217 to hexadecimal and I result is "44e69" which won't comply since sethair doesn't work with any letters.
Odessa Posted June 30, 2014 Posted June 30, 2014 Could someone clarify the NVSE command PickOneOf? According to documentation: Returns a random item in the FormList that is present in the NPC inventory. So if: MyFormList has forms: A, B, C MyRef has inventory: B, C, D the line: MyRef.PickOneOf MyFormList ; * returns randomly either B or C? And would just return Nothing, iff Formlist INTERSECTION Inventory = Nothing Is this the only usage? It would be great if you could skip the reference to just pick one random item from a form list, like: PickOneOf MyFormList or MyFormList.PickOneOf MyFormList (NVSE source code) bool Cmd_PickOneOf_Execute(COMMAND_ARGS) { UInt32* refResult = (UInt32*)result; *refResult = 0; BGSListForm* pFormList = NULL; tList<TESForm> present; Actor* pActor = NULL; SInt32 count; UInt32 random; //DEBUG_MESSAGE("\n\tCI PickOneOf Called"); pActor = DYNAMIC_CAST(thisObj, TESForm, Actor); if (!pActor) return true; if (ExtractArgs(EXTRACT_ARGS, &pFormList)) { present.Init(); for (int i = 0; i < pFormList->Count(); i++) { GetItemByRefID(thisObj, pFormList->GetNthForm(i)->refID, &count); if (count > 0) present.AddAt(pFormList->GetNthForm(i), 0); } switch (present.Count()) { case 0: break; case 1: *refResult = present.GetNthItem(0)->refID; break; default: random = MersenneTwister::genrand_real2() * (present.Count()); *refResult = present.GetNthItem(random)->refID; } } return true; }
Xilandro Posted June 30, 2014 Posted June 30, 2014 If you need to pick random ref from list - you can make this thing: set iCount to ListGetCount MyList set iRandom to rand 0 iCount set rRef to ListGetNthForm MyList iRandom Sure, not so handy like one function, but still the only way to do it (afaik)
nyaalich Posted June 30, 2014 Posted June 30, 2014 I know that T! has a random item picker in DRL, but I'm not awake enough to go hunting down the script to see how he does it.
Odessa Posted June 30, 2014 Posted June 30, 2014 Yeah, I have a UDF already, and it also works as a CO 1-liner: ListGetNthForm FL, (Rand 0 (ListGetCount FL)). I am wondering specifically what the PickOneOf function does.
jaam Posted June 30, 2014 Posted June 30, 2014 Exactly what you said. It's purpose was to randomly select an article in those present in a character inventory.
Halstrom Posted June 30, 2014 Author Posted June 30, 2014 Exactly what you said. It's purpose was to randomly select an article in those present in a character inventory.One that picked a random item from any formlist would be handy at times
Nessa Posted June 30, 2014 Posted June 30, 2014 OK, let's discuss.... ResetInterior and ResetQuest! One, does ResetInterior actually do anything? I have a dream sequence I'd like to completely reset every time the player leaves. (So the player can have the dream again.) So at first I thought, well that's simple! Call ResetInterior. Yeah, that no work. Then I thought, well I probably can't call ResetInterior while the player is in the same cell. So I made another script that fires only when the player is NOT in the cell to be reset. Still.... NO WORK. At this point, I'm thinking I'll simply slap a reference on every single bad guy I want resurrected and have my cleanup script resurrect everyone when the player leaves. THAT will work! Now: ResetQuest. Is there a point here? According to the documentation ResetQuest will reset all quest variables. Only, this appears not to occur. I have a "DoOnce" setup in one of my repeatable quests. Calling ResetQuest before or after stopping this quest apparently has no effect whatsoever on the quest variables. I have to set them myself before stopping the quest. Or... should I do it after stopping it? From what I can tell, a quest's script will continue to run even after you've stopped it for one more cycle.
Halstrom Posted July 1, 2014 Author Posted July 1, 2014 I'm adding some Pregnancy options at the medical clinic. This is my first foray into dialogue so I really have little idea what I'm doing. Anyone got an idea why the 3rd dialogue choice isn't showing up when I speak to Dr Usagi at the clinic, the one above it with the same conditions shows up ok thereby proving the token is there The idea of the 4th choice is != DrUsagi and != DocMitchell and belly size is > P0 & < P3 I have 2 different abortion dialogues, one for Dr Usagi and one for other doctors when I add this to other doctors dialogue as I wantred different text and only Dr Usagi to perform Advanced Abortions
Guest tomm434 Posted July 1, 2014 Posted July 1, 2014 What is a topic? Here is an example for you. Take a look at this picture. Each dialogue choice is a topic which consists of responses. Responses consist of: 1)player text – what player says 2) NPC text – what NPC answers. That's from my unfinished guide for dialogues. So, what you've got here is 1 topic with many responses meaning that only 1 response can be on the screen at a time. You need to create another topic and move the response to it. And response priority goes from UP to DOWN so game will pick the toppest response which has true conditions.(you can have many reponses in 1 topic if you want, play with conditions. For example you don't want to create additional topic for each stage for one question "how goes the pregnancy?") So you'll create responses in 1 topic and add conditions ------------------- Response1 Prompt: How goes the pregnancy? NPCText: YOu're not pregnant Cond: If Bellysize ==0 --------------------- Response2 Prompt: How goes the pregnancy? NPCText: You've just got pregnant Cond: If Bellysize ==1 -------------- Response3 Prompt : How goes the pregnancy? NPCText: You've got pregnant a month ago Cond: If Bellysize ==2 etc. and player will always see the response according to his pregnancy stage in 1 topic. Or won't see it at all if all conditions are false.
ArgusSCCT Posted July 1, 2014 Posted July 1, 2014 I need an opinion on something. I finally figured out the HUD problems, I should've taken a closer look to that damnable XML. Anyway, here's an image of what I am trying to accomplish: This what the old Powered Power Armor displays once you equip a power armor. What the following script displays is the thing with the green circle around. But it does only that, I didn't implement anything to display the part with the red circle, and here's where my question comes in. So far this is what I've done with my script and it looks pretty big. scn PPAPowerArmorInitialization ref refArmor int bNuclearArmor int bPowerArmor int bQuestStatus int iStage float fHudTimer float fColor Begin GameMode ;Variable initialization for power armor initialization Let refArmor := playerREF.GetEquippedObject 2 Let bPowerArmor := IsPowerArmor refArmor Let bQuestStatus := GetQuestRunning PPAPowerArmorQuest Let fColor := GetNumericIniSetting "fHudOpacity:Interface" * 255 SetUIFloat "HudMainMenu\_PPAHUDAlpha" fColor Let fHudTimer += GetSecondsPassed Let bNuclearArmor ;Power armor initialization, displays Initializing image, checks if the players is wearing power armor If (bPowerArmor == 1 && bQuestStatus == 0) If (iStage == 0 && fHudTimer >= 1) SetUIString "HudMainMenu\_PPAInitTextFile" "PPA\Icons\PPA_Text_IA.dds" SetUIFloat "HudMainMenu\_PPAInitTextAlphaMult" 1 Let PPASound.bPlayInitializing := 1 ;triggers SoundQuestScript through Let iStage := 1 ElseIf (iStage == 1 && fHudTimer >= 3) SetUIFloat "HudMainMenu\_PPAInitTextAlphaMult" 0 Let iStage := 0 Let fHudTimer := 0 StartQuest PPAPowerArmorQuest ;Once power armor is detected, a quest that is tied to most of the other scripts in this mod is initiated EndIf ElseIf (bPowerArmor == 0 && bQuestStatus == 1) ;This block shuts down power armor If (iStage == 0 && fHudTimer >= 1) SetUIString "HudMainMenu\_PPAInitTextFile" "PPA\Icons\PPA_Text_SS.dds" SetUIFloat "HudMainMenu\_PPAInitTextAlphaMult" 1 Let PPASound.bPlayShuttingDown := 1 Let iStage := 1 ElseIf (iStage == 1 && fHudTimer >= 3) SetUIFloat "HudMainMenu\_PPAInitTextAlphaMult" 0 Let iStage := 0 Let fHudTimer := 0 StopQuest PPAPowerArmorQuest EndIf EndIf End In my opinion, I'd start a new script for the part with the red circle. That part of the HUD depends on various things, the old mod classified power armor in two types, either it had a nuclear reactor or it needed batteries to get powered. Each of those two different types of armors have a different look with that, not much changed but the Ifs necessary to check this will probably need to check more than one thing, whether I put it in separately, or within one of the ifs that already exist with this script it seems to me, like it will end up being a huge mess just like it was before with the old mod. If I put it in another script, it'll require another new quest. My question is this, if I have too many quests and scripts tied to those quests, will that cause trouble, especially if some of those use GameMode? This mod is heavily scripted, in fact I'd say that most of its features exist through scripting. Also is there any impact on the game through those variable declarations at the beginning of my script? I'm almost done with this part, which I'd say is the most relevant part of the mod.
Guest tomm434 Posted July 1, 2014 Posted July 1, 2014 If I put it in another script, it'll require another new quest. My question is this, if I have too many quests and scripts tied to those quests, will that cause trouble, especially if some of those use GameMode? This mod is heavily scripted, in fact I'd say that most of its features exist through scripting. Don't be too much paranoid about buggin game down with quests. Just do what you can and then optimize script as you can. You have no idea(figure of speech) how heavy some mods are(Project Nevada, reactive people, IHud).Some of them They have delay o 0.00x running and their scripts are heavy and still people have no trouble playing with them. If you stick with 0.1 or more, I'm sure your mod won't be the reason game slows down. If less, nothing bad will happen too, just don't forget about optimizing.
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