Quick Questions -- Quick Answers, The 27th

Post » Sat Feb 19, 2011 9:08 am

How can I use an NPC's reference to modify the base value of their health? For example, the player goes into a cell, in it is an unknown NPC. A ref walk returns that NPC's ref as a reference variable. Using that ref variable, what function can I use to change the base value of the NPC's health. I do not want to heal or kill them, but rather for their "health" stat that you'd set in the CS. I hope that's clear. :/
User avatar
Julia Schwalbe
 
Posts: 3557
Joined: Wed Apr 11, 2007 3:02 pm

Post » Sat Feb 19, 2011 3:28 am

I cannot figure out what is wrong with these scripts. The purpose id to teleport the player to another place, recording where they came from. Then they could send themselves back to that specific teleporter. I used the first script to set up a reference variable. It is attached to a quest.
scn DrTrScriptHoldershort originbegin GameModeend

This one is one of the object scripts attached to one specific teleporter, all of which are separate objects with similar scripts.
scn DrTrPortalAnvilbegin OnActivate     set DrTrPortalQuestHolder.origin to 1     player.moveto DrTrRealmTargetend

Now for the return I used this one.
scn DrTrPortalRealmReturnbegin OnActivate     if (DrTrPortalQuestHolder.origin == 1)          player.moveto DrTrAnvilTarget     elseif (DrTrPortalQuestHolder.origin == 2)          player.moveto DrTrSkingradTarget     elseif (DrTrPortalQuestHolder.origin == 3)          player.moveto DrTrChorrolTarget     elseif (DrTrPortalQuestHolder.origin == 4)          player.moveto DrTrBrumaTarget     elseif (DrTrPortalQuestHolder.origin == 5)          player.moveto DrTrBravilTarget     elseif (DrTrPortalQuestHolder.origin == 6)          player.moveto DrTrLeyawiinTarget     elseif (DrTrPortalQuestHolder.origin == 7)          player.moveto DrTrCheydinhalTarget     elseif (DrTrPortalQuestHolder.origin == 8)          player.moveto DrTrICTarget     elseif (DrTrPortalQuestHolder.origin == 9)          player.moveto DrTrFallback1Target     elseif (DrTrPortalQuestHolder.origin == 0)          player.moveto DrTrFallback2Target	else		MessageBox "You got pwned :("     endifend

Sorry for huge post. Thanks in advance.
User avatar
Alexis Acevedo
 
Posts: 3330
Joined: Sat Oct 27, 2007 8:58 pm

Post » Sat Feb 19, 2011 5:43 am

Seems to be working but when I set them all to zero, there is a small flash at what I think is midnight.


Try setting the sun texture and sunglare texture to empty textures, switching the day sky texture out for a darker one, and/or setting all the weather types to not at all bright and sunny. That should at least reduce how noticeable that split second is.

How can I use an NPC's reference to modify the base value of their health? For example, the player goes into a cell, in it is an unknown NPC. A ref walk returns that NPC's ref as a reference variable. Using that ref variable, what function can I use to change the base value of the NPC's health. I do not want to heal or kill them, but rather for their "health" stat that you'd set in the CS. I hope that's clear. :/


http://cs.elderscrolls.com/constwiki/index.php/SetActorValue

Sorry for huge post. Thanks in advance.


It would be nice if you would keep the title of the thread in mind when posting.

There is no need to have an empty GameMode block; it is superfluous. The script will compile with only variables.

All variables start at 0, so it could be a bad idea to have "elseif (DrTrPortalQuestHolder.origin == 0)" for any reason. According to your scripts, the only time it will ever be 0 is if the player has never activated one of your teleporters.

Because your activator scripts have onActivate blocks without specifying "begin onActivate player", it is possible that NPCs are activating the objects, which would set the variables in conditions you do not intend. That seems unlikely, but it is possible.

Otherwise, I have no idea what is wrong with your scripts, because you didn't say what they are doing instead of what they are meant to do. I don't see any other glaring errors, and the ones I pointed out are of little consequence or probability as your culprit.
User avatar
Bedford White
 
Posts: 3307
Joined: Tue Jun 12, 2007 2:09 am

Post » Sat Feb 19, 2011 12:47 am

What is wrong with my starconversation script?

elseif getstage AwsAwiaMainQuest3 == 109	if Player.getdistance AwsAwiaMQ3BattlePrisonerActivate1Ref < 350		AwsAwiaMQ3MurberTiragius1Ref.moveto AwsAwiaMQ3BattlePrisonerActivate1Ref		set battlestage to 1		AwsAwiaMQ3MurberTiragius1Ref.SetActorValue Aggression 0		AwsAwiaMQ3MurberTiragius1Ref.SetActorValue confidence 0	endif	if battlestage == 1		AwsAwiaMQ3MurberTiragius1Ref.startconversation Player	endifendif 


My character just stands on the spot and his legs do a strange animation, but if I move close enough to him he starts the conversation

Things worth mentioning

Its during combat
its a quest script
The actor is currently on a wander package in the area they are supposed to talk. I tried using a find package but it didn't work out

please help :)
User avatar
Susan Elizabeth
 
Posts: 3420
Joined: Sat Oct 21, 2006 4:35 pm

Post » Fri Feb 18, 2011 10:32 pm

Quick question about the best way to do something:

Arkgnt and I are in the process of upgrading and expanding our "ShiningCreatures" mod so that it doesn't require multiple patches for the different mods I want the creatures from to glow. This would involve adding a spell to the base forms of these actors (less irritating than looping through all the actors in a cell and adding tokens if they match the creatures I want to edit). I was thinking, using "IsModLoaded" followed by "RunScripLine "FormOfOtherMod.AddSpell RPSSCGlowingSpell"". Would this work with just the EditorID, or would I have to get the base actor's formID using "GetFormFromMod" first? Also, how persistent would these changes be? Would they stay in a save game? (Uninstalling shouldn't be a problem if the spell is unique to my mod, it should just "vanish") Would I have to initialize my mod on every game load?

Thanks :)
User avatar
Ebou Suso
 
Posts: 3604
Joined: Thu May 03, 2007 5:28 am

Post » Sat Feb 19, 2011 12:34 am

Quick question about the best way to do something:

Arkgnt and I are in the process of upgrading and expanding our "ShiningCreatures" mod so that it doesn't require multiple patches for the different mods I want the creatures from to glow. This would involve adding a spell to the base forms of these actors (less irritating than looping through all the actors in a cell and adding tokens if they match the creatures I want to edit). I was thinking, using "IsModLoaded" followed by "RunScripLine "FormOfOtherMod.AddSpell RPSSCGlowingSpell"". Would this work with just the EditorID, or would I have to get the base actor's formID using "GetFormFromMod" first? Also, how persistent would these changes be? Would they stay in a save game? (Uninstalling shouldn't be a problem if the spell is unique to my mod, it should just "vanish") Would I have to initialize my mod on every game load?

Thanks :)


Since RunScriptLine is just mimicking what you would type into the console, then I would think you'd need the Form ID. I'm guessing it would be persistent, but I suggest testing that to make sure. I use RunScriptLine a lot, but in my case it's associated with a quest and there are local variables that get set as a result, so the stuff I do is definitely persistent.
User avatar
Phillip Hamilton
 
Posts: 3457
Joined: Wed Oct 10, 2007 3:07 pm

Post » Sat Feb 19, 2011 12:05 am

Quick question about the best way to do something:

Arkgnt and I are in the process of upgrading and expanding our "ShiningCreatures" mod so that it doesn't require multiple patches for the different mods I want the creatures from to glow. This would involve adding a spell to the base forms of these actors (less irritating than looping through all the actors in a cell and adding tokens if they match the creatures I want to edit). I was thinking, using "IsModLoaded" followed by "RunScripLine "FormOfOtherMod.AddSpell RPSSCGlowingSpell"". Would this work with just the EditorID, or would I have to get the base actor's formID using "GetFormFromMod" first? Also, how persistent would these changes be? Would they stay in a save game? (Uninstalling shouldn't be a problem if the spell is unique to my mod, it should just "vanish") Would I have to initialize my mod on every game load?

Thanks :)

The main problem here is that you can't do FormOfOtherMod.AddSpell when FormOfOtherMod is a base object.
I'm drawing a blank on a means of adding the spells to the base actors with current functionality. You might do something like this:
ref actorarray_var iter; ... blah...if (GetCellChanged)  foreach iter <- GetHighActors    let actor := *iter    if (you want to add a spell to this actor's base form      actor.addSpell whatever    endif  loopendif

This would be pretty lean - it only runs on cell change and GetHighActors is more efficient than the ref-walking cmds if you're only interested in actors.
User avatar
Lizs
 
Posts: 3497
Joined: Mon Jul 17, 2006 11:45 pm

Post » Fri Feb 18, 2011 10:39 pm

Hey Guys, please have a short look at this Script:

scn TestScript001Short FirstRef rFloat fQuestDelayTimestring_var msgBegin GameMode		If First == 0		Player.AddItem aaaTroyTestSword001 1		Set First to 1		Let fQuestDelayTime := .001	Endif		If IsKeyPressed2 24 && First		Let r := Player.GetEquippedObject 16			r.SetModelPath "Weapons\braided\blongsword.nif"		Let msg := "Modelpath is " + r.getmodelpath + "and r is " + r.GetName		PrintToConsole $msg				Player.Update3D		Let First := -2	Else		Set First to 1	Endif	End


So the Weapon in the Hand of the Player should change his model if I press "O". But it isn't -.- Can you explain me why?

Probably you mean
	If IsKeyPressed2 24 && First !=-2 ;or something
Aslo check the code samples : http://cs.elderscrolls.com/constwiki/index.php/IsKeyPressed2 - you must check if the key is released or not
SetModelPath "Weapons\braided\blongsword.nif" r
You haven't read the docs, have you ?
User avatar
MatthewJontully
 
Posts: 3517
Joined: Thu Mar 08, 2007 9:33 am

Post » Sat Feb 19, 2011 6:11 am

So, I've never tried messing around with leveled lists before, but I want to take some weapons out of the Fran's leveled lists. I assumed I would just go into the leveled list and delete the weapon out of it, but that didn't seem to work. So my question is, how would I go about removing a weapon from a leveled list, so they stop appearing on NPCs?

Also, is there any way to search for the leveled lists that contain a particular weapon? For example, I'm trying to remove the weapon Warbrand, which the CS tells me has 2 uses. I found one leveled list and deleted the weapon, but it still appears in game, and I can't find the second use.

Any help would be appreciated.
User avatar
Zualett
 
Posts: 3567
Joined: Mon Aug 20, 2007 6:36 pm

Post » Sat Feb 19, 2011 7:33 am

Ok.........I'm trying to sell a substantially large amount of items to one of the plugin merchants (Nilphas), and I want to be able to just sell my items one at a time without having to keep scrolling back to "1". Is there a way to change the default "How Many?" setting to "1" in the CS?
User avatar
MR.BIGG
 
Posts: 3373
Joined: Sat Sep 08, 2007 7:51 am

Post » Fri Feb 18, 2011 8:00 pm

Ok.........I'm trying to sell a substantially large amount of items to one of the plugin merchants (Nilphas), and I want to be able to just sell my items one at a time without having to keep scrolling back to "1". Is there a way to change the default "How Many?" setting to "1" in the CS?


Yes. Change the value of http://cs.elderscrolls.com/constwiki/index.php/IInventoryAskQuantityAt. Alternately, get the mod http://www.tesnexus.com/downloads/file.php?id=12859
User avatar
Chad Holloway
 
Posts: 3388
Joined: Wed Nov 21, 2007 5:21 am

Post » Sat Feb 19, 2011 6:26 am

So, I've never tried messing around with leveled lists before, but I want to take some weapons out of the Fran's leveled lists. I assumed I would just go into the leveled list and delete the weapon out of it, but that didn't seem to work. So my question is, how would I go about removing a weapon from a leveled list, so they stop appearing on NPCs?

Also, is there any way to search for the leveled lists that contain a particular weapon? For example, I'm trying to remove the weapon Warbrand, which the CS tells me has 2 uses. I found one leveled list and deleted the weapon, but it still appears in game, and I can't find the second use.

Any help would be appreciated.


Sounds like you did it right. However, the NPC will keep the weapon until its inventory resets, even if the weapon was removed from the originating LL.
User avatar
noa zarfati
 
Posts: 3410
Joined: Sun Apr 15, 2007 5:54 am

Post » Fri Feb 18, 2011 10:43 pm

Sounds like you did it right. However, the NPC will keep the weapon until its inventory resets, even if the weapon was removed from the originating LL.


Ah, I see. That makes sense then. Thanks. :)
User avatar
Steven Nicholson
 
Posts: 3468
Joined: Mon Jun 18, 2007 1:24 pm

Post » Sat Feb 19, 2011 7:47 am

Every time I close the Construction Set, I get a "Modelloader still has X NIF files. Continue playing?"-warning. Because I encountered a "bug" where bright light had been turned on in the game that I thought was because I had pressed "Yes" in the modelloader warning, I have pressed "No" ever since. But moments ago, I learned I could just type tbl to turn off the bright light.

1. What is up with the "Modelloader still has X NIF files. Continue playing?"-warning? Should I press "Yes" or "No"?

2. Out of curiosity, why does the bright light sometimes enable in Oblivion after I've been using the Construction Set? I've re-installed 2 times, completely unecessarily, because of this bug.
User avatar
Ludivine Poussineau
 
Posts: 3353
Joined: Fri Mar 30, 2007 2:49 pm

Post » Fri Feb 18, 2011 5:30 pm

Ok.........I'm trying to sell a substantially large amount of items to one of the plugin merchants (Nilphas), and I want to be able to just sell my items one at a time without having to keep scrolling back to "1". Is there a way to change the default "How Many?" setting to "1" in the CS?

Not sure, but there are a couple of mods dealing with this. Most important, install http://www.tesnexus.com/downloads/file.php?id=12859. With that mod, holding down control bypasses the "How Many", and sells one item without any confirmation needed, while holding down shift does the same, but sells all items.

Secondly, there are a number of mercantile leveling mods that make you gain just as much mercantile skill from selling the items all at once instead of one at a time, thus removing the reason for selling them one by one. The two best/most up to date are the Progress mercantile plugin, and the mercantile leveling feature in my Enhanced Economy mod.
User avatar
Elina
 
Posts: 3411
Joined: Wed Jun 21, 2006 10:09 pm

Post » Sat Feb 19, 2011 7:26 am

Yes. Get the mod http://www.tesnexus.com/downloads/file.php?id=12859

That worked perfectly. Thanks. :thumbsup:

There are a number of mercantile leveling mods that make you gain just as much mercantile skill from selling the items all at once instead of one at a time, thus removing the reason for selling them one by one. The two best/most up to date are the Progress mercantile plugin, and the mercantile leveling feature in my Enhanced Economy mod.

:shifty: Uhh.......no. If I were to go that route, I'd have to find a mod that allowed me to sell an entire stack of expensive items to a merchant, and get paid for each item individually, rather than be refused because the merchant didn't have enough gold on himself/herself to buy all of the items at once (for example, the pile of Glass Longswords I swiped from a raid of Marauder dungeons). As a matter of fact, that WOULD have been my next question if there wasn't a mod to help with the issue at hand. Thanks for the reply, though. :thumbsup:
User avatar
Paula Rose
 
Posts: 3305
Joined: Fri Feb 16, 2007 8:12 am

Post » Sat Feb 19, 2011 9:29 am

I am making a mod where the player can watch special arena matches, in a mod created arena. There will be buttons that when pressed, cause an activator to cast a spell to kill, resurrect, or disable the combatants. But I need to figure out how to stop these from also running on the player. Currently the spell is just a simple script effect:
begin ScriptEffectStart   killend

How can I set it so that the player is immune?
User avatar
Kit Marsden
 
Posts: 3467
Joined: Thu Jul 19, 2007 2:19 pm

Post » Sat Feb 19, 2011 1:14 am

I am making a mod where the player can watch special arena matches, in a mod created arena. There will be buttons that when pressed, cause an activator to cast a spell to kill, resurrect, or disable the combatants. But I need to figure out how to stop these from also running on the player. Currently the spell is just a simple script effect:
begin ScriptEffectStart   killend

How can I set it so that the player is immune?


By having the activator cast the spell on the targets you want dead specifically. You might also find this useful: http://cs.elderscrolls.com/constwiki/index.php/Casting_Spells_From_An_Activator
User avatar
Natalie J Webster
 
Posts: 3488
Joined: Tue Jul 25, 2006 1:35 pm

Post » Sat Feb 19, 2011 9:12 am

I am making a mod where the player can watch special arena matches, in a mod created arena. There will be buttons that when pressed, cause an activator to cast a spell to kill, resurrect, or disable the combatants. But I need to figure out how to stop these from also running on the player. Currently the spell is just a simple script effect:
begin ScriptEffectStart   killend

How can I set it so that the player is immune?


Been gone for a while so my scripting is rusty, but you can make an "if" check to see if the target of the spell is the player. Something like ...

Begin ScriptEffectStart   If GetSelf != Player      Kill   EndifEnd


Translated into English -> If the target of the spell is not the player, then kill them.
User avatar
krystal sowten
 
Posts: 3367
Joined: Fri Mar 09, 2007 6:25 pm

Post » Sat Feb 19, 2011 1:40 am

Been gone for a while so my scripting is rusty, but you can make an "if" check to see if the target of the spell is the player. Something like ...

Begin ScriptEffectStart
If GetSelf != Player
Kill
Endif
End

Translated into English -> If the target of the spell is not the player, then kill them.

Thanks, that worked exactly how I wanted it...within error. :turned:
User avatar
Kate Schofield
 
Posts: 3556
Joined: Mon Sep 18, 2006 11:58 am

Post » Sat Feb 19, 2011 5:09 am

A couple more on the same topic.

1. How can I set a delay between script actions, I can't find anything on the wiki. I want the script to first kill them, showing a spell animation, and then disable them. It just looks weird when they suddenly cease to exist.

2. When I revive NPCs, they have dropped their weapons. Can I in anyway either give them back, or prevent them from dropping them? I figure I could use the script to add the items, but that would be somewhat long and require a bunch of If Statements.
User avatar
carly mcdonough
 
Posts: 3402
Joined: Fri Jul 28, 2006 3:23 am

Post » Sat Feb 19, 2011 4:34 am

A couple more on the same topic.

1. How can I set a delay between script actions, I can't find anything on the wiki. I want the script to first kill them, showing a spell animation, and then disable them. It just looks weird when they suddenly cease to exist.

2. When I revive NPCs, they have dropped their weapons. Can I in anyway either give them back, or prevent them from dropping them? I figure I could use the script to add the items, but that would be somewhat long and require a bunch of If Statements.


1. Just add your own little timer loop. Here's one I use that disables and then enables the object the player has clicked on. The finish variable is set from a menu when the player selects that option.
	if ( finish )		Disable		if ( doOnce )			return		elseif ( timer > 1 )			set doOnce to 1			Enable			set finish to 0		else			set timer to timer + getSecondsPassed		endif	endif


You may not need the doOnce variable either. My little timer there is for only 1 second, which is enough in my case.

2. I'm not sure. I know that Resurrect 1 restores an NPC will all his gear, but I'm not sure if a weapon would still be equipped.
User avatar
Irmacuba
 
Posts: 3531
Joined: Sat Mar 31, 2007 2:54 am

Post » Sat Feb 19, 2011 9:49 am

2. When I revive NPCs, they have dropped their weapons. Can I in anyway either give them back, or prevent them from dropping them? I figure I could use the script to add the items, but that would be somewhat long and require a bunch of If Statements.


If the weapons come from a leveled list, they will respawn when the actor is resurrected.
User avatar
Katie Louise Ingram
 
Posts: 3437
Joined: Sat Nov 18, 2006 2:10 am

Post » Sat Feb 19, 2011 5:47 am

I am very stuck on this script. I have the script attached to a spell. Script Effect for 3 seconds on Target. What I want is for a spell to be cast. When the spell hits, it runs the kill command. Three seconds pass and it runs the disable command.
scn ChoArSpellDisablebegin ScriptEffectStart	if GetSelf != player		kill	endifendbegin ScriptEffectFinish	if GetSelf != player		disable	endifend

Instead, it disables, and then adds Script Effect to the player, the only remaining actor.
User avatar
Rusty Billiot
 
Posts: 3431
Joined: Sat Sep 22, 2007 10:22 pm

Post » Sat Feb 19, 2011 2:23 am

I am very stuck on this script. I have the script attached to a spell. Script Effect for 3 seconds on Target. What I want is for a spell to be cast. When the spell hits, it runs the kill command. Three seconds pass and it runs the disable command.
scn ChoArSpellDisablebegin ScriptEffectStart	if GetSelf != player		kill	endifendbegin ScriptEffectFinish	if GetSelf != player		disable	endifend

Instead, it disables, and then adds Script Effect to the player, the only remaining actor.


I really feel like you will get a good return on an investment of time going through the scripting tutorials. You probably should also start a new thread, because you keep coming back for the same issues looking for answers that are not really short.

I can't say why your way isn't working without more data. There are other factors to consider, not just the spell script. What about the activator the player uses to trigger the whole process, or the activator that casts the spell (if that is a separate object)?

There are a few ways to accomplish what you want to do in a more reliable way. Were it me, I would have the activator the player uses cast a script effect spell to kill very specific targets. The targets themselves would then have a script with an OnDeath block to disable themselves after three seconds.

Look up "simple timer" at the Wiki. That will give you something to work with, either way.
User avatar
^~LIL B0NE5~^
 
Posts: 3449
Joined: Wed Oct 31, 2007 12:38 pm

PreviousNext

Return to IV - Oblivion