Quick Questions -- Quick Answers, The 22nd

Post » Thu Jul 22, 2010 6:02 am

Any reason why this:

if player.getav marksman < ( GetGameSetting iSkillJourneymanMin )

Should be causing console spam with the iSkillJourneymanMin value being printed over and over and over and over and over and over.

A way to fix it?

Have you tried separating the two parts by setting a local variable to the game setting and then doing the comparison on that? It may tell you which part causes the problem, or it might stop the spam!
User avatar
Steph
 
Posts: 3469
Joined: Sun Nov 19, 2006 7:44 am

Post » Thu Jul 22, 2010 10:59 am

It's not my mod, so I don't want to alter anything. I just wanted to narrow it down before I reported it.
User avatar
Cayal
 
Posts: 3398
Joined: Tue Jan 30, 2007 6:24 pm

Post » Thu Jul 22, 2010 1:12 am

i duplicated a cell and renamed it then went about deleting the enemy spawns out of it so that i might be able to replace them with something else. in doing so i came across an apparent npc. i tried to delete her but the system had a window pop up saying something about this form is already in use in the following areas (there was a list below which seemed to name either npc's or the places the npc was used in, not sure as it was in bethesda language lol). unsure if i should do it i clicked back out. then i tried to rename the npc and delete again but i got the exact same message. so again i backed out. can anyone tell me what this is about? is it ok to delete the npc/actor from the cell im using in this mod (remember its a duplicated cell) or will that delete her from everwhere in the game? does this mean i have to throw out that cell and find one with no npc at all in it so they arent appearing out of place? thanks =D
User avatar
Abel Vazquez
 
Posts: 3334
Joined: Tue Aug 14, 2007 12:25 am

Post » Thu Jul 22, 2010 1:20 am

Was it indicating that the NPC was used elsewhere, or was it a case that the NPC reference was persistent and the list was of scripts that refer to that reference?

If it was just the script thing, then you can delete it because the other one will still exist.

Odd though that it had duplicate references like that. Are you sure you didn't accidentally rename the original cell?
User avatar
Mistress trades Melissa
 
Posts: 3464
Joined: Mon Jun 19, 2006 9:28 pm

Post » Thu Jul 22, 2010 10:46 am

Was it indicating that the NPC was used elsewhere, or was it a case that the NPC reference was persistent and the list was of scripts that refer to that reference?

If it was just the script thing, then you can delete it because the other one will still exist.

Odd though that it had duplicate references like that. Are you sure you didn't accidentally rename the original cell?



i wasnt sure so i went back to thaT cell to click the same npc and try to delete her again so i would get the same message so i could copy paste it here. but that time the delete worked without any messages so i guess the world will never know...>.>

and im certain i did duplicate the cell first and rename the duplicate not the original i was very carefyul about that....unless i somehow wasnt careful enough...<.<

thanks XD
User avatar
Baylea Isaacs
 
Posts: 3436
Joined: Mon Dec 25, 2006 11:58 am

Post » Thu Jul 22, 2010 4:05 am

Question, which is the best way to force an npc to reevaluate its equipment??

Im asking this because after creating an actor via script with the placeatme function and giving him items in the same script, he doesn't equip any. I know this can be done if i add an AI package, but i have to check the armor unequipped tag for the NPC to put on equipment, and he only equips clothing this way, no armor. The only workaround i found was setting the npc aggression to 100 after the package was added and then i do an isincombat check and set its aggression at 0 and remove the package. This would force the npc in question to equip its armor and weapon but the problem with this approach its that its not very clean and can cause nearby npcs to attack it.

Sorry that i didn't post the code, im not at my pc right now but i will be in a few minutes. So if my post was not very clear i could post the code later if anyone is interested in my question. Thanks!
User avatar
Donatus Uwasomba
 
Posts: 3361
Joined: Sun May 27, 2007 7:22 pm

Post » Thu Jul 22, 2010 1:59 pm

I think the trick is to remove any existing armor and clothing before giving him the new stuff, then maybe do an EVP on him and he should equip it.

The EVP may not be necessary.
User avatar
Meghan Terry
 
Posts: 3414
Joined: Sun Aug 12, 2007 11:53 am

Post » Wed Jul 21, 2010 10:19 pm

I use the add-remove method, personally:

Target.AddItem [UniqueModItem] 1
Target.EquipItem [UniqueModItem]
Target.RemoveItem [UniquteModItem] 1

In my Vampirism Mod, this definitely forced the equipment update, making them pick the best equipment they had (for when the Player checks their Inventory)-- it should work the same.
User avatar
Ria dell
 
Posts: 3430
Joined: Sun Jun 25, 2006 4:03 pm

Post » Thu Jul 22, 2010 6:34 am

Is there a way to get script to run once a containers menu is closed?

I wrote a script that works perfectly fine except you need to open the container twice to update it since I activate it at the end of the script instead of the beginning. I tried to activate it at the beginning and wait for it to exit the menumode, but that caused the menu to never open and an infinite loop.

Basically how I have it now:

Begin OnActivate     Script     MyChest.activateEnd


What I tried:

Begin OnActivate     MyChest.activate     While (Menumode 1008 == 1)      ; do nothing...     Loop     ScriptEnd


Also I read that using activate can cause CTD's, do I need to change the script?
User avatar
Lisha Boo
 
Posts: 3378
Joined: Fri Aug 18, 2006 2:56 pm

Post » Thu Jul 22, 2010 1:12 pm

Can Somebody write a script for me?

I want to make a Portcullis ( a iron gate wich can be lowered or raised by a switch) go up when the player or a factionmember is nearby and of course, go down when the player or factionmember leaves the position of the gate.
In short A automatic Portcullis (of course for AI reasons)
User avatar
Jessie Butterfield
 
Posts: 3453
Joined: Wed Jun 21, 2006 5:59 pm

Post » Thu Jul 22, 2010 1:05 am

That doesn't need a script. Just ue a TriggerZone (or two) as the switch instead.
User avatar
brian adkins
 
Posts: 3452
Joined: Mon Oct 01, 2007 8:51 am

Post » Thu Jul 22, 2010 11:19 am

I think the trick is to remove any existing armor and clothing before giving him the new stuff, then maybe do an EVP on him and he should equip it.

The EVP may not be necessary.



I use the add-remove method, personally:

Target.AddItem [UniqueModItem] 1
Target.EquipItem [UniqueModItem]
Target.RemoveItem [UniquteModItem] 1

In my Vampirism Mod, this definitely forced the equipment update, making them pick the best equipment they had (for when the Player checks their Inventory)-- it should work the same.


Thanks for the reply, but i cant get it to work with any of these approaches... im gonna post my script, maybe i am doing something wrong. I replaced my package evaluation approach with yours, changing packages and forcing the NPC to attack and then stopping works, but its just to much hassle for something as simple as equipping armor and sometimes causes other npcs to attack.

scn AAHoNecroTokenScr;This script runs on a token that is delivered to a dead actor via a spell. Basically it revives the dead actor and replaces him with another one as soon as he is up.ref target ;the dead actor who has the tokenref necro ;the actor that replaces the dead oneref source ;an activator that casts a spell on "Target", for visualeffects onlyshort ScriptDoOnceBegin gamemodeif (ScriptDoOnce == 0)Set target to getcontainer	if (target.GetIsCreature == 0 && target.GetDead == 1)        target.playmagicshadervisuals effectfiredamage        target.resurrect 1	endif			if (target.isanimgroupplaying idle || target.isanimgroupplaying Forward || target.isanimgroupplaying FastForward || target.isanimgroupplaying equip)			set necro to Target.placeatme HoTestSkeleton 1, 0 , 0			necro.disable			target.stopmagicshadervisuals effectfiredamage			set source to HoCaster			source.moveto target 0, 0, 0			Source.cast AAHoReanimate Target			target.disable			necro.moveto target 0, 0, 0			                       necro.removeallitems        		       target.removeallitems necro  ;For some reason ActorRef.RemoveAllItems is giving me crashes when called on some specific npcs, for most it works as intended.                        necro.enable	               necro.additem AAHoUpdater 1	               necro.equipitem AAHoUpdater                       necro.removeitem AAHoUpdater 1				Set ScriptDoOnce to 1			removeme		endif	EndifEnd


Thanks
User avatar
Rowena
 
Posts: 3471
Joined: Sun Nov 05, 2006 11:40 am

Post » Thu Jul 22, 2010 10:03 am

Silly question, but is AAHoUpdated a Clothing/Armour piece, with slots set? If not, try it like that-- otherwise, the best I can suggest is maybe try moving them to a remote chest, and back again (I do it from Chests, but I can't see why it shouldn't work for an actor).
User avatar
Connor Wing
 
Posts: 3465
Joined: Wed Jun 20, 2007 1:22 am

Post » Thu Jul 22, 2010 5:07 am

That doesn't need a script. Just ue a TriggerZone (or two) as the switch instead.


thank you, I had the same idea when I was waiting.
Funny that there is a simpel solution for anything.
User avatar
Greg Swan
 
Posts: 3413
Joined: Tue Jun 05, 2007 12:49 am

Post » Thu Jul 22, 2010 12:38 pm

I still cant get my npc to reevaluate its equipment in the same script that i used placeatme (for Placing the NPC that i want to reevaluate its equipment). Forcing the NPC to reevaluate its equipment in other script works fine, something like on the onactivate block of a script attached to this actor, so it will reevaluate its equipment when i click on it. My idea is to force the npc to reevaluate its equipment each time it has nothing equipped (im using a costume so this npc should always have something equipped, but it should equip the costume only if it doesn't have anything else in his inventory, clothing or armor). However i cant find a function that tells me if the actor has something equipped (anything not a particular item). Basically i am looking a way to determine if an actor has armor or clothing equipped, any equipment slot will do. Thanks

i know the function ActorRef.Getequipped ObjectId, but this only works for a particular object. maybe there is an obse function that can do this?
User avatar
maria Dwyer
 
Posts: 3422
Joined: Sat Jan 27, 2007 11:24 am

Post » Thu Jul 22, 2010 7:07 am

An update to my question:
Say, I have two items: an armor TestArmor and sword TestSword
And I want to make a custom bound spell that behaves like a stock bound spell would (reverts back to original clothing once the spell has ended). I'm thinking of using OBSE here (I have v0017b)

Will this script work like I think it will be?
scn CustomBoundScriptref ArmorSlotref SwordSlotbegin ScriptEffectStartset ArmorSlot to player.GetEquippedObject 2set SwordSlot to player.GetEquippedObject 16player.EquipItemNS TestArmor 1player.EquipItemNS TestSword 1endbegin ScriptEffectFinishplayer.UnequipItemNS TestArmorplayer.UnequipItemNS TestSwordplayer.EquipItem ArmorSlotplayer.EquipItem SwordSlotend



Still wondering about this one :whistling:
User avatar
A Lo RIkIton'ton
 
Posts: 3404
Joined: Tue Aug 21, 2007 7:22 pm

Post » Thu Jul 22, 2010 4:42 am

Still wondering about this one :whistling:


I've not tested it, but I believe it will work-- but don't forget that you will need to add/remove the bound items when you cast the spell.

Also, you MAY need to add a check for "ArmorSlot/SwordSlot == 0"-- I don't know for certain, but it might cause a CTD if it tries to equip nothing.
User avatar
Ruben Bernal
 
Posts: 3364
Joined: Sun Nov 18, 2007 5:58 pm

Post » Thu Jul 22, 2010 1:10 pm

Has anyone worked a nice reliable way to detect who is hitting a creature in an "onhit" block?

Warcry has this script:

scn 01rakanischuBlitz
begin onhit
blitzmarker1.moveto player
blitzmarker1.cast bossBlitz player
end

And the dang thing can kill the player if this goblin is being attacked by a guard in the vicinity of the player.
User avatar
Alex Blacke
 
Posts: 3460
Joined: Sun Feb 18, 2007 10:46 pm

Post » Wed Jul 21, 2010 10:41 pm

I've not tested it, but I believe it will work-- but don't forget that you will need to add/remove the bound items when you cast the spell.

Also, you MAY need to add a check for "ArmorSlot/SwordSlot == 0"-- I don't know for certain, but it might cause a CTD if it tries to equip nothing.

If I remove the items (armorslot and weaponslot) at scripteffectstart and add them again at scripteffectfinish, will it solve the check problem? :read:
I'm thinking of adding them before the unequipns command so there's a bit of delay between adding and equipping. I read in tescswiki immediately equipping an added item might cause problems?
User avatar
Victor Oropeza
 
Posts: 3362
Joined: Sun Aug 12, 2007 4:23 pm

Post » Thu Jul 22, 2010 2:26 am

Has anyone worked a nice reliable way to detect who is hitting a creature in an "onhit" block?

Warcry has this script:

scn 01rakanischuBlitz
begin onhit
blitzmarker1.moveto player
blitzmarker1.cast bossBlitz player
end

And the dang thing can kill the player if this goblin is being attacked by a guard in the vicinity of the player.

If it was
begin OnHit Player

then it would only run when the player does the hitting, which takes away the injustice, but I suppose you're wanting the target to be variable. There's no GetHitRef equivalent of GetActionRef, and you're not activating, so the latter doesn't apply, but I wonder if the hitting could not be turned into an Activate by just putting an Activate in the OnHit block and then use GetActionRef in the resulting OnActivate block? There will probably be side-effects that make it unworkable, but it could be worth trying.
User avatar
Alex Blacke
 
Posts: 3460
Joined: Sun Feb 18, 2007 10:46 pm

Post » Thu Jul 22, 2010 7:10 am

Quick question. I heard (somewhere) that the PushActorAway function was part of Shivering Isles and required SI to work. Is this correct?
User avatar
Lawrence Armijo
 
Posts: 3446
Joined: Thu Sep 27, 2007 7:12 pm

Post » Thu Jul 22, 2010 4:02 am

Don't see how a script function could be part of SI itself, but it wouldn't surprise me if the patch that came out at the same time is what adds it to the base. I.e Oblivion was patched to add a function that SI needed, but you don't need SI to use it.
User avatar
ruCkii
 
Posts: 3360
Joined: Mon Mar 26, 2007 9:08 pm

Post » Thu Jul 22, 2010 9:14 am

According to the Wiki:

Note that these functions are not "Shivering Isles" functions. While Shivering Isles will update Oblivion to v1.2, and make these functions available, and despite the fact that most of these functions were added to the game to make the expansion possible, any Oblivion v1.2 or higher can use these functions, even without Shivering Isles.
User avatar
brenden casey
 
Posts: 3400
Joined: Mon Sep 17, 2007 9:58 pm

Post » Thu Jul 22, 2010 1:52 pm

Don't see how a script function could be part of SI itself, but it wouldn't surprise me if the patch that came out at the same time is what adds it to the base. I.e Oblivion was patched to add a function that SI needed, but you don't need SI to use it.



According to the Wiki:

Note that these functions are not "Shivering Isles" functions. While Shivering Isles will update Oblivion to v1.2, and make these functions available, and despite the fact that most of these functions were added to the game to make the expansion possible, any Oblivion v1.2 or higher can use these functions, even without Shivering Isles.

Good to know. Thanks guys. :foodndrink:
User avatar
tiffany Royal
 
Posts: 3340
Joined: Mon Dec 25, 2006 1:48 pm

Post » Thu Jul 22, 2010 12:45 am

hi!

i'd like to make a plugin deleting spells in CS. maybe sounds dumb but will these spells actually disappear from the game? i mean if i load this created esp after the oblivion.esm (which still contains these spells) will these spells "overwrited" and be gone?

thx in advance
User avatar
gandalf
 
Posts: 3400
Joined: Wed Feb 21, 2007 6:57 pm

PreviousNext

Return to IV - Oblivion