Scripting assistance Request

Post » Sun Dec 19, 2010 9:00 pm

I'm designing a couple of items for a mod, but i have almost no scripting skill with the GECK.

The first item is based around an alien padd device, and will break down items into goo. The second, also based around an alien padd device, will use said goo to make alien ammo, weapons and items. However, i have been unable to get the scripts i've tried to create to work with them.

The scripts i want help with are as follows:

Script A - Desessembler - The disassembler is used from the inventory, and brings up a list showing 'junk' items in inventory that can be 'gooed' (much like the rock-it launcher shows available ammo from the inventory when empty and the player reloads it.) However, some items have different values of goo, ranging between 1 (for mugs, glasses and the like) upto 4 goo (for camaras and leaf blowers.) i know its something like "on selection if item 'a' is present, remove item 'a', add item to inventory 'goo' x whatever number, desplay message, end" but i havent been able to get this to work at all.

Script B - Assembler - The assembler is selected from the inventory, and brings up a menu of items to create (alien ammo, crystals, guns, that sort of thing.) If the player has enough 'goo' it removes the prerequisite amount and adds the item, if they don't it displays a message stating that they don't have enough (sort of "on selection, if player has x number of goo, add item to inventory, otherwise display message, end.) again, i can't get the script to work. (yes, i svck.)

I hope someone can help me, as the items are planned to be major reward items for my mod, and as a result are kinda important to it.
User avatar
Rudi Carter
 
Posts: 3365
Joined: Fri Sep 01, 2006 11:09 pm

Post » Mon Dec 20, 2010 6:04 am

Posta da scriptsa. Letsa seea whata youa hava so fara..
User avatar
Peter lopez
 
Posts: 3383
Joined: Mon Sep 10, 2007 5:55 pm

Post » Mon Dec 20, 2010 5:27 am

The easiest way to do this would work something like this:
  • Player places items in disassembler
  • Player somehow triggers disassembler, causing certain items to be replaced with goo
  • Player removes items from disassembler
  • Player places goo in assembler
  • Player somehow triggers assembler, causing goo to be replaced with whatever the player selects
  • Player removes items from assembler

In order to make this completely general, you'd want to use FOSE's form list handling and looping functions, but unless you're already using FOSE it's be more sensible to use the non-FOSE approach.



The non-FOSE approach would work like this:
  • When the disassembler is triggered, the script checks how many of each type of item is present and replaces it with the equivalent amount of goo, using http://geck.gamesas.com/index.php/GetItemCount, http://geck.gamesas.com/index.php/RemoveItem and http://geck.gamesas.com/index.php/AddItem. Items that won't be converted into goo are ignored.
  • When the assembler is triggered, a menu is shown to allow the player to select a type of item to create, using http://geck.gamesas.com/index.php/ShowMessage and http://geck.gamesas.com/index.php/GetButtonPressed. Once this has been selected, the same functions that were used previously will be used to remove goo and replace it with the selected item.



The FOSE approach would be more difficult to script, but would make the system easier to extend. I'd recommend using two tiers of form lists - one to store items that correspond with certain amounts of goo, and another "master list" to store the lists of items. For example:
  • Master list
    • Items that convert to 1 goo
      • Coffee mug etc.

    • Items that convert to 2 goo
    • Items that convert to 3 goo
    • Items that convert to 4 goo
      • Camera
      • Leaf blower

When the disassembler is triggered, the script would walk through the master list, picking up and walking through each sub-list and replacing all items contained in it with the appropriate amount of goo. The functions required for this would be http://fose.silverlock.org/fose_command_doc.html#Label and http://fose.silverlock.org/fose_command_doc.html#Goto for looping, and http://fose.silverlock.org/fose_command_doc.html#ListGetCount and http://fose.silverlock.org/fose_command_doc.html#ListGetNthForm for getting information on form lists.

The assembler could work in the same way as in the non-FOSE method.

The advantage of this method is that you can easily add items by manipulating form lists without having to edit the script(s). This also allows other mods to extend your system without destroying compatibility. The potential disadvantage is, of course, that it requires FOSE.

Cipscis
User avatar
Nikki Morse
 
Posts: 3494
Joined: Fri Aug 25, 2006 12:08 pm

Post » Sun Dec 19, 2010 10:48 pm

Well, let me put up what i've got so far.

To be honest, i'm having to work out of notebooks while my comp is upgreaded to windows 7 after crashing YET again. :banghead: unfortunately, what i had for script A is nowhere to be found, thus it has to be redone. For script B (the assembler) i have this long-winded thing:


Scriptname STL_XenoItemMaker

Short CraftItem
Short Button

Begin OnActivate

If OnActivate == 1
If CraftItem == 0
Messagebox "Nano-Constructor interface online. Please select item to synthesis." "Alien Ammo Cells" "Alien Power Modules" "Alien Apoxy" "Atomiser Pistol" "Enhanced Alien Apoxy" "Firelance" "Alien Energy Weapon" "Disruptor Rifle" "Drone Cannon"
Set Craftitem to 1
Endif
Endif

If craftItem == 1
Set Button to GetButtonPressed
If Button == 1
If PlayerItemCount "STL_NGoo" => 2
Player RemoveItem "STLGoo" "2"
PlayerAddItem "!" {! = GECK code for Alien Power Cell}
MessageBox "Alien Power Cell has been created."
Set CraftItem to 0
Return
Elseif
If PlayerItemCount "STL_NGoo" < 2
Messagebox "Insufficient NanoGoo."
Set CraftItem to 0
Return
Endif
Elseif
If Button == 2
If PlayerItemCount "STL_NGoo" => 2
Player RemoveItem "STLGoo" "2"
PlayerAddItem "?" {? = GECK code for Alien Power Module}
MessageBox "Alien Power Module has been created."
Set CraftItem to 0
Return
Elseif
If PlayerItemCount "STL_NGoo" < 2
Messagebox "Insufficient NanoGoo."
Set CraftItem to 0
Return
Endif
Elseif
If Button == 3
If PlayerItemCount "STL_NGoo" => 5
Player RemoveItem "STLGoo" "5"
PlayerAddItem "$" { $ = GECK code for Alien Apoxy}
MessageBox "Alien Apoxy has been created."
Set CraftItem to 0
Return
Elseif
If PlayerItemCount "STL_NGoo" < 5
Messagebox "Insufficient NanoGoo."
Set CraftItem to 0
Return
Endif
Elseif
If Button == 4
If PlayerItemCount "STL_NGoo" => 10
Player RemoveItem "STLGoo" "10"
PlayerAddItem "%" {% = GECK code for Alien Atomiser}
MessageBox "Alien Atomiser has been created."
Set CraftItem to 0
Return
Elseif
If PlayerItemCount "STL_NGoo" < 10
Messagebox "Insufficient NanoGoo."
Set CraftItem to 0
Return
Endif
Elseif
If Button == 5
If PlayerItemCount "STL_NGoo" => 10
Player RemoveItem "STLGoo" "10"
PlayerAddItem "&" {& = GECK code for Enhanced Alien Apoxy}
MessageBox "Enhanced Apoxy has been created."
Set CraftItem to 0
Return
Elseif
If PlayerItemCount "STL_NGoo" < 10
Messagebox "Insufficient NanoGoo."
Set CraftItem to 0
Return
Endif
Elseif
If Button == 6
If PlayerItemCount "STL_NGoo" => 15
Player RemoveItem "STLGoo" "15"
PlayerAddItem "*" {* = GECK code for FireLance}
MessageBox "Firelance has been created."
Set CraftItem to 0
Return
Elseif
If PlayerItemCount "STL_NGoo" < 15
Messagebox "Insufficient NanoGoo."
Set CraftItem to 0
Return
Endif
Elseif
If Button == 7
If PlayerItemCount "STL_NGoo" => 15
Player RemoveItem "STLGoo" "15"
PlayerAddItem "+" {+ = GECK code for Alien Energy Weapon}
MessageBox "Alien Energy Weapon has been created."
Set CraftItem to 0
Return
Elseif
If PlayerItemCount "STL_NGoo" < 15
Messagebox "Insufficient NanoGoo."
Set CraftItem to 0
Return
Endif
Elseif
If Button == 8
If PlayerItemCount "STL_NGoo" => 20
Player RemoveItem "STLGoo" "20"
PlayerAddItem "@" {@ = GECK code for Disruptor Rifle}
MessageBox "Disruptor Rifle has been created."
Set CraftItem to 0
Return
Elseif
If PlayerItemCount "STL_NGoo" < 20
Messagebox "Insufficient NanoGoo."
Set CraftItem to 0
Return
Endif
Elseif
If Button == 9
If PlayerItemCount "STL_NGoo" => 30
Player RemoveItem "STLGoo" "30"
PlayerAddItem "#" {# = GECK code for Drone Cannon}
MessageBox "Drone Cannon has been created."
Set CraftItem to 0
Return
Elseif
If PlayerItemCount "STL_NGoo" < 30
Messagebox "Insufficient NanoGoo."
Set CraftItem to 0
Return
Endif
Endif
Endif


It should work, but doesn't and i'm pretty sure some of it is in the wrong terms. the beginning (OnActivate) i know starts it in gamespace, instead of the player selecting it from their inventory and activating there.
User avatar
Harry Leon
 
Posts: 3381
Joined: Tue Jun 12, 2007 3:53 am

Post » Sun Dec 19, 2010 10:08 pm

Messagebox “Nano-Constructor interface online. Please select item to synthesis.” “Alien Ammo Cells” “Alien Power Modules” “Alien Apoxy” “Atomiser Pistol” “Enhanced Alien Apoxy” “Firelance” “Alien Energy Weapon” “Disruptor Rifle” “Drone Cannon”

This need to look like:

ShowMessage [SomeMessageName]

Where SomeMessageName is a Geck Message object with all of your options listed as seperate entries that corespond to the button pressed. Note that the if the first entry is selected in a message, it will return 0, not 1.
If craftItem == 1
Set Button to GetButtonPressed

Everthing after this little bit need to be moved into a GameMode Block ("Begin GameMode")
If PlayerItemCount “STL_NGoo” => 2

Things like this line should be:

If Player.GetItemCount [Geck object name] >= 2
Player RemoveItem “STLGoo” “2”

Should be:

Player.RemoveItem [Geck Object Name] 2
PlayerAddItem “!” {! = GECK code for Alien Power Cell}

Should be:

Player.AddItem [Geck Object Name] [Amount, in this case Amount is 1] like:
Player.AddItem Stimpak 1
Elseif
If PlayerItemCount “STL_NGoo” < 2

Should be:
ElseIf Player.GetItemCount [object] < 2

If Button == 2
If PlayerItemCount “STL_NGoo” => 2
Player RemoveItem “STLGoo” “2”
PlayerAddItem “£” {£ = GECK code for Alien Power Module}
MessageBox “Alien Power Module has been created.”
Set CraftItem to 0
Return
Elseif
If PlayerItemCount “STL_NGoo” < 2
Messagebox “Insufficient NanoGoo.”
Set CraftItem to 0
Return
Endif

This whole section should look like this:

ElseIf Button == 2  If Player.GetItemCount STL_NGoo < 2    Player.RemoveItem STL_NGoo 2    Player.AddItem AlienPowerModule  1 ;or whatever its called, note that anything after a coma is a comment      ShowMessage [SucessMessage]    Set CraftItem to 0    Return  Else    ShowMessage [FailMessage]    Set CraftItem to 0    Return  EndIf

But you don't really need the return statements there.
User avatar
Milagros Osorio
 
Posts: 3426
Joined: Fri Aug 25, 2006 4:33 pm

Post » Mon Dec 20, 2010 7:07 am

I can't believe i made such a mutant mole rats behind of the whole thing. :blush:

Well, gonna re-write the thing and make the modifications, then i'll repost it here.
User avatar
Georgine Lee
 
Posts: 3353
Joined: Wed Oct 04, 2006 11:50 am

Post » Mon Dec 20, 2010 4:21 am

Okay, this is how the script in my notes looks now:


Revised Script B

Scriptname STL_XenoItemMaker

Short CraftItem
Short Button

Begin OnActivate

If OnActivate == 1
If CraftItem == 0
ShowMessage STLAssemblerMenu
Set Craftitem to 1
Endif
Endif

;Message STLAssemblerMenu ; STLAssemblerMenu will be - "Nano-Constructor interface online. Please select item to synthesis." "Alien Ammo Cells" "Alien Power Modules" "Alien Apoxy" "Atomiser Pistol" "Enhanced Alien Apoxy" "Firelance" "Alien Energy Weapon" "Disruptor Rifle" "Drone Cannon" (note ? message is to be GECK Message Object with options listed as separate entries corresponding to the button pressed)

If craftItem == 1
Set Button to GetButtonPressed
Begin GameMode

If Button == 0
If Player.ItemCount STL_NGoo >= 2
Player.RemoveItem STL_NGoo 2
Player.AddItem ! 1 ;! = GECK code for Alien Power Cell}
ShowMessage Alien Power Cell has been created.
Set CraftItem to 0
Elseif PlayerItemCount STL_NGoo < 2
ShowMessage Insufficient NanoGoo.
Set CraftItem to 0
Endif
Elseif
If Button == 1
If Player.ItemCount STL_NGoo >= 2
Player.RemoveItem STL_NGoo 2
Player.AddItem ? 1 ;? = GECK code for Alien Power Module
ShowMessage Alien Power Module has been created.
Set CraftItem to 0
Elseif PlayerItemCount STL_NGoo < 2
ShowMessage Insufficient NanoGoo.
Set CraftItem to 0
Endif
Elseif
If Button == 2
If Player.ItemCount STL_NGoo >= 5
Player.RemoveItem STL_NGoo 5
Player.AddItem $ 1 ; $ = GECK code for Alien Aploxy
ShowMessage Alien Apoxy has been created.
Set CraftItem to 0
Elseif PlayerItemCount STL_NGoo < 5
ShowMessage Insufficient NanoGoo.
Set CraftItem to 0
Endif
Elseif
If Button == 3
If Player.ItemCount STL_NGoo >= 10
Player.RemoveItem STL_NGoo 10
Player.AddItem % 1 ;% = GECK code for Alien Atomiser
ShowMessage Alien Atomiser has been created.
Set CraftItem to 0
Elseif PlayerItemCount STL_NGoo < 10
ShowMessage Insufficient NanoGoo.
Set CraftItem to 0
Endif
Elseif
If Button == 4
If Player.ItemCount STL_NGoo >= 10
Player.RemoveItem STL_NGoo 10
Player.AddItem & 1 ;& = GECK code for Enhanced Alien Apoxy
ShowMessage Alien Apoxy (Enhanced) has been created.
Set CraftItem to 0
Elseif PlayerItemCount STL_NGoo < 10
ShowMessage Insufficient NanoGoo.
Set CraftItem to 0
Endif
Elseif
If Button == 5
If Player.ItemCount STL_NGoo >= 15
Player.RemoveItem STL_NGoo 15
Player.AddItem * 1 ;* = GECK code for Firelance
ShowMessage Firelance has been created.
Set CraftItem to 0
Elseif PlayerItemCount STL_NGoo < 15
ShowMessage Insufficient NanoGoo.
Set CraftItem to 0
Endif
Elseif
If Button == 6
If Player.ItemCount STL_NGoo >= 15
Player.RemoveItem STL_NGoo 15
Player.AddItem + 1 ;+ = GECK code for Alien Energy Weapon
ShowMessage Alien Energy Weapon has been created.
Set CraftItem to 0
Elseif PlayerItemCount STL_NGoo < 15
ShowMessage Insufficient NanoGoo.
Set CraftItem to 0
Endif
Elseif
If Button == 7
If Player.ItemCount STL_NGoo >= 20
Player.RemoveItem STL_NGoo 20
Player.AddItem @ 1 ;@ = GECK code for Disruptor rifle
ShowMessage Disruptor Rifle has been created.
Set CraftItem to 0
Elseif PlayerItemCount STL_NGoo < 20
ShowMessage Insufficient NanoGoo.
Set CraftItem to 0
Endif
Elseif
If Button == 8
If Player.ItemCount STL_NGoo >= 30
Player.RemoveItem STL_NGoo 30
Player.AddItem # 1 ;# = GECK code for Drone Cannon
ShowMessage Alien Power Cell has been created.
Set CraftItem to 0
Elseif PlayerItemCount STL_NGoo < 30
ShowMessage Insufficient NanoGoo.
Set CraftItem to 0
Endif
Endif
Endif


So, have I made any more basic mistakes so far that make me look dumb? :lol:
Anyway, this script still needs to be tweaked a little, I know, as the actual Assembler Pad is supposed to work from the inventory, and be carryable by the player.

I know this means changing the 'OnActivate' commands, but I don't know to what, or even if this can be done this way. (I hope it can be, as that's pretty much what I had in mind for this item.)




if it can't be done then it needs something like this, right?


Add to Short list "OnGround" and "Button2"

Change the beginning to this -

If OnActivate = = 1
If OnGround == 0
ShowMessage STL_CarryOrNot ; GECK Message setup with options "Use assembler" and "Pick Up Assember"
Set Button2 to GetButtonPressed
Begin GameMode
If Button2 == 0
Set CraftItem to 1
endif
elseif Button2 == 1
Player.AddItem STL_Assem1 ; code I'm gonna use for the assembler pack item
RemoveItem STL_AssemStatic ; code for the version of the Alien pad static that I'll create to be this 'inworld.' {Pretty sure this command is wrong}
Set OnGround to 1
Endif
Endif
endif

This would then be accompanied by a section telling it to set Onground to 0 again if dropped from the inventory, but I don't know what that is (hey, I'm working from notebooks and a laptop that can't run Fallout 3 here until my :swear: computer is working again (turns out all the problems I've had previously while trying to work on my mod are due to a fubar BIOS, which has now managed to Kill my motherboard, so it'll be a while.)) :cry:
User avatar
Manuel rivera
 
Posts: 3395
Joined: Mon Sep 10, 2007 4:12 pm

Post » Sun Dec 19, 2010 5:28 pm

A couple of things...

This

If craftItem == 1
Set Button to GetButtonPressed
Begin GameMode


Should be this:

Begin GameMode
If craftItem == 1
Set Button to GetButtonPressed


I know its my fault because I told you everything after the first two lines needs to go into a GameMode block, but I meant inclusively.


Second, take your script, and copy to the clipboard, then go http://www.cipscis.com/fallout/utilities/validator.aspx (bookmark it). Paste your script into the validator and hit the 'Validate' button. This will align and test your code. Then cut and paste it into a post, then highlight the whole thing and click on the 'Insert Code Snipet' Button on the tool bar. It looks like this < >. That will make it ever so much easier to read and you will get this as a response:

Missing End statement in block 1
Condition required for "elseif" statement on line 30
Condition required for "elseif" statement on line 41
Condition required for "elseif" statement on line 52
Condition required for "elseif" statement on line 63
Condition required for "elseif" statement on line 74
Condition required for "elseif" statement on line 85
Condition required for "elseif" statement on line 96
Condition required for "elseif" statement on line 107
Too many nested "if" conditions on line 109
Missing End statement in block 2
8 missing "endif" statements in block 2

Fix those and repost :)
User avatar
Jade Muggeridge
 
Posts: 3439
Joined: Mon Nov 20, 2006 6:51 pm

Post » Mon Dec 20, 2010 3:08 am

Well, i did what you said to do, but i think your gonna laugh - after fixing the elseif cockup is revealed, it still says 'missing end statement in block 1' and the same for block 2.

i guess my lack of experiance in scripting is telling, as its bad enough i made such a base mistake - especially after the example section i was already given - but worse, maybe i'm looking at it wrong but can't see what this refers to - yes, i know its stupid, but i really can't see what it means. I know it not refering to line 1 or 2, but as to what it is... :blush:
User avatar
Benito Martinez
 
Posts: 3470
Joined: Thu Aug 30, 2007 6:33 am

Post » Mon Dec 20, 2010 3:37 am

Well, just repost what you have with indents so its easier to locate what's missing and I'll take a look. Or just post whatever you have without indents, and I'll indent it myself.
User avatar
Prohibited
 
Posts: 3293
Joined: Tue Jun 12, 2007 6:13 am

Post » Mon Dec 20, 2010 6:58 am

Well, i did what you said to do, but i think your gonna laugh - after fixing the elseif cockup is revealed, it still says 'missing end statement in block 1' and the same for block 2.

i guess my lack of experiance in scripting is telling, as its bad enough i made such a base mistake - especially after the example section i was already given - but worse, maybe i'm looking at it wrong but can't see what this refers to - yes, i know its stupid, but i really can't see what it means. I know it not refering to line 1 or 2, but as to what it is... :blush:



Don't feel bad, everyone starts at the beginning. I'm barely past where you are now, but I do think I know what the message means that you are getting from the validator because I've gotten it as well :) I also just copy/pasted a bit of scripting into the validator without its END on purpose to see if I'd get the same message and I did. So I think that's what you need to fix. Your blocks need an End. They should look like this.

Begin Type of Block

scripting goes here

End


You just need to add the End. Also at that link pkleiss gave you are Cipscis' fabulous tutorals. I highly recommend the Beginning Tutorial on Scripting in FO3 which covers basics like this. There's also a very good menu tutorial as well.
User avatar
Robert Jr
 
Posts: 3447
Joined: Fri Nov 23, 2007 7:49 pm

Post » Mon Dec 20, 2010 12:08 am

Okay, i think i got it - at least, the util says theres no errors now

Scriptname STL_XenoItemMakerShort CraftItemShort ButtonBegin OnActivate	If OnActivate == 1		If CraftItem == 0			ShowMessage STLAssemblerMenu			Set Craftitem to 1		Endif	EndifEnd;Message STLAssemblerMenu ; STLAssemblerMenu will be - "Nano-Constructor interface online. Please select item to synthesis." "Alien Ammo Cells" "Alien Power Modules" "Alien Apoxy" "Atomiser Pistol" "Enhanced Alien Apoxy" "Firelance" "Alien Energy Weapon" "Disruptor Rifle" "Drone Cannon" (note ? message is to be GECK Message Object with options listed as separate entries corresponding to the button pressed)Begin GameMode	If craftItem == 1		Set Button to GetButtonPressed		If Button == 0			If Player.ItemCount STL_NGoo >= 2				Player.RemoveItem STL_NGoo 2				Player.AddItem ! 1 ;! = GECK code for Alien Power Cell}				ShowMessage Alien Power Cell has been created.				Set CraftItem to 0			Elseif PlayerItemCount STL_NGoo < 2				ShowMessage Insufficient NanoGoo.				Set CraftItem to 0			Endif		Elseif Button == 1			If Player.ItemCount STL_NGoo >= 2				Player.RemoveItem STL_NGoo 2				Player.AddItem ? 1 ;? = GECK code for Alien Power Module				ShowMessage Alien Power Module has been created.				Set CraftItem to 0			Elseif PlayerItemCount STL_NGoo < 2				ShowMessage Insufficient NanoGoo.				Set CraftItem to 0			Endif		Elseif Button == 2			If Player.ItemCount STL_NGoo >= 5				Player.RemoveItem STL_NGoo 5				Player.AddItem $ 1 ; $ = GECK code for Alien Aploxy				ShowMessage Alien Apoxy has been created.				Set CraftItem to 0			Elseif PlayerItemCount STL_NGoo < 5				ShowMessage Insufficient NanoGoo.				Set CraftItem to 0			Endif		Elseif Button == 3			If Player.ItemCount STL_NGoo >= 10				Player.RemoveItem STL_NGoo 10				Player.AddItem % 1 ;% = GECK code for Alien Atomiser				ShowMessage Alien Atomiser has been created.				Set CraftItem to 0			Elseif PlayerItemCount STL_NGoo < 10				ShowMessage Insufficient NanoGoo.				Set CraftItem to 0			Endif		Elseif Button == 4			If Player.ItemCount STL_NGoo >= 10				Player.RemoveItem STL_NGoo 10				Player.AddItem & 1 ;& = GECK code for Enhanced Alien Apoxy				ShowMessage Alien Apoxy (Enhanced) has been created.				Set CraftItem to 0			Elseif PlayerItemCount STL_NGoo < 10				ShowMessage Insufficient NanoGoo.				Set CraftItem to 0			Endif		Elseif Button == 5			If Player.ItemCount STL_NGoo >= 15				Player.RemoveItem STL_NGoo 15				Player.AddItem * 1 ;* = GECK code for Firelance				ShowMessage Firelance has been created.				Set CraftItem to 0			Elseif PlayerItemCount STL_NGoo < 15				ShowMessage Insufficient NanoGoo.				Set CraftItem to 0			Endif		Elseif Button == 6			If Player.ItemCount STL_NGoo >= 15				Player.RemoveItem STL_NGoo 15				Player.AddItem + 1 ;+ = GECK code for Alien Energy Weapon				ShowMessage Alien Energy Weapon has been created.				Set CraftItem to 0			Elseif PlayerItemCount STL_NGoo < 15				ShowMessage Insufficient NanoGoo.				Set CraftItem to 0			Endif		Elseif Button == 7			If Player.ItemCount STL_NGoo >= 20				Player.RemoveItem STL_NGoo 20				Player.AddItem @ 1 ;@ = GECK code for Disruptor rifle				ShowMessage Disruptor Rifle has been created.				Set CraftItem to 0			Elseif PlayerItemCount STL_NGoo < 20				ShowMessage Insufficient NanoGoo.				Set CraftItem to 0			Endif		Elseif Button == 8			If Player.ItemCount STL_NGoo >= 30				Player.RemoveItem STL_NGoo 30				Player.AddItem # 1 ;# = GECK code for Drone Cannon				ShowMessage Alien Power Cell has been created.				Set CraftItem to 0			Elseif PlayerItemCount STL_NGoo < 30				ShowMessage Insufficient NanoGoo.				Set CraftItem to 0			Endif		Endif	EndifEnd



Now all that nees answering is one question, and this script (and by extention the Alien Assembler) is complete - How do i change the start so that it can be activated from the PitBoy Inventory, instead of in gamespace itself? I know i gotta change the "OnActivate" command at the start, but to what?
User avatar
Scotties Hottie
 
Posts: 3406
Joined: Thu Jun 08, 2006 1:40 am

Post » Sun Dec 19, 2010 7:04 pm

Nice looking post there js. I don't know how you would activate your script from the pipboy unless the object the scritp was running on was equipable - like a weapon or an armor. If it were an equipable objcect, you could change the OnActivate block to an OnEquip Block. But if your object is a misc Item, then either you'd have to assign a hot key or revamp the UI to add an extra functions - and I dion't know how to do that.

I do have a suggection though. For each of your buttons you have a bit of code that looks like this:

Elseif Button == 1			If Player.ItemCount STL_NGoo >= 2				Player.RemoveItem STL_NGoo 2				Player.AddItem ? 1 ;? = GECK code for Alien Power Module				ShowMessage Alien Power Module has been created.				Set CraftItem to 0			Elseif PlayerItemCount STL_NGoo < 2				ShowMessage Insufficient NanoGoo.				Set CraftItem to 0			Endif


If you added conditions to the entries in the STLAssemblerMenu such that each entry would only be displayed if the player had the required amount of goo, then each button section could be done like this:

		Elseif Button == 1				Player.RemoveItem STL_NGoo 2				Player.AddItem ? 1 ;? = GECK code for Alien Power Module				ShowMessage Alien Power Module has been created.				Set CraftItem to 0

Basically, you would be moving the "If Player.ItemCount STL_NGoo >= 2" to the message as a condition and cutting out the whole "ShowMessage Insufficient NanoGoo." sections. That way only the options that the player had enough goo for would show up in the original selection message. The condition wouldn't be an IF statement though. It would look like this:

GetItemCount [ItemID] >= [some value] and you set the 'Run On' to 'Reference' and select the player as the reference.
User avatar
FLYBOYLEAK
 
Posts: 3440
Joined: Tue Oct 30, 2007 6:41 am

Post » Sun Dec 19, 2010 7:27 pm

I've been thinking and i think i have a solution - Maybe - to what i want.

the section that looks like this

Short CraftItem Short ButtonBegin OnActivateIf OnActivate == 1  If CraftItem == 0    ShowMessage STLAssemblerMenu    Set Craftitem to 1  EndifEndifEnd



is changed to:

Short OnGroundShort CraftItemShort ButtonShort Button2Begin GamemodeIf player.GetItemCount "STL_AliAssDev" < 1  Set OnGround to 0EndifEndIf OnActivate == 1  If OnGround == 1    ShowMessage STL_AssemSetting    SetButton2 to GetButtonPressed    If Button2 == 0      {Missinglines here!!!! Need scriptline to have player pickup Assenbler pad item into inventory.}      Set OnGround to 0    endif      ElseIf Button2 == 1          If CraftItem == 0          ShowMessage STLAssemblerMenu          Set Craftitem to 1        Endif      Endif    Endif  EndifEndif


basically, this is to have it so that the player can select the pad on the ground, and either pick up the pad to carry it around with them, or create an item. (it's not my idea, i got it from the morrowind chalk mod.) It isn't finished - i'm not sure what the script commands are to have the player pickup the pad from the ground (is it simply a case of picking it up like normal, or will i need to add an item to the inventory while removing a static from the ingame enviroment?)
User avatar
emily grieve
 
Posts: 3408
Joined: Thu Jun 22, 2006 11:55 pm

Post » Sun Dec 19, 2010 8:36 pm

As for the idea of having only the options that the player has enough goo for.. i've had time to think about it, and i think i will do as was suggested, and add that - it would certainly make things easier for the player. Do you think i should also add options to make alien shock rods and both types of crystals as well? also, should i make it so that crystals can be made into nanogoo - something like 'the crystals are made from 25 goo for small ones, and 50 goo for big, and can be broke down into the same amount as sell - in essence they're a storage medium the aliens use for nanogoo, so that it takes up less space. A good idea, or not?
User avatar
ILy- Forver
 
Posts: 3459
Joined: Sun Feb 04, 2007 3:18 am


Return to Fallout 3