Quick Questions -- Quick Answers, The 27th

Post » Fri Feb 18, 2011 10:18 pm

This isn't possible in the CS, no. However, perhaps one day soon, http://www.gamesas.com/index.php?/topic/1147753-shademes-construction-set-extender/.


Thanks for the confirmation. Here's hoping!
User avatar
michael danso
 
Posts: 3492
Joined: Wed Jun 13, 2007 9:21 am

Post » Sat Feb 19, 2011 8:55 am

Is it possible to set a variable in an Object script from another script, without using Global/Quest variables? I have a Magic Effect ability script on the player, and it needs to change a variable in a script that is attached to an Activator object. This Activator object is created on the fly by using PlaceAtMe (yes I know about savegamebloating and will use DeleteReference to prevent this). I expected that this would work:

set ActivatorRef.LocalActivatorVariable to MyVar

Which is explained here:
http://cs.elderscrolls.com/constwiki/index.php/Reference_Variables

Like other variables, you can set a reference variable on another scripted object:

set BobRef.myRef to GetSelf


But that doesn't work at all, it won't even compile the script. Is this only possible by pre-placing the activator in the CS render window and giving it a unique Reference Editor ID? Because that would defeat the purpose of what I am trying to do.


Is there any other way at all to make two local scripts communicate through their variables without using global/quest variables as the middleman?
User avatar
Riky Carrasco
 
Posts: 3429
Joined: Tue Nov 06, 2007 12:17 am

Post » Sat Feb 19, 2011 4:31 am

No. It is not possible.

Variable names from other scripts are resolved when you compile the script in the CS and are not kept in the compiled script. You need to use "SomePersistentReferenceID.varName" so the compiler may find the reference, find its script and find the variable within the script.

This last part (finding the variable within the script) cannot be done dynamically, because, as said, the variable names are not known at runtime.

Quest vars are perfect for inter-script communication.
Any particular reason why you don't want to use them?
User avatar
Etta Hargrave
 
Posts: 3452
Joined: Fri Sep 01, 2006 1:27 am

Post » Sat Feb 19, 2011 3:21 am

Ah, thought so. I figured I'd ask anyway, you never know. :) Thanks for your reply!

I wanted it for mere convenience really. Eventually the Magic Effect ability script will be on many actors, who will/can all place their own instance of the Activator object in the world through PlaceAtMe, and I don't want to risk that two magic effect scripts try to communicate with their Activator object's script at the same time through the same quest variable, but I guess I can just use Array_var's to handle that. It just means a bunch more scripting that I rather avoided.

I should create a questscript that tracks all the PlaceAtMe objects in an array anyway, to make sure they get deleted properly and don't linger in the savegame causing bloating. I guess I can just include it in that.
User avatar
Chrissie Pillinger
 
Posts: 3464
Joined: Fri Jun 16, 2006 3:26 am

Post » Fri Feb 18, 2011 10:39 pm

EDIT: Problem solved.
User avatar
Ellie English
 
Posts: 3457
Joined: Tue Jul 11, 2006 4:47 pm

Post » Sat Feb 19, 2011 8:37 am

I'm trying to alter the skeleton of the player and NPCs. I use string variables (NewSkeleton and OldSkeleton in the example) to declare the new skeleton (which works fine) and store the player's/actor real skeleton through GetModelPath. For the player, I'm using a function called SetPlayerSkeletonPath $NewSkeleton, which I found being used in another mod, and of which I can't find documented in the wiki nor in OBSE documentation. For the NPCs I'm trying to use http://cs.elderscrolls.com/constwiki/index.php/SetModelPath $NewSkeleton, followed by Update3D, which seems to be quite unstable.
calling it on an actor may lead to later crashes when the actor is reloaded.

A crash that indeed happens after changing the actor's skeleton back to his normal one through SetModelPath $OldSkeleton and calling Update3D.

Is there some way to avoid these crashes for swapping skeletons on NPCs?

Also, is it reliable to store string variables in a token item's script?

Nevermind, solved with ModModelPath, mmuch better!
User avatar
Colton Idonthavealastna
 
Posts: 3337
Joined: Sun Sep 30, 2007 2:13 am

Post » Sat Feb 19, 2011 9:49 am

Hey, i just want to know. How would i make a script that automatically adds an item or spell to the spells inventory/spell list right when i load up the game or start up a new game? thanks.
User avatar
Rinceoir
 
Posts: 3407
Joined: Thu Jun 29, 2006 1:54 am

Post » Sat Feb 19, 2011 3:50 am

New question: How do I increase the number of uses for a Sigil Stone beyond 255? Is there a setting somewhere in the CS that I can alter to change this?
User avatar
willow
 
Posts: 3414
Joined: Wed Jul 26, 2006 9:43 pm

Post » Sat Feb 19, 2011 12:33 am

Hey, i just want to know. How would i make a script that automatically adds an item or spell to the spells inventory/spell list right when i load up the game or start up a new game? thanks.

First, you have to make a new quest. To do this, click on the Q button that is just above the Object Window. Then right-click in the quest list and select New. Give your quest an ID (like MyItemAddQuest) and click OK and then close the Quest window. Now you need to make a script for it. Click on the button that looks like a pencil (second button to the right of the Q button). In the window that opens, click on Script and select New. In the Script Type dropdown box, select Quest. Now write your script. It should look something like:

scn AAMyItemAddScriptBegin GameMode ;this script will run as soon as the game starts and keep running once per frame until stopped with StopQuestPlayer.AddItem Item1ID 1 ;this will add one of the specified itemPlayer.AddItem Item2ID 1 ;this will add one of the specified itemPlayer.AddSpell SpellID ;this will add the specified spellPlayer.AddSpell SpellID ;this will add the specified spellStopQuest MyItemAddQuest ;this will stop the quest once it has added everythingend


Save your script and close the script window. Now click on the Q button again and find the quest you made earlier. Find the script you just made in the Script dropdown box and select it (note 1: starting your script name with AA will put it at, or near, the top of the list.). Close the Quest window again and you're done.

Note 2: If you don't include the StopQuest command in your script, all of the items will be added to your inventory over and over and you will quickly become over-encumbered.

New question: How do I increase the number of uses for a Sigil Stone beyond 255? Is there a setting somewhere in the CS that I can alter to change this?

The 255 limit is hard-coded in. If there is a way to change, I can't find it (and I've looked high and low).
User avatar
Hairul Hafis
 
Posts: 3516
Joined: Mon Oct 29, 2007 12:22 am

Post » Sat Feb 19, 2011 1:32 am



http://www.gamesas.com/index.php?/topic/1152700-adding-itemspell-to-inventory-right-when-you-loadstart-oblivion/
User avatar
Pawel Platek
 
Posts: 3489
Joined: Sat May 26, 2007 2:08 pm

Post » Sat Feb 19, 2011 12:01 am

OK I found a way to batch edit multiple cells using a free program AutoHotkey (http://www.autohotkey.com)

This is the code I wrote for AutoHotkey's "AutoHotkey.ahk" file (the default one) so I can strip ownership from multiple items in cells (so that I can have item ownership handled by the cell's properties, and not the item's properties)

It would not be difficult to rewrite this script to do a variety of things for batch editing items. Note that:
* I used absolute coordinates. Depending on the size of your monitor and what you want to click on, your coordinates will be different. A tool is included with AutoHotkey to determine what coordinates your mouse is at.
* You would obviously set the loop number a lot higher, I typically use "40" so I can strip 40 rows with one keypress
* Sleep statements are really important to have, because the GUI in the construction set is not as quick as the script

; this script (Ctrl+w) removes ownership for the object currently under the mouse cursor and moves down the "Cell View" list according to the loop number^w::				; sets the shortcut to control+w and begins scriptCoordMode, Mouse, Screen 	; tells the app to use absolute screen coordinates, not coordinates relative to the active windowMouseGetpos, varX, varY 	; sets two variables, recording the original x (varX) and y (varY) coordinatesloop 1 				; tells the script enclosed in brackets below {} to loop a specified number of times.  change the number here accordingly{  CoordMode, Mouse, Screen 	; tells the app to use absolute screen coordinates, not coordinates relative to the active window  Click right 			; right clicks, opens the context menu of an item in the "Cell View" list  Sleep, 100 			; wait 1/10 sec  Click relative 15,35 		; moves the mouse to select "Edit" from context menu  Sleep, 100 			; wait 1/10 sec  Click 617,390 		; clicks "Ownership" tab at the specified absolute coordinates  Sleep, 100 			; wait 1/10 sec  Click 623,447 		; clicks drop-down box for ownership at the specified absolute coordinates  Sleep, 100 			; wait 1/10 sec  Send {Home} 			; goes to top of list i.e. "NONE". if you want to select a certain NPC, you will have to use Send and a letter of the alphabet or something  Sleep, 100 			; wait 1/10 sec  Send {Enter} 			; closes drop-down box with "Enter" key  Send {Enter} 			; closes item properties dialogue with "Enter" key  varY := varY + 17 		; Sets y-coordinate for next item in the "Cell View" list, 17 pixels down in my case, the row size may be different for you  MouseMove %varX%,%varY% 	; Moves the cursor to the next item in the list  Sleep, 100 			; wait 1/10 sec}return 				; ends the script once the loop is completed

User avatar
Rachel Tyson
 
Posts: 3434
Joined: Sat Oct 07, 2006 4:42 pm

Post » Fri Feb 18, 2011 9:33 pm

Hey,

just this little question... When i put a none-respawning container in a respawning cell (wilderniss) will the container respawn or not? Might sound dumb, but just have to know this :)
Ty

Fire3lf
User avatar
trisha punch
 
Posts: 3410
Joined: Thu Jul 13, 2006 5:38 am

Post » Sat Feb 19, 2011 4:02 am

Hey,

just this little question... When i put a none-respawning container in a respawning cell (wilderniss) will the container respawn or not? Might sound dumb, but just have to know this :)
Ty

Fire3lf

It has been my experience that the container will not respawn.
User avatar
Chloe :)
 
Posts: 3386
Joined: Tue Jun 13, 2006 10:00 am

Post » Sat Feb 19, 2011 4:22 am

It has been my experience that the container will not respawn.

okay ty!
User avatar
Monika Krzyzak
 
Posts: 3471
Joined: Fri Oct 13, 2006 11:29 pm

Post » Sat Feb 19, 2011 8:26 am

Well, i'm back :D
I got another small question

Scn AAplusWotwTestamentScriptBegin Onequip	SetStage AplusWOTWQuest 255	player.Moveto AAplusWotwBedMarker	player.removeitem AAplusWotwTestament 1End 


When I read this scroll i'm teleported back to my bed (bedmarker) but my screen starts flashing.(black and in-game vieuw)

I have tried using a crystal ball too because i tought it was because of the scroll, but still the same problem.
Anyone knows what is happening here?

thanks
fire3lf
User avatar
NEGRO
 
Posts: 3398
Joined: Sat Sep 01, 2007 12:14 am

Post » Sat Feb 19, 2011 1:09 am

The WIKI says MoveTo acts as a return.
My feeling is that it crashes the script and the engine tries the script again the next frame, causing what you experienced.

Try adding a condition that prevents the script from running two frames in a row.
User avatar
Hot
 
Posts: 3433
Joined: Sat Dec 01, 2007 6:22 pm

Post » Sat Feb 19, 2011 9:04 am

Well, i'm back :D
I got another small question

Scn AAplusWotwTestamentScriptBegin Onequip	SetStage AplusWOTWQuest 255	player.Moveto AAplusWotwBedMarker	player.removeitem AAplusWotwTestament 1End 


When I read this scroll i'm teleported back to my bed (bedmarker) but my screen starts flashing.(black and in-game vieuw)

use an activator ! an item that movesto the PC while in PC inventory won't do
Scn AAplusWotwTestamentScriptBegin Onequip	SetStage AplusWOTWQuest 255activate myacivator ; work out the detailsEnd MyActvtrSCRBegin onacivate	player.removeitem AAplusWotwTestament 1	player.Moveto AAplusWotwBedMarkerend
IIRC
User avatar
Nancy RIP
 
Posts: 3519
Joined: Mon Jan 29, 2007 5:42 am

Post » Sat Feb 19, 2011 12:25 am

use an activator ! an item that movesto the PC while in PC inventory won't do


I try that! thanks!

EDIT: i tried another way, just putting a switch and the PC can only activate it when he did evrything. I wasn't able to activate the activator trough script (yup i'm a noob :D) But it works so still thanks!
User avatar
Mark Churchman
 
Posts: 3363
Joined: Sun Aug 05, 2007 5:58 am

Post » Sat Feb 19, 2011 1:45 am

This happens every once in a while lately and I wonder if anyone has a clue of what may be causing it:

I load a clean save and, after a few seconds, my quests kick in.
About the same time, the game quicjly shows the save menu and saves over my most recent save (!!), destroying it and creating a new save with the same serial number.

It just happened and I repeated the same process 4 or 5 times, but it did not happen again. Then it happened twice in a row.

Would appreciate any comments you may have on the matter.
User avatar
James Hate
 
Posts: 3531
Joined: Sun Jun 24, 2007 5:55 am

Post » Fri Feb 18, 2011 9:59 pm

This happens every once in a while lately and I wonder if anyone has a clue of what may be causing it:

I load a clean save and, after a few seconds, my quests kick in.
About the same time, the game quicjly shows the save menu and saves over my most recent save (!!), destroying it and creating a new save with the same serial number.

It just happened and I repeated the same process 4 or 5 times, but it did not happen again. Then it happened twice in a row.

Would appreciate any comments you may have on the matter.

That is just crazy !
There must be something in your quest scripts ???
:wacko:
User avatar
Horror- Puppe
 
Posts: 3376
Joined: Fri Apr 13, 2007 11:09 am

Post » Fri Feb 18, 2011 11:00 pm

Well, it was (in a sense):
I have a " DisableControl 6" in my initialization script and, believe it or not, it causes "IsKeyPressed2 0" to return true for all scripts that still run on that frame. Not " DisableControl 4" or "DisableControl 7". Just "DisableControl 6".

I happens that I use a shortcut keys mod and I had no key associated to "Overwrite the last save", therefore it was checking the keycode 0 with IsKeyPressed2, which, due to this glitch, returned true on that frame and the shortcut keys mod did its stuff and re-saved the game over my most recent save.

This happens only with OBSE v20 beta. And, of course, being a Beta, it is subject to these glitches. I've reported the issue to the OBSE team.
User avatar
Laura Wilson
 
Posts: 3445
Joined: Thu Oct 05, 2006 3:57 pm

Post » Sat Feb 19, 2011 6:22 am

How do you script a quest stage to occur when you enter a certain cell.
User avatar
lucy chadwick
 
Posts: 3412
Joined: Mon Jul 10, 2006 2:43 am

Post » Fri Feb 18, 2011 8:38 pm

How do you script a quest stage to occur when you enter a certain cell.

I would set up a trigger zone just inside the point of entry and attach the following script:

scn QuestUpdateTrigZoneScriptShort DoOnceBegin OnTrigger Player If DoOnce == 0  SetStage QuestID StageIndex  Set DoOnce to 1 EndifEnd

User avatar
El Goose
 
Posts: 3368
Joined: Sun Dec 02, 2007 12:02 am

Post » Sat Feb 19, 2011 4:43 am

I "had an idea" for IF statements that I don't know if it really works. I was building them like this:
If whatever == 0 && whateverelse == 0 &&...

But for two things that must be the same for the statement to fire, could it be written like:
If (whatever == whateverelse == 0) &&...

and still work?
User avatar
Ana
 
Posts: 3445
Joined: Sat Jul 01, 2006 4:29 am

Post » Sat Feb 19, 2011 7:10 am

Nvm, figured it out.
User avatar
Robyn Lena
 
Posts: 3338
Joined: Mon Jan 01, 2007 6:17 am

PreviousNext

Return to IV - Oblivion