thewaronandrew Posted December 17, 2008 Share Posted December 17, 2008 What is the line "short" for? Example from the Nuka-Cola vending machine script: ------------- scn HD02NukaVending short Buttonshort NukasOnMeshort GoNukas begin OnActivate --------------- Link to comment Share on other sites More sharing options...
FutureVisions Posted December 17, 2008 Share Posted December 17, 2008 Im just starting to look into scripts myself but i think these "short" lines are checks for the action you are trying to perform (i.e. what you can do and/or if u can do it).The script u posted here is for the machine thats goes to in tenpennytower suite. Im guessing that this is the script that controls the pop up that appears when u click the machine and lets u add or remove nuka colas. another example of "short" lines is for the megaton bomb script, i think you can get a better idea from it:------------- scn MS11BombScript short Button short SkillNeeded ;how much explosives skill is needed to interact with the bombshort SkillNeededtoDisarm ;how much explosives skill is needed to disarm the bombshort playerSkillshort DoOnce short dieRoll short captureButton ;wich button press are we tracking short explodeMe short camVar ;used as a condition on VATS death camerashort AnglePlayer float deathtimer-------------(these are just the first lines of this particular script) So what i think this script is doing here is:------------- short Button (i think this represents clicking the bomb) 1st line -- checks how much explosives skill is needed to interact with the bomb2nd line -- checks how much explosives skill is needed to disarm it3rd line -- checks how much explosives skill the player hasshort DoOnce (im also not sure about what this line means but it reapeats very often on many other scripts, i think its to prevent the script to enter a loop, in this case it'll only perform these checks once) short dieRoll (this, might be the death scenario script in case the player blows up the bomb) the next lines are describing what the game is supposed to do. in this case: you would push a buttonblow upenter VATS death camera modeand enter a deathtimer (probably for the animation) until load Again. I might be completly or partially wrong. I have no experience with scripting and this is just my opinion from what i think i understood by looking at some of the scripts. There are many scripts with notes from the guys who made them that can give you very useful information to understand some of the script lines if u dont have a better source ofc ;)Everything you'll see behind a ";" on a script is an editor note Link to comment Share on other sites More sharing options...
thewaronandrew Posted December 17, 2008 Author Share Posted December 17, 2008 I have a feeling that it is more of a link to another script or something. Because: short GoNukas doesn't make any sense to me. I am trying to figure out how to activate an object, have it remove an object, and add a different object. So far I have the first part down. I can activate the object, it will bring up a menu (dialogue), but when I select the dialogue it just closes and nothing happens. scn V100purewaterSCRIPT begin OnActivate;This causes the script to begin when the object is activated if ( IsActionRef Player == 1 );Makes sure the one committing the action is the player if ( Player.GetItemCount NukaColaBottle >= 1 );If you have one or more empty nuka cola bottles ShowMessage HD00V100SinkWith;Opens the dialogue box ("drink sink, fill bottles with water, do nothing") elseif ( Player.GetItemCount NukaColaBottle < 1 );If you have less than one empty nuka cola bottle ShowMessage HD00V100SinkWithout;Opens dialogue ("drink sink, do nothing") endif endif end I know you can only have one action per line, too. Link to comment Share on other sites More sharing options...
thewaronandrew Posted December 17, 2008 Author Share Posted December 17, 2008 I think short is used to allow a variable to be used in a script. Instead of typing out every time a line of code, you can use the term defined in short insead. A good example from somebody else's script: scn StealthArmour Begin GameMode short FusionBats short IsStealthAlreadyActive short Areyousneaking Set FusionBats to GetItemCount 00033BC6; defines the variable FusionBats as being equal to the number of Fission Batteries in your inventory Set IsStealthAlreadyActive to player.IsSpellTarget StealthField Set Areyousneaking to player.IsSneaking;checks to see if you're in stealth mode if Areyousneaking == 1 if FusionBats >= 1 if IsStealthAlreadyActive == 1 RemoveItem 00033BC6 1 player.CastImmediateOnSelf 0007E474 Endif Endif Endif End Do you see what I mean? So you set a short, then define it, and you can use the short instead of the long line of code. Can anyone confirm this? Link to comment Share on other sites More sharing options...
Hmazter Posted December 17, 2008 Share Posted December 17, 2008 short is a variable declaration for numerical values for example the code you postedSet FusionBats to GetItemCount 00033BC6;Stores the number of 00033BC6 items in the variable FusionBats. Link to comment Share on other sites More sharing options...
thewaronandrew Posted December 17, 2008 Author Share Posted December 17, 2008 So using that code, if I have 3 Fission Batteries (defined by FusionBats), whenever I use the code FusionBats it will represent the 3 Fission Batteries I have? So what is "short areyousneaking" for then? And what about short count, short gonuka, and short button? Link to comment Share on other sites More sharing options...
Hmazter Posted December 17, 2008 Share Posted December 17, 2008 yeah, but it will not represent the specific fission batteries only the value "3" is stored. in Short areyousneaking its probably stored 1 if you are sneaking and 0 if you are not sneaking to keep track of the players sneak status. Short can only store numerical values. Link to comment Share on other sites More sharing options...
thewaronandrew Posted December 17, 2008 Author Share Posted December 17, 2008 I get what you are saying, but I don't fully understand how to use it. I will have to play around with it some more. Link to comment Share on other sites More sharing options...
Hmazter Posted December 17, 2008 Share Posted December 17, 2008 okay the name you put after the short statement for example FusionBats will contain a numerical value that you can store for later use for example check if the player has enough batteries to finish a quest or something like that.You can also use it for storing a 1 if the player has spoken to a certain person or done a certain thing and that changes the outcome of a talk with a NPC. Link to comment Share on other sites More sharing options...
thewaronandrew Posted December 17, 2008 Author Share Posted December 17, 2008 I am still trying to figure out gonuka in the nuka cola vending machine script. It never defines what gonuka is. All it does is set gonuka to 1, 2, or 0. What is being set to 1, 2, or 0? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.