A Few Script Questions And Others

Post » Thu Sep 17, 2009 9:41 pm

Hi there, a few questions for advanced GECK users:

1) I am trying to link a protectron to a protectron pod. I would like the protectron to leave the pod when activated by a console. I have added the protectron and the pod to the world, as well as a generic protectron terminal. Is there a script I need to add? I have tried to link the terminal and the robot, but to no avail.

2) On a similar note, I have jets of water coming from the ground as irrigation onto crops. What is the script that I should attach to a button so that this "irrigation" can be turned on and off?
User avatar
Justin
 
Posts: 3409
Joined: Sun Sep 23, 2007 12:32 am

Post » Fri Sep 18, 2009 4:53 am

2.) You can add an xMarker to the area and attach the water emitters/models to this xMarker as an enable parent. And whenever you enable/disable the xMarker all attached objects will reflect the state. So you can enable/disable models with this. (or lights or whatever)

In your script: "MyReferenceObject.Enable" or "MyReferenceObject.Disable"
User avatar
Nicola
 
Posts: 3365
Joined: Wed Jul 19, 2006 7:57 am

Post » Fri Sep 18, 2009 6:35 am

2.) You can add an xMarker to the area and attach the water emitters/models to this xMarker as an enable parent. And whenever you enable/disable the xMarker all attached objects will reflect the state. So you can enable/disable models with this. (or lights or whatever)

In your script: "MyReferenceObject.Enable" or "MyReferenceObject.Disable"


So I add the script to the button? Would you mind explaining a bit further? Thank you for your help.
User avatar
Kanaoka
 
Posts: 3416
Joined: Fri Jun 16, 2006 2:24 pm

Post » Fri Sep 18, 2009 6:28 am

You'd make a custom button and have an OnActivate script that enables/disables the xMarker. There might be a more elegant Activate Parent method or something but I haven't done anything like that in a while.

Actually yea I think you can just use Links and Activate Parent to accomplish it now that I think about it, there is a Broken Steel quest that does something similar (the one in the basemant in Springvale).
User avatar
Naomi Lastname
 
Posts: 3390
Joined: Mon Sep 25, 2006 9:21 am

Post » Thu Sep 17, 2009 11:46 pm

Hi there, a few questions for advanced GECK users:


I'm nowhere near being an "advanced GECK user", but I have done similar things in a couple mods I made for FO3.
Bear in mind, I'm typing this in on the fly. This hasn't been game tested, so will probably need some debugging.

1) I am trying to link a protectron to a protectron pod. I would like the protectron to leave the pod when activated by a console. I have added the protectron and the pod to the world, as well as a generic protectron terminal. Is there a script I need to add? I have tried to link the terminal and the robot, but to no avail.


Make a custom protectron and pod.
You will need to attach a script to the protectron that will store and modify it's various states, then give it some AI Packages to run depending on what state it is in.
Example script for the protectron:
scn ExampleProtectronSCPTint iInitint iState1;iState1 = 0 (off/unconscious);iState1 = 1 (on:run AI Package 1);iState1 = 2 (on:run AI Package 2);iState1 = 3 (on:run AI Package 3);etc...Begin OnLoadIf iState1 == 0     SetUnconscious 1EndIfEndBegin GameModeIf iInit != 0     If iState1 == 0          Set iState to 1          SetUnconscious 0          evp     EndIf;Use the GameMode block to modify iState1 periodically.;You'll need to do a "evp" whenever you update iState1 so that the protectron will ;change what AI Package it is currently running to reflect it's new state.EndIfEnd;Also, you can use the OnPackageStart, OnPackageEnd, and OnPackageChange blocks;to update iState1 if you want to.


Attach a script like this to the pod so that activating it does not open or close the door...:
scn ExamplePodSCPTBegin OnActivateReturnEnd


Place both of them in your cell. Make them Persistent Refs, and give them RefID names (MyPodRef, and MyProtectronRef, for example).

Now you can set up your console.
Make a custom console. On the screen for the menu item that will open the pod and activate the protectron, use a Result Script to first open the pod door, then activate the protectron. Also, you'll want to give your menu entries Conditions, so that once MyProtectronRef has been activated, the menu item to activate it is removed from the terminal's display, and replaced with a menu item that either does nothing, or returns a message that the protectron is already operational.
Here is a Result Script for the terminal's menu item to open the pod and activate the protectron:
MyPodRef.SetOpenState 1Set MyProtectronRef.iInit to 1


Use the GetScriptVariable Condition check to determine what menu items to display or hide in the terminal (when one is displayed, the other is hidden).
GetScriptVariable MyProtectronRef iInit = 0
to display the menu item that will open the pod and activate the protectron.
GetScriptVariable MyProtectronRef iInit = 1
to display the menu item that will return a message that the protectron is already active.

This should work... if not, I'll help you figure it out.

2) On a similar note, I have jets of water coming from the ground as irrigation onto crops. What is the script that I should attach to a button so that this "irrigation" can be turned on and off?


If you have several water jets, you'll want to use an Activate Parent.
Place the water jets where you want them. Also, place an "X" marker somewhere near them.
Make the "X" Marker a Persistent Ref, and give it a RefID name (WaterJetXRef...).
Make a custom switch, and attach a script to it:
scn ExampleSwitchSCPTBegin OnActivateIf IsActionRef Player == 1     If WaterJetXRef.GetDisabled == 1          WaterJetXRef.Enable     Else          WaterJetXRef.Disable     EndIfEndIfEnd


Make WaterJetXRef the Activate Parent for all the water jets. Now when WaterJetXRef is Activated, all the linked water jets will be Activated, and visa versa.

There is a cool little trick you could use to make the water jets come on in a sort of "cascade"... the first water jet will activate, then a second later the second one, then a second later the third one... just like real irrigation sprinklers coming to life as the water pressure reaches them one after the other. I'll have to look for the tutorial that explains in detail how to do it, just ask if you're interested.
User avatar
Daddy Cool!
 
Posts: 3381
Joined: Tue Aug 21, 2007 5:34 pm

Post » Fri Sep 18, 2009 6:51 am

You guys are over thinking the protectrons, there much more simple to set up then having to do a custom script.

first set up your "Generic Protectron terminal" Your "Protectron Pod" and place your "Protectron" NPC inside the pod. If you don't know you can set the pod to be open by default for proper placement of the NPC, then toggle it of when finished.

all three need to be set as persistent references.

next set the terminals Linked Reference to the Protectron itself, then set the Protectron pods Activating Parent to the Protectron. If you want you can also set a delay on this activation.

done and, done, the Protectron will now turn on, the pod will open, only after the player has activated the terminal.

If you want you can also set a patrol for him with XMarker Headings.

Hope this helps

cev

Edit, Take a look at the warehouse robots cell in the FO3 GECK, To see how it's done. They seemed to have not included this cell in the FNV GECK. The method from FO3 should work fine.
User avatar
Eve Booker
 
Posts: 3300
Joined: Thu Jul 20, 2006 7:53 pm

Post » Fri Sep 18, 2009 6:20 am

You guys are over thinking the protectrons, there much more simple to set up then having to do a custom script.

first set up your "Generic Protectron terminal" Your "Protectron Pod" and place your "Protectron" NPC inside the pod. If you don't know you can set the pod to be open by default for proper placement of the NPC, then toggle it of when finished.

all three need to be set as persistent references.

next set the terminals Linked Reference to the Protectron itself, then set the Protectron pods Activating Parent to the Protectron. If you want you can also set a delay on this activation.

done and, done, the Protectron will now turn on, the pod will open, only after the player has activated the terminal.

If you want you can also set a patrol for him with XMarker Headings.

Hope this helps

cev

Edit, Take a look at the warehouse robots cell in the FO3 GECK, To see how it's done. They seemed to have not included this cell in the FNV GECK. The method from FO3 should work fine.

:meh:

I took a look at the GenericMetroProtectron in the FO3:GECK before typing up my reply. That was the first Console+Protectron+Pod chain that came to mind when I read the OP. But after poking around with it, the way they are set up seemed to have a lot of unnecessary overhead so that they can be used in various situations. I actually thought the way I explained it was less complicated than the way Bethesda did it. If Agonofinis only needs one instance of his protectron, he doesn't need all the extra scripting attached to GenericMetroProtectron.
User avatar
Lou
 
Posts: 3518
Joined: Wed Aug 23, 2006 6:56 pm

Post » Fri Sep 18, 2009 1:54 am

Thanks very much for your help guys, I will try this in a couple of hours and let you know if it all works. There is indeed only one Protectron.
User avatar
Aliish Sheldonn
 
Posts: 3487
Joined: Fri Feb 16, 2007 3:19 am

Post » Fri Sep 18, 2009 5:29 am

Thanks for the help guys.

I set up the jets with an x marker and a custom switch. I persistent ref'ed the x marker, and linked the jets to the xmarker as well as the switch. I scripted the switch but nothing happens. I think this is because, though they are linked, the xmarker is not the parent of the jets. Where is the option for this? And what is the easiest way to have the jets initially disabled?

The protectron stuff works fine. Ssenkrad, the only problem is the conditions. I am not exactly sure how they work. the doors open and close, but how do I set up messages if the doors are already open/closed, or the protectron is already active? Is there a way to have the protectron initially disabled, not moving at all? At the moment he swings around and flashes inside the pod.

Thank you again, this is a huge help.
User avatar
Hope Greenhaw
 
Posts: 3368
Joined: Fri Aug 17, 2007 8:44 pm

Post » Fri Sep 18, 2009 4:07 am

Oh, also, does anyone know of a script I can attach to a terminal that will automatically repair all the player's weapons and armor? Thank you.
User avatar
Chris Johnston
 
Posts: 3392
Joined: Fri Jul 07, 2006 12:40 pm

Post » Fri Sep 18, 2009 9:44 am

Thanks for the help guys.

I set up the jets with an x marker and a custom switch. I persistent ref'ed the x marker, and linked the jets to the xmarker as well as the switch. I scripted the switch but nothing happens. I think this is because, though they are linked, the xmarker is not the parent of the jets. Where is the option for this? And what is the easiest way to have the jets initially disabled?

If by "linked", you mean you associated them with each other using the "Linked Ref" tab of their Properties dialog, that isn't necessary.
You need to be using the "Activate Parents" tab, instead. That tab is located in the Reference Properties dialog box, the tab next to the Linked Ref tab... the same dialog box as where you select Persistent Ref, and give the item a RefID.
Also, there doesn't need to be any sort of link with the switch. The "X" Marker is activated / deactivated via script.
To make the jets initially disabled, that option is also on the Properties dialog, right under the Persistent Ref option.

The protectron stuff works fine. Ssenkrad, the only problem is the conditions. I am not exactly sure how they work. the doors open and close, but how do I set up messages if the doors are already open/closed, or the protectron is already active? Is there a way to have the protectron initially disabled, not moving at all? At the moment he swings around and flashes inside the pod.

Thank you again, this is a huge help.

When you enter the text you want displayed on the terminal, at the bottom of that dialog is an area called "Item Conditions". Right Click in a blank line to bring up the dialog to set up the condition.
Select GetScriptVariable as the first option, then the rest of the options become available.
The pod should initially be closed by default.
In the script for the protectron, the OnLoad block is supposed to make the protectron "Unconscious" if it has not been initialized yet...

I'll hash together a test cell on my end and add these things myself later tonight. I'm afraid some things might be getting misinterpreted here, and my being able to look at what you are looking at will probably help a lot.
User avatar
GEo LIme
 
Posts: 3304
Joined: Wed Oct 03, 2007 7:18 pm

Post » Fri Sep 18, 2009 9:21 am

Thanks so much for your help, it is really useful.

I *think* I have sorted the water jet problem, my main problem is that they wouldn't be initially disabled, they were always on, but now I have the xmarker as a linked ref, have enabled it as the parent of the jets and marked each one to have "enable state opposite of parent". Now they work with the button, and they are initially off when you boot up the game. I know you said not to use linked redf, but the combination above seems to be the only thing that works.

I will have a play around with the terminal, I am still learning about AI packages so I'll set some behaviour up. I am a little confused about the scripts, but I will see what works.

If you have any answers for the following, I would appreciate it....

1) Sometimes, when I have tested something in game and then quit (though not exclusively), something strange happens in the render window of the GECK: the land disappears, only a few meshes are visible. I have restart the GECK, any ideas?

2) Any idea of a script that I could attach to a terminal menu item that would repair all of the player's items automatically? I have found the script to open the repair vendor window but I wonder if it is possible to have the player repair their items automatically and without cost.

3) I am looking for an easy way to delete grass from a cell. I know it is tied to the texture, and when I retexture a grassed area into a path, for example, the grass still shows through. Is there a way to delete the grass easily and effectively from paths and other areas I don't want it. The path texture does not have grass attached to it, so I am little confused...

Thanks again.
User avatar
James Hate
 
Posts: 3531
Joined: Sun Jun 24, 2007 5:55 am

Post » Thu Sep 17, 2009 10:13 pm

I am also a little confused by the Item Condition - the box that springs up is confusing.

I have one of the terminal options as "Open Pod Door", with the script to open it attached. The result text is "Opening..." If the door is already open, I want the result text to change to say "Already Open", or something similar. If you could walk me through how to do this, step by step, I would be grateful
User avatar
Ebou Suso
 
Posts: 3604
Joined: Thu May 03, 2007 5:28 am

Post » Thu Sep 17, 2009 8:43 pm

1) Sometimes, when I have tested something in game and then quit (though not exclusively), something strange happens in the render window of the GECK: the land disappears, only a few meshes are visible. I have restart the GECK, any ideas?

In general, I always close GECK before running Fallout to test things. GECK is unstable enough as-is, running another DirectX program like Fallout just seems to make it worse.
User avatar
Holli Dillon
 
Posts: 3397
Joined: Wed Jun 21, 2006 4:54 am

Post » Fri Sep 18, 2009 12:07 am

Thanks so much for your help, it is really useful.

I *think* I have sorted the water jet problem, my main problem is that they wouldn't be initially disabled, they were always on, but now I have the xmarker as a linked ref, have enabled it as the parent of the jets and marked each one to have "enable state opposite of parent". Now they work with the button, and they are initially off when you boot up the game. I know you said not to use linked redf, but the combination above seems to be the only thing that works.

I will have a play around with the terminal, I am still learning about AI packages so I'll set some behaviour up. I am a little confused about the scripts, but I will see what works.

If you have any answers for the following, I would appreciate it....

1) Sometimes, when I have tested something in game and then quit (though not exclusively), something strange happens in the render window of the GECK: the land disappears, only a few meshes are visible. I have restart the GECK, any ideas?

2) Any idea of a script that I could attach to a terminal menu item that would repair all of the player's items automatically? I have found the script to open the repair vendor window but I wonder if it is possible to have the player repair their items automatically and without cost.

3) I am looking for an easy way to delete grass from a cell. I know it is tied to the texture, and when I retexture a grassed area into a path, for example, the grass still shows through. Is there a way to delete the grass easily and effectively from paths and other areas I don't want it. The path texture does not have grass attached to it, so I am little confused...

Thanks again.

AI Packages always seem to frustrate me. The only really notable successes I've had with them is in Oblivion. I'm afraid I can't help you very much with them...

The repair via console has been done in other mods, so it is something that works, but I don't know how it was done right off hand.
I assume the ones for FO3 require FOSE, as it would need the http://fose.silverlock.org/fose_command_doc.html#SetHealth function...
Search FO3Nexus for some. I've learned quite a few pretty slick tricks from downloading and dissecting other people's mods. There is almost always more than one way to skin a cat...

And for the grass issue, again, I've only ever did any landscape editing in Oblivion. A lot has changed since then, so what I know about it is pretty useless in the Fallout arena.
(In fact, when making my Maintenance Shed for FO3, I went so far as to use "concrete slabs" to level the area for the shed in order to avoid doing any landscape editing.)

I am also a little confused by the Item Condition - the box that springs up is confusing.

I have one of the terminal options as "Open Pod Door", with the script to open it attached. The result text is "Opening..." If the door is already open, I want the result text to change to say "Already Open", or something similar. If you could walk me through how to do this, step by step, I would be grateful

The pod is an animated object with various states.
Use http://geck.gamesas.com/index.php/GetOpenState to check what state the pod door is in.

You will need to set up two menu items on the console.
One will open the pod door if it is closed, the other will display the message "Already Open" if it is already open.

The option to open the closed pod door would have a condition like:
PodRef GetOpenState == 3
This condition will tell the terminal to display this option only if the pod door is closed.

The option to display the message would have a condition like:
PodRef GetOpenState != 3
This condition will tell the terminal to display this option only if the pod door is not closed.

Obviously, only one of the menu items' condition check will pass, so only one will be displayed at a time.

It might make more sense to you if you take a look at the http://geck.gamesas.com/index.php/Category:Conditions.

In general, I always close GECK before running Fallout to test things. GECK is unstable enough as-is, running another DirectX program like Fallout just seems to make it worse.

Ditto...
User avatar
Zualett
 
Posts: 3567
Joined: Mon Aug 20, 2007 6:36 pm


Return to Fallout: New Vegas