Jump to content

please help with terminal scripting


pseudonym

Recommended Posts

well, i just finished writing this and i have to say that i confused myself pretty good. if anyone can work out what i actually mean i will be surprised, but if you can also solve it i will be very grateful. I'll try to explain what I'm attempting to achieve and then where I'm failing, please help if you can. the example I'm going to use is that the plan is to create a persistent list via a terminal menu for setting a number of objects to be collected from a container. the player can change the number that will be in the container by using commands inside the terminal. that part is easy enough and i can get it to work easily. i am using global variables for the item numbers to keep track of the list even after loading the game etc. the part where it all comes crashing down is that i want to be able to check the number from the terminal without having to leave it every time and without checking the container to see how many are in there already. so we'll say that we want to have 5 stimpaks always available from the container, but we have to set that number via the terminal. i can click the button five times and have five stimpaks waiting for me but the problem I'm having is that i cannot get the number to display on the terminal screen and change as i increase or decrease the number of stimpaks. when i click "+ 1 stimpaks", i want to see the number on the terminal screen change from 0 to 1, then 2, 3 and so on and have the number of stimpaks in the container reflect the displayed number. currently all i have been able to achieve is the same screen looking back at me with random gibberish as i try different things and fail.

 

well thats it, if you read the whole way through and were left feeling confused and angry that you wasted your time, im not surprised at all. im pretty much feeling the same because ive been trying to work this out for a few hours now and a combination of terrible internet connection and outrageous tiredness has left me only more and more confused. if anyone wants further clarification on just what i'm talking about just ask and i will try to explain it better. thanks for your patience

Link to comment
Share on other sites

  On 3/12/2011 at 1:25 PM, pseudonym said:

well, i just finished writing this and i have to say that i confused myself pretty good. if anyone can work out what i actually mean i will be surprised, but if you can also solve it i will be very grateful. I'll try to explain what I'm attempting to achieve and then where I'm failing, please help if you can. the example I'm going to use is that the plan is to create a persistent list via a terminal menu for setting a number of objects to be collected from a container. the player can change the number that will be in the container by using commands inside the terminal. that part is easy enough and i can get it to work easily. i am using global variables for the item numbers to keep track of the list even after loading the game etc. the part where it all comes crashing down is that i want to be able to check the number from the terminal without having to leave it every time and without checking the container to see how many are in there already. so we'll say that we want to have 5 stimpaks always available from the container, but we have to set that number via the terminal. i can click the button five times and have five stimpaks waiting for me but the problem I'm having is that i cannot get the number to display on the terminal screen and change as i increase or decrease the number of stimpaks. when i click "+ 1 stimpaks", i want to see the number on the terminal screen change from 0 to 1, then 2, 3 and so on and have the number of stimpaks in the container reflect the displayed number. currently all i have been able to achieve is the same screen looking back at me with random gibberish as i try different things and fail.

 

well thats it, if you read the whole way through and were left feeling confused and angry that you wasted your time, im not surprised at all. im pretty much feeling the same because ive been trying to work this out for a few hours now and a combination of terrible internet connection and outrageous tiredness has left me only more and more confused. if anyone wants further clarification on just what i'm talking about just ask and i will try to explain it better. thanks for your patience

 

1. Global variable may not be necessary.. I tend to make a quest and have a quest script attached to it where I list my short vars. So let's say you have a quest script

Scriptname MyQuestSCRIPT

short stimpaks   ; the number of stimpacks in the container

begin GameMode
    Set stimpaks to ContainerRef.GetItemCount stimpackID 
End    ;probably not neccessary.

 

If you're only gonna have a maximum of say 5 stimpacks, you may as well make 5 identical menu items (IE: "Check stimpack level"). And each one has a condition,

"GetQuestVariable MyQuest stimpacks == 0". The result of this particular menu item will tell the player that it has no stimpacks.

You can make 5 of these, each one having == 1, ==2, etc.

To access this variable in any script, you can reference it as such: MyQuest.stimpacks (not MyQuestSCRIPT.stimpacks)

 

BUT, this can be tedious if you're planning on having many more items. Then, intsead I recommend passing the variable to a message.

In this case, you can just pass the number of stimpacks in the container to the message.

 

check out GECK Wiki - Messages.

 

I've done this very similar thing with alcohol and chem levels in my mod (see sig).

 

Edit: Also make sure that you have "Reload" box checked for the menu selections. This just means that if the menu changes something in it's condition, it won't take effect until you reload the menu. This will stopp you from having to leave and reenter the terminal.

Edited by PaladinRider
Link to comment
Share on other sites

I agree with PaladinRider. There is no way to display a changeable variable in a terminal. The idea of "==1, ==2, ==3" may work if you have small numbers of items.

 

In a recent mod, not released yet, I used the idea of a touchscreen, which is a poster you can activate. When you touch (activate) it, you get a messagebox. In a messagebox, you can use variables, as PR has mentioned. Unfortunately a messagebox cannot dynamically update, but your button routine can just re-open the messagebox with the new value. The messagebox will "blink", that is disappear and reappear. That may or may not be ok. For me, I used it as a "Hall of Fame" display, which counts the number of times the player has done a certain thing, compared to certain previous NPCs (sorry for being vague). So the counter variable cannot update while the player is there. YMMV, but terminal displays are pretty limited.

Link to comment
Share on other sites

thank you both for your help. PaladinRider, your first way would work perfectly except I intended to make this work with many different items and with large numbers as well, so it would make an incredible amount of tedious repetition and I would probably just lose interest long before I completed the mod. I might still be able to use your suggestion elsewhere though so thanks a lot. but, your second suggestion with using messages and passing the variable from a quest script might be just the thing I'm looking for. if this works I will just use an activator that looks like a terminal and simply use messages to do what I need, like davidlallen's touchscreen poster. oh and by the way I'm going to download your Lucky 38 mod this arvo and give it a go, I love that sort of stuff.

 

the only problem is I don't know the correct syntax I need to put in the message to read and display the variable. could either of you please give me an example of how to do this? you've obviously had some success using this method davidlallen so I'm very keen to try it out for myself. the blinking shouldn't be a problem either, as long as the functionality is there it doesn't really bother me.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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