Jump to content

Scripting questions


biscut247

Recommended Posts

:wallbash:Okay. I looked at every tutorial I could find, but that didnt help at all. :wallbash:

I understand IF statements and actions like <REFID>.Add/remove item or <REFID>.kill/disable/placeatlocation

 

I just dont understand things like counts and markers (damn markers) or any advanced scripting actions. I dont even understand LINKS! :wallbash: (like what i click first to link it right.)

 

Any clarification on these things would be helpful.

Link to comment
Share on other sites

:wallbash:Okay. I looked at every tutorial I could find, but that didnt help at all. :wallbash:

I understand IF statements and actions like <REFID>.Add/remove item or <REFID>.kill/disable/placeatlocation

 

I just dont understand things like counts and markers (damn markers) or any advanced scripting actions. I dont even understand LINKS! :wallbash: (like what i click first to link it right.)

 

Any clarification on these things would be helpful.

You should first be more clear yourself before asking for clarification.

 

What do you mean by "counts" and what don't you understand about markers?

Link to comment
Share on other sites

You should first be more clear yourself before asking for clarification.

 

What do you mean by "counts" and what don't you understand about markers?

 

Counts. you know, the scripting function used to see whats in your invintory.

EXAMPLE:

short count

set count to player.GetItemCount caps001

and I dont even know how to USE a marker. :(

i cant find a legitamite tutorial... sorry

Link to comment
Share on other sites

In order to reference any object (like an Xmarker) in a script, it needs two things:

1) It needs to be persistent

2) It needs an Editor Reference ID

 

Both of these can be set by double clicking on the object in the render window. In the case of an Xmarker, it is automatically set to be persistent anyway, so all you need to do is give it an Editor Reference ID.

 

Once you have done these two things, you can reference the object in a script by its Editor Reference ID.

 

So, lets say you have an Xmarker called "MyXMarker". Now you also have a light in the cell. If you double click on the light in the render window and then go to its "Enable Parent" tab, you can link this light to the Xmarker. Click the "Select Reference in Render Window" button. Your cursor will change to a red cross hair. Move it over the Xmarker and it will turn white. Click the cursor and the enable parent tab of the light will come back with the xmarker selected as the enable parent of the light.

 

Why do this? Now if in a script you use this:

 

MyXmarker.disable

 

The light will turn off because as the xmarker was disabled, so to will the light be disabled. You could set many lights up having the Xmarker as their enable parent and they would all go off when the above command was used. And if you then do this:

 

MyXmarker.enable

 

All of the light will turn back on.

 

The Linked Ref and Activate Parent work similarly but for different purposes. If you want a switch to activate a door, you use the "Activate Parent" tab ion the door to link it to the switch. Then when you activate the switch, the door will acticvate as well. In this case the switch must be a persistent reference in order to be used as a parent of the door. If it isn't persistent, your red crosshair won't turn white when you are selecting the parent.

 

And that is a brief overview.

Link to comment
Share on other sites

As long as you set the marker as its enable parent.

 

You don't have to just use them to turn things on and off. You could use them to set up patrols and things like that as well.

It should be noted that there is an option to set its Enable state to the opposite of its parent's.

 

This is particularly useful if you are using something like the vault ceiling light, which has an on and an off model. You can just put one of each in the exact same spot, and have only one of them visible at a time.

 

I see. Heres a pretty specific question.

How do I set up a script in a terminal with an IF statement?

like, if i wanted to do a comand like "Toggle Lights"

I'm not sure if you can. Have you tried it?

 

If ( [color="#FF0000"]variable[/color] == 1 )
[color="#FF0000"]reference[/color].disable
set [color="#FF0000"]variable[/color] to 0
Else
[color="#FF0000"]reference[/color].enable
set [color="#FF0000"]variable[/color] to 1
Endif

 

I just have one option to turn on the lights, and one to turn them off.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...