Jump to content

Anyone know of a GECK script command that can do this?


tnade711

Recommended Posts

I've started scripting in the geck and I'm wondering. For the basic mod I'm planning to script I want to know if there is a command where if I select the specific item in my inventory it will bring up a small menu of options. Does anyone know of a command that could do this? I also need to know a command in geck that would let me change an npcs gender, if I select an npc to bring up a menu while they are say sleeping and I have a certain weapon equipped, and a command that makes something happen if I choose a specific dialogue option.

Edited by tnade711
Link to comment
Share on other sites

Adding GUI is a little bit different, you'd probably be better off looking for a tutorial on that as isn't going to be easy for anyone to explain over the forums. As for commands to change an NPC's gender, just give the npc you want to change a reference (double-click them and name them something like NPCREF, it doesn't matter as long as you remember it, and it's unique). In the script, just type the reference and add .sexchange. For example:

 

NPCREF.sexchange

Link to comment
Share on other sites

This can be done using special "token" items - usually armour-type items that use no biped slots, have no world model and can't be dropped. When equipped by the player, a multi-selection menu is displayed. This is all done with a script.


The following is a skeleton script you can use. You just need to fill out the rest, depending on what you want to do. You then create the token item and attach the script to it.


Note:

- A menu can have between one to ten options, indexed 0-9.

- Replace MenuTitle, Option0Text, Option1Text, etc. (line #12) with the actual text labels of each option (leave the | s in place).

- MessageBoxEx is an NVSE command. If you've never worked with NVSE before in the GECK, then first check this page, where it is explained what you need to do (2nd paragraph under 'Installation').




scn TokenLoadMenuScript

ref rToken
short bMenuUp
short iOption

begin OnEquip player

set rToken to GetBaseObject
player.UnequipItem rToken
if MenuMode 1002
MessageBoxEx "MenuTitle|Option0Text|Option1Text|Option2Text|Option3Text|Option4Text|Option5Text|Option6Text|Option7Text|Option8Text|Option9Text"
set bMenuUp to 1
endif

end

begin MenuMode

if bMenuUp
set iOption to GetButtonPressed
if iOption >= 0
set bMenuUp to 0
if iOption == 0
; Do stuff.
elseif iOption == 1
; Do stuff.
elseif iOption == 2
; Do stuff.
elseif iOption == 3
; Do stuff.
elseif iOption == 4
; Do stuff.
elseif iOption == 5
; Do stuff.
elseif iOption == 6
; Do stuff.
elseif iOption == 7
; Do stuff.
elseif iOption == 8
; Do stuff.
else
; Do stuff.
endif
endif
endif

end

Link to comment
Share on other sites

Adding GUI is a little bit different, you'd probably be better off looking for a tutorial on that as isn't going to be easy for anyone to explain over the forums. As for commands to change an NPC's gender, just give the npc you want to change a reference (double-click them and name them something like NPCREF, it doesn't matter as long as you remember it, and it's unique). In the script, just type the reference and add .sexchange. For example:

 

NPCREF.sexchange

in the geck not console. Also I want it to be able to change the gender of any npc after you select the option (its for a mad scientist mod im making)

Link to comment
Share on other sites

 

Adding GUI is a little bit different, you'd probably be better off looking for a tutorial on that as isn't going to be easy for anyone to explain over the forums. As for commands to change an NPC's gender, just give the npc you want to change a reference (double-click them and name them something like NPCREF, it doesn't matter as long as you remember it, and it's unique). In the script, just type the reference and add .sexchange. For example:

 

NPCREF.sexchange

in the geck not console. Also I want it to be able to change the gender of any npc after you select the option (its for a mad scientist mod im making)

 

That is how you'd do it in the GECK- you can use console commands in your scripts. For example, you could assign this to a line of dialogue, or even to a terminal- in the script box, just reference your NPC and add the ".sexchange" suffix. If you want it to be able to change the gender of any NPC, you'd have to use dynamic referencing (at least you would in game development for similar issues, I've never thought about doing this sort of thing in the GECK, or if it would even be supported). If you want it to be able to change the sex of the player, then that's easy, just use the player as the reference. Or, if you read what jazzisparis posted above, then you could assign a sexchange option to different options in the menu (such as selecting a few NPCs that you want to be able to change the sex of and simply selecting their name from the list).

Link to comment
Share on other sites

 

This can be done using special "token" items - usually armour-type items that use no biped slots, have no world model and can't be dropped. When equipped by the player, a multi-selection menu is displayed. This is all done with a script.
The following is a skeleton script you can use. You just need to fill out the rest, depending on what you want to do. You then create the token item and attach the script to it.
Note:
- A menu can have between one to ten options, indexed 0-9.
- Replace MenuTitle, Option0Text, Option1Text, etc. (line #12) with the actual text labels of each option (leave the | s in place).
- MessageBoxEx is an NVSE command. If you've never worked with NVSE before in the GECK, then first check this page, where it is explained what you need to do (2nd paragraph under 'Installation').
scn	TokenLoadMenuScript

ref		rToken
short	bMenuUp
short	iOption

begin OnEquip player

	set rToken to GetBaseObject
	player.UnequipItem rToken
	if MenuMode 1002
		MessageBoxEx "MenuTitle|Option0Text|Option1Text|Option2Text|Option3Text|Option4Text|Option5Text|Option6Text|Option7Text|Option8Text|Option9Text"
		set bMenuUp to 1
	endif

end

begin MenuMode

	if bMenuUp
		set iOption to GetButtonPressed
		if iOption >= 0
			set bMenuUp to 0
			if iOption == 0
				; Do stuff.
			elseif iOption == 1
				; Do stuff.
			elseif iOption == 2
				; Do stuff.
			elseif iOption == 3
				; Do stuff.
			elseif iOption == 4
				; Do stuff.
			elseif iOption == 5
				; Do stuff.
			elseif iOption == 6
				; Do stuff.
			elseif iOption == 7
				; Do stuff.
			elseif iOption == 8
				; Do stuff.
			else
				; Do stuff.
			endif
		endif
	endif

end

 

Where can i find commands like this? I certainly haven't found any of these token commands or the bmenu and ioption commands on the functions list for nvse or the GECK itself. Also could you recommend a good geck scripting tutorial that isn't on the geck site as those aren't very good.

Link to comment
Share on other sites

 

Where can i find commands like this? I certainly haven't found any of these token commands or the bmenu and ioption commands on the functions list for nvse or the GECK itself. Also could you recommend a good geck scripting tutorial that isn't on the geck site as those aren't very good.
rToken, bMenuUp, iOption are local variables I declared and named in the script - they are not commands.
The GECK site actually has some petty decent scripting tutorials for beginners. You may also want to check scripting tutorials available from the Oblivion's CS wiki, as both games use the same scripting language.
Link to comment
Share on other sites

 

 

Where can i find commands like this? I certainly haven't found any of these token commands or the bmenu and ioption commands on the functions list for nvse or the GECK itself. Also could you recommend a good geck scripting tutorial that isn't on the geck site as those aren't very good.
rToken, bMenuUp, iOption are local variables I declared and named in the script - they are not commands.
The GECK site actually has some petty decent scripting tutorials for beginners. You may also want to check scripting tutorials available from the Oblivion's CS wiki, as both games use the same scripting language.

Sorry fro asking but would you mind explaining variables to me as fallout geck site doesn't explain it well enough for a drop dead beginner like me. Sorry :9

Link to comment
Share on other sites

 

Sorry fro asking but would you mind explaining variables to me as fallout geck site doesn't explain it well enough for a drop dead beginner like me. Sorry :9

 

 

There seem to be some good intro tutorials for writing scripts for the game at this site: http://www.cipscis.com/fallout/tutorials/

 

Theres also a script checker on his site too that can point out any problems in scripts, but I don't think its 100% foolproof.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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