Quick Questions -- Quick Answers, The 25th

Post » Tue May 17, 2011 5:09 am

My answers:

@ Amaranthine: http://cs.elderscrolls.com/constwiki/index.php/FQuestDelayTime

@ Arkingt:

Try opening existing companion mods and perusing the scripts attached to their NPCs. Most notably CM Partners and Companion Vilja, they both include commented explanations in their code. I am also very new at this, I only started learning CS scripting last week. But you can adapt existing mod's scripts rather easily if you know where to look. I mean, why reinvent the wheel right? Here's an example for invisibility.

if invisible == 0 && Player.HasMagicEffect INVI == 1		AddSpell "AAS14SpellInvisibility"		set invisible to 1	elseif invisible == 1 && Player.HasMagicEffect INVI == 0		RemoveSpell "AAS14SpellInvisibility" 		set invisible to 0	endif


I created an ability that casts invisibility on self named "AAS14SpellInvisibility" beforehand, and 'invisible' is a variable short.

My questions:

1) Very simple: How do I maintain the order of the topics in my CS with how it appears ingame? For example, when I talk to my companion, he should display TopicA, TopicB, TopicC, and TopicD, in that order. Yet when I test it ingame, the whole order becomes jumbled. It becomes TopicD, TopicA, TopicC, TopicB, etc. (I'm talking about Topics btw, not the infos)

I have tried using Addtopic to load them in the correct order through quest stages scripts, and even scripts on activators, to no avail. Also tried renaming their Editor ID's alphabetically, again no change. The only way they seem to maintain order is if I add them to the Choices menu. And that obviously won't work when dealing with the main dialogue topics. Reluctant to use the AddTopic box because of the AddTopic bug discussed in the wiki.

Also note that the dialogues by themselves, work fine. Their conditions are perfect, they show up at the correct stages, the correct branching order, do the correct result scripts, etc. My only real problem is the arrangement which affects how quickly a player can access commonly used dialogue topics in NPC's (like 'Follow Me').

2) My Companion seems to... die. I have set him as Essential in his Base object, even set his ref as essential using scripting, but he still dies instead of just getting knocked out. Has anyone encountered a similar problem? Very weird.

There's more, but I guess I'll settle for those two for now. I can probably solve the rest on my own. However, those two are my most puzzling problems. And yes, I have searched for answers elsewhere before asking this, with no luck.
User avatar
Carlos Rojas
 
Posts: 3391
Joined: Thu Aug 16, 2007 11:19 am

Post » Tue May 17, 2011 3:35 pm

My questions:

1) Very simple: How do I maintain the order of the topics in my CS with how it appears ingame?

As far as I can tell, topics are always ordered alphabetically by (the displayed) name. You can't change the order of topics without changing the name of the topic. If you want your topic to occur at or near the top consistently, you'll have to rename it to "Aardvark".

2) My Companion seems to... die. I have set him as Essential in his Base object, even set his ref as essential using scripting, but he still dies instead of just getting knocked out. Has anyone encountered a similar problem? Very weird.

There's more, but I guess I'll settle for those two for now. I can probably solve the rest on my own. However, those two are my most puzzling problems. And yes, I have searched for answers elsewhere before asking this, with no luck.

I assume you aren't using any of the "make essentials killable" mods? Otherwise, does the crown label show up when you point the crosshair at him? If you get the normal interaction icon, he isn't essential for some reason. If you're getting the normal icon, make your script print out his essential status to the console (or, if you're not using OBSE, a messagebox) when you talk to him (or any other time that won't result in spam).
User avatar
Markie Mark
 
Posts: 3420
Joined: Tue Dec 04, 2007 7:24 am

Post » Tue May 17, 2011 3:59 am

Need some help with 'addtoleveledlist'. It doesn't work. At least not for some lists, no idea why. I try to add something to a vanilla leveled creature list, but when I try to save the script I get

Invalid inventory object 'ID of leveled list' for parameter leveled list.

Does that mean it doesn't work for leveled creatures (even though the description on the OBSE site says I can add stuff to creature lists)? The script compiles if I add something to a leveled item list.
User avatar
David Chambers
 
Posts: 3333
Joined: Fri May 18, 2007 4:30 am

Post » Tue May 17, 2011 9:25 am

Can you use negative numbers for the quantity when using AddItem in a script? Suspect I know the answer, but thought I'd ask :)

Ex. ActorRef.AddItem PotionRestoreHealthS -3
User avatar
Zoe Ratcliffe
 
Posts: 3370
Joined: Mon Feb 19, 2007 12:45 am

Post » Tue May 17, 2011 12:35 pm

Can you use negative numbers for the quantity when using AddItem in a script? Suspect I know the answer, but thought I'd ask :)

Ex. ActorRef.AddItem PotionRestoreHealthS -3

I don't think so.

ActorRef.RemoveItem PotionRestoreHealthS 3

But, IIRC, there is / was something screwy about RemoveItem. You'll need to check up on it.
User avatar
City Swagga
 
Posts: 3498
Joined: Sat May 12, 2007 1:04 am

Post » Tue May 17, 2011 2:35 am

I don't think so.

ActorRef.RemoveItem PotionRestoreHealthS 3

But, IIRC, there is / was something screwy about RemoveItem. You'll need to check up on it.


Thanks. I wasn't looking to remove anything. I wanted to add an infinite number, in batches of 3 :) I believe the negative quantity in a container like a vendor's inventory means infinite number, with the specified quantity being available until the next cell reset. So, if you visit a vendor who has -3 as the quantity, he'll have 3 of that item for you to buy at a time.

I suspect you are correct though. You can only use the negative numbers on containers in the CS. I just wanted to confirm...
User avatar
Isabell Hoffmann
 
Posts: 3463
Joined: Wed Apr 18, 2007 11:34 pm

Post » Tue May 17, 2011 10:08 am

Is there a (easy) way to keep track of potions drunk by the player? I'm really only interested in counting the number of potions drunk, i.e. discovering each time the player drinks a potion.

I can keep track of the number of potions in the player's inventory and detect whenever the number decreases, but it can be hard to distinguish between the player drinking and dropping a potion - so is there anything that let me count the number of potions that are drunk?
User avatar
Miranda Taylor
 
Posts: 3406
Joined: Sat Feb 24, 2007 3:39 pm

Post » Tue May 17, 2011 7:37 am

Is there a (easy) way to keep track of potions drunk by the player? I'm really only interested in counting the number of potions drunk, i.e. discovering each time the player drinks a potion.

I can keep track of the number of potions in the player's inventory and detect whenever the number decreases, but it can be hard to distinguish between the player drinking and dropping a potion - so is there anything that let me count the number of potions that are drunk?

The dropping problem http://cs.elderscrolls.com/constwiki/index.php/GetPCLastDroppedItemRef. It doesn't appear to be possible to directly listen for potion use, nor is there a function that could be called to find the last used potion. Even simply counting how many have been used doesn't appear possible (you can find potions made or ingredients eaten, but not potions used).
User avatar
Marnesia Steele
 
Posts: 3398
Joined: Thu Aug 09, 2007 10:11 pm

Post » Tue May 17, 2011 9:06 am

Is there a (easy) way to keep track of potions drunk by the player? I'm really only interested in counting the number of potions drunk, i.e. discovering each time the player drinks a potion.

I can keep track of the number of potions in the player's inventory and detect whenever the number decreases, but it can be hard to distinguish between the player drinking and dropping a potion - so is there anything that let me count the number of potions that are drunk?


How about GetActiveMenuSelection and IsAlchemyItem/IsPotion? Just check what the item is, then check for a Click of the Mouse Button under the right conditions (i.e., Left-shift not pressed, so not dropping)

http://cs.elderscrolls.com/constwiki/index.php/GetActiveMenuSelection
http://cs.elderscrolls.com/constwiki/index.php/IsAlchemyItem
User avatar
Rozlyn Robinson
 
Posts: 3528
Joined: Wed Jun 21, 2006 1:25 am

Post » Tue May 17, 2011 3:39 am

Hip, I'm trying to put some Havok-proof furniture in my house mod, and I wonder how should I manage Havok-ed objects. For example, I'm trying to hang a shield (from a new mesh of a resource mod) onto a wall, but my first try (I created a new Static and placed it) results in the shield falling off as soon as I enter the cell (and, as it's an static, I can't pick it up). What would be the best way to remove physics from this object? Editing the .nif file and removing the physics? (with NifSkope? And how should I do it..?), or creating an Activator instead? (I think that I used Activators to make static objects back in Morrowind...I don't know if it'd be the same in Oblivion...).

Thx for the quick answer!
User avatar
Taylrea Teodor
 
Posts: 3378
Joined: Sat Nov 18, 2006 12:20 am

Post » Tue May 17, 2011 5:20 am

Is there a (easy) way to keep track of potions drunk by the player? I'm really only interested in counting the number of potions drunk, i.e. discovering each time the player drinks a potion.

I can keep track of the number of potions in the player's inventory and detect whenever the number decreases, but it can be hard to distinguish between the player drinking and dropping a potion - so is there anything that let me count the number of potions that are drunk?


NiceOne, have you looked at the quest script for The Hist (FG09, I believe). That quest has the player consume a potion and the game knows when he has so the quest continues. I haven't looked at it myself, but there might be something in there...
User avatar
Mario Alcantar
 
Posts: 3416
Joined: Sat Aug 18, 2007 8:26 am

Post » Tue May 17, 2011 3:13 am

Hip, I'm trying to put some Havok-proof furniture in my house mod, and I wonder how should I manage Havok-ed objects. For example, I'm trying to hang a shield (from a new mesh of a resource mod) onto a wall, but my first try (I created a new Static and placed it) results in the shield falling off as soon as I enter the cell (and, as it's an static, I can't pick it up). What would be the best way to remove physics from this object? Editing the .nif file and removing the physics? (with NifSkope? And how should I do it..?), or creating an Activator instead? (I think that I used Activators to make static objects back in Morrowind...I don't know if it'd be the same in Oblivion...).

Thx for the quick answer!


Check http://www.gamesas.com/index.php?/topic/927663-need-help-converting-clutter-to-static/page__view__findpost__p__13445647
User avatar
Danel
 
Posts: 3417
Joined: Tue Feb 27, 2007 8:35 pm

Post » Tue May 17, 2011 11:20 am

Thanks for the potion help all:

The dropping problem http://cs.elderscrolls.com/constwiki/index.php/GetPCLastDroppedItemRef. It doesn't appear to be possible to directly listen for potion use, nor is there a function that could be called to find the last used potion. Even simply counting how many have been used doesn't appear possible (you can find potions made or ingredients eaten, but not potions used).
I will be able to use that function to help checking if a potion has been dropped or been drinked from the inventory menu, so thanks :)


How about GetActiveMenuSelection and IsAlchemyItem/IsPotion? Just check what the item is, then check for a Click of the Mouse Button under the right conditions (i.e., Left-shift not pressed, so not dropping)

http://cs.elderscrolls.com/constwiki/index.php/GetActiveMenuSelection
http://cs.elderscrolls.com/constwiki/index.php/IsAlchemyItem
That may help. I guess it is impossible to drop it without activating it from the inventory menu. It is possible to drink it without doing so though (through hotkeys), so it will not be very simple.


NiceOne, have you looked at the quest script for The Hist (FG09, I believe). That quest has the player consume a potion and the game knows when he has so the quest continues. I haven't looked at it myself, but there might be something in there...
No help there. That quest is handled by having a special effect script from drinking the hist potion, and the effect script sets a specific tookpotion variable.
User avatar
Rachel Hall
 
Posts: 3396
Joined: Thu Jun 22, 2006 3:41 pm

Post » Tue May 17, 2011 2:07 am

It worked, thx! Long live Havok-proof stuff! :D
User avatar
Krista Belle Davis
 
Posts: 3405
Joined: Tue Aug 22, 2006 3:00 am

Post » Tue May 17, 2011 6:16 am

I attached this script to an NPC

scn 00tutpalscriptbegin gamemode		PlaySound 00TestSound01		end


It works fine but the sound keeps looping. How do I stop this?
User avatar
April
 
Posts: 3479
Joined: Tue Jun 20, 2006 1:33 am

Post » Tue May 17, 2011 12:52 pm

I attached this script to an NPC

scn 00tutpalscriptbegin gamemode		PlaySound 00TestSound01		end


It works fine but the sound keeps looping. How do I stop this?


You need some sort of start and stop,

begin gamemode
if xxx == 0
playsound
set xxx to 1
endif
end

pardon the no code box...
User avatar
Sarah Unwin
 
Posts: 3413
Joined: Tue Aug 01, 2006 10:31 pm

Post » Tue May 17, 2011 2:38 am

Quick question:

"Bergen Hus" is Scandinavian for "Mountain Dweller' House"? :)
User avatar
Felix Walde
 
Posts: 3333
Joined: Sat Jun 02, 2007 4:50 pm

Post » Tue May 17, 2011 2:38 pm

Will placing an amount of NPC in a (restricted)cell cause the same strain on the game as placing them in the game world?
I need to refer to them as quest targets and in the conditionals thereof, so I am assuming that placing them in a percipient cell will enable me to.
My worry is that it will cause more strain on the game(which I have been trying to eliminate).
User avatar
lolly13
 
Posts: 3349
Joined: Tue Jul 25, 2006 11:36 am

Post » Tue May 17, 2011 12:56 pm

NPCs in an unloaded cell (interior or exterior) should not be a problem.

The problem is too many NPCs in the loaded cells around the player, as the game engine has to check, each frame, where to move each one, where are the path nodes, whether they are going up/down a slope, whether they are bumping into something, whether they are in combat, etc.
User avatar
Jason Wolf
 
Posts: 3390
Joined: Sun Jun 17, 2007 7:30 am

Post » Tue May 17, 2011 3:16 am

NPCs in an unloaded cell (interior or exterior) should not be a problem.

The problem is too many NPCs in the loaded cells around the player, as the game engine has to check, each frame, where to move each one, where are the path nodes, whether they are going up/down a slope, whether they are bumping into something, whether they are in combat, etc.

Awesome, thanks than all is well!:)
User avatar
Russell Davies
 
Posts: 3429
Joined: Wed Nov 07, 2007 5:01 am

Post » Mon May 16, 2011 11:40 pm

Is there any way (in the CS or using some other tool) of locating all uses of a specific scripting function - not necessarily in scripts, but in conditions on topics, etc?

Context: I've noticed that the BribeGuard topic is conditional on both IsGuard being true and GetIsRace returning Imperial. This slightly breaks my http://www.tesnexus.com/downloads/file.php?id=24614 mod, since it prevents that topic from showing up in non-Imperial guards. I believe that the GetIsRace check is redundant here (I could be wrong, and if so I'd like to know why), and I'd like to locate other such redundant checks without having to manually trawl through everything that might contain a condition.

Thanks
User avatar
Beast Attire
 
Posts: 3456
Joined: Tue Oct 09, 2007 5:33 am

Post » Tue May 17, 2011 7:54 am

Is there any way (in the CS or using some other tool) of locating all uses of a specific scripting function - not necessarily in scripts, but in conditions on topics, etc?

Context: I've noticed that the BribeGuard topic is conditional on both IsGuard being true and GetIsRace returning Imperial. This slightly breaks my http://www.tesnexus.com/downloads/file.php?id=24614 mod, since it prevents that topic from showing up in non-Imperial guards. I believe that the GetIsRace check is redundant here (I could be wrong, and if so I'd like to know why), and I'd like to locate other such redundant checks without having to manually trawl through everything that might contain a condition.

Thanks
Find text in the cs should search in dialogue conditions IIRC
User avatar
Heather Stewart
 
Posts: 3525
Joined: Thu Aug 10, 2006 11:04 pm

Post » Tue May 17, 2011 8:40 am

I attached this script to an NPC

scn 00tutpalscriptbegin gamemode		PlaySound 00TestSound01		end


It works fine but the sound keeps looping. How do I stop this?

DO NOT START EDITORIDs with NUMBERS - you will sooner than later hit a mysterious bug
User avatar
Andrew Lang
 
Posts: 3489
Joined: Thu Oct 11, 2007 8:50 pm

Post » Tue May 17, 2011 7:43 am

Hopefully a quick and easy question, or two of them actually-- For those who mod much and often and who play the game with SI installed (and thus with the SI-modified Oblivion.esm)--

Do you prefer to mod off of that esm, and thus end up with a mod that requires SI in order to work, or do you work off of the original, non-SI esm? If the latter, how? With a separate install or simply with a copy of the original esm that you can swap with your gaming esm just for the purpose of modding?

TIA
User avatar
Mark Hepworth
 
Posts: 3490
Joined: Wed Jul 11, 2007 1:51 pm

Post » Tue May 17, 2011 2:26 am

Hopefully a quick and easy question, or two of them actually-- For those who mod much and often and who play the game with SI installed (and thus with the SI-modified Oblivion.esm)--

Do you prefer to mod off of that esm, and thus end up with a mod that requires SI in order to work, or do you work off of the original, non-SI esm? If the latter, how? With a separate install or simply with a copy of the original esm that you can swap with your gaming esm just for the purpose of modding?

TIA


If you mod with the SI injected Oblivion.esm the mod won't require SI unless you use resources from SI.
User avatar
^_^
 
Posts: 3394
Joined: Thu May 31, 2007 12:01 am

PreviousNext

Return to IV - Oblivion