Jump to content

Quick Question - Quick Answer


Cipscis

Recommended Posts

@Warll:

I'm not sure I entirely understand the circumstances in which you were experiencing that issue, but I'm glad to hear that you got it sorted. I would recommend that you do some research on ImageSpace Modifiers for the purpose of fading in and out, but I notice that you've already found the ImageSpace Modifiers page on the GECK Wiki. Good luck with the rest of your project!

 

Cipscis

 

Yeah silly thing that imod, :wallbash: . What I ended up using for that was calling the fadefromwhite sfx before the move command so it should white out the screen before the player magically appears in the middle of the room. What I had been doing as using a trigger, a text box with yes or no, and a moveto command to the bed's reference. As I said the bed was not acting "normal", if you have heard of this then great otherwise I hope you won't feel compelled to spend time on this.

Link to comment
Share on other sites

  • Replies 804
  • Created
  • Last Reply

Top Posters In This Topic

I'm trying to make a script that changes an item's value so that you can't sell it for any profit. However, if value is 0, you can't vendor repair it. I thought about setting the value to 1, which would make it not worth selling but very cheap to repair. So I attached an object script to the item in question that detects the Barter and Vendor Repair menus with MenuMode. When I tested it, there's a bit of lag. For example, I go to Moira and select the repair option. The item can't be repaired because it has 0 value, so I repair something else in my inventory. When the menu refreshes, then I can repair it. I then leave the repair menu and go to the barter menu, and my item can now be sold. I make a transaction to refresh the screen, and the value has been reset to 0.

 

My question is, is there a better way of doing what I'm trying to achieve? Any way of making the value change without having to refresh the menus?

 

Here's the code in question.

short BaseValue	;variable to store value of vanilla version of item

;Set value to 0 when Bartering
Begin menumode 1053
if player.getitemcount myItem > 0		;Check if player has item
	if getvalue myItem > 0		;Check if value has been raised for repair
		setbaseitemvalue myItem 0
	endif
endif
End

;Set value to when Repairing
Begin menumode 1058
set BaseValue to getvalue VanillaValue		;Get the base value of vanilla item

if player.getitemcount myItem > 0		;Check if player has item
	if getvalue myItem < BaseValue		;Check if value has been set for repair already
		setbaseitemvalue myItem BaseValue
	endif
endif
End

Link to comment
Share on other sites

Ok so here is a simple one, I want my dream entry script o start playing "OBJComputerZAXHumLP" and my dream exit script o stop it. How do I do this? I know how to start he sound and since the sound loops it will have no ending so I have to do that in a script but i cannot find a stoplaysound function.
Link to comment
Share on other sites

cmal:

I've noticed that using AddItem/RemoveItem to add and remove a playable token from the player's inventory can cause the menu to refresh itself. In particular I've used this method to refresh a menu after using UnequipItem to "silently" unequip an item while the player is viewing their inventory. I'm not 100% certain that it would work, but you could try to use this method to refresh the barter menu as well.

 

@Warll:

There is no script function to stop a sound playing, and this is a relatively common problem. One method that you could try would be to use an activator. Activators can have a "Looping Sound" designated to them, so if you use a combination of PlaceAtMe and Disable/MarkForDelete to create and destroy an activator with a looping sound but no model, you might be able to successfully start and stop the looping sound via script.

 

Cipscis

Link to comment
Share on other sites

cmal:

I've noticed that using AddItem/RemoveItem to add and remove a playable token from the player's inventory can cause the menu to refresh itself. In particular I've used this method to refresh a menu after using UnequipItem to "silently" unequip an item while the player is viewing their inventory. I'm not 100% certain that it would work, but you could try to use this method to refresh the barter menu as well.

Just tried that (code below), and the game freezes when I enter the menu (have to kill FO3 with Task Manager). Tried slipping the token in at two places and both resulted in freezing. Either I'm using them at the wrong time or these particular menus don't like it like the inventory menu does or even something else entirely. The MenuToken item is just a blank Misc Item -- no script, sounds, or graphics. Thoughts?

short BaseValue	;variable to store value of vanilla version of item

;Set value to 0 when Bartering
Begin menumode 1053
player.additem MenuToken 1 1
player.removeitem MenuToken 1 1
if player.getitemcount myItem > 0		;Check if player has item
;		player.additem MenuToken 1 1
;		player.removeitem MenuToken 1 1
	if getvalue myItem > 0		;Check if value has been raised for repair
		setbaseitemvalue myItem 0
	endif
endif
End

;Set value to when Repairing
Begin menumode 1058
player.additem MenuToken 1 1
player.removeitem MenuToken 1 1
set BaseValue to getvalue VanillaValue		;Get the base value of vanilla item

if player.getitemcount myItem > 0		;Check if player has item
;		player.additem MenuToken 1 1
;		player.removeitem MenuToken 1 1
	if getvalue myItem < BaseValue		;Check if value has been set for repair already
		setbaseitemvalue myItem BaseValue
	endif
endif
End

Link to comment
Share on other sites

You'd want to add/remove the token after making your changes, otherwise the menu will be updated before the changes are made which won't really help. Having a misc item as the token should work fine, but you could try using an already existing item as an alternate to make sure that the token isn't the problem.

 

If the token doesn't turn out to be the problem, then try just using AddItem and/or RemoveItem in those menus, perhaps from the console or something, to check if they do cause it to crash.

 

Cipscis

Link to comment
Share on other sites

Would it be possible to have some hairstyles that are only available from one certain NPC in the Wasteland? So you can't select it from the regular race menu, but when you go to that NPC it is available (perferably those hairstyles would be the only ones that NPC could give you)

 

I just want to know if it is possible, because if so I am going to add a barber into the town I am building, if not, then I won't waste my time

Link to comment
Share on other sites

You'd want to add/remove the token after making your changes, otherwise the menu will be updated before the changes are made which won't really help. Having a misc item as the token should work fine, but you could try using an already existing item as an alternate to make sure that the token isn't the problem.

 

If the token doesn't turn out to be the problem, then try just using AddItem and/or RemoveItem in those menus, perhaps from the console or something, to check if they do cause it to crash.

 

Cipscis

Moved the add/remove sections to after the set value lines and it worked. There's still lag if I go into the Repair menu, but it works great if its the Barter menu. Also tried moving the code to a Quest script I had running in the background and that didn't even work at all.

Link to comment
Share on other sites

When in the repair menu, you probably need to add/remove an item that will be visible, i.e. an item in the repair list of the item that is currently being repaired. Currently FOSE does have the GetRepairList and SetRepairList functions available, and it might be possible to refresh the menu by quickly swapping the repair list of the relative item to a dummy list and back to the proper list, but as far as I know there is no current way to tell what the inventory item that is currently being repaired is.

 

You could test these methods with an example items to see if they work, but I don't think a general solution will be possible with the current version of FOSE, unless of course you can sort through a list of items that are being affected.

 

Cipscis

Link to comment
Share on other sites

Haven't asked anything in a while.

 

Anything, having a LOT of trouble figuring out what's wrong with my script. The goal is similar to the quantum chemist perk, which automatically converts 10 nukacolas to 1 quantum. I'm trying to do the same with alcohol and flamer fuel. The problem is, with the amount of alcohol out there, it's much more lengthy than usual. Here is the quantum script for comparison.

 

Begin GameMode
If Player.HasPerk DLC03QuantumChemist == 1
	If Player.GetItemCount NukaCola > 9
		Set NukaCount to Player.GetItemCount NukaCola
		Set Quantums to NukaCount / 10
		Set NukaConverted to Quantums * 10
		Player.RemoveItem NukaCola NukaConverted
		Player.AddItem MS05NukaColaQtm Quantums
	EndIf
EndIf

 

And here's mine:

 

short numBeer
short numVodka
short numWhisk
short numWine
short numScotch
short numAlcohol
short alcCount
short flameCount

begin gamemode

IF Player.HasPerk MargaritaMeltdown == 1

	set numBeer to Player.GetItemCount Beer
	set numVodka to Player.GetItemCount Vodka
	set numWhisk to Player.GetItemCount Whiskey
	set numWine to Player.GetItemCount Wine
	set numScotch to Player.GetItemCount Scotch
	set numAlcohol to numBeer + numVodka + numWhisk + numWine + numScotch
	IF numAlcohol > 9

		set flameCount to numAlcohol / 10
		set alcCount to flameCount * 10
		IF alcCount <= numBeer
		
			Player.RemoveItem Beer alcCount

		ELSE

			Player.RemoveItem Beer numBeer
			set alcCount to alcCount - numBeer
			IF alcCount <= numWhisk

				Player.RemoveItem Whiskey alcCount
			
			ELSE
	
				Player.RemoveItem Whiskey numWhisk
				set alcCount to alcCount - numWhisk
				IF alcCount <= numWine
				
					Player.RemoveItem Wine alcCount

				ELSE
	
					Player.RemoveItem Wine numWine
					set alcCount to alcCount - numWine
					IF alcCount <= numVodka

						Player.RemoveItem Vodka alcCount
	
					ELSE 

					Player.RemoveItem Vodka numVodka
					set alcCount to alcCount - numVodka
					Player.RemoveItem Scotch alcCount
			
					ENDIF
				ENDIF
			ENDIF
		ENDIF
		Player.AddItem AmmoFlamerFuel flameCount * 25
	ENDIF
ENDIF
END

Currently, the game fails to do anything with the script. When I select the perk and collect the alcohol, no changes occur. Had around 14 beers, 7 whiskeys, and one or two bottles of vodka (killed everyone in the muddy rudder).

 

Running through the script step by step, I can't find anything wrong. :confused:

 

EDIT: Nevermind. Realized nothing was actually RUNNING the script, so going to make a quest to run it everytime the game starts. Won't know the results, so if you see a problem, feel free to post. :P

 

EDIT2: Yeah, a few more edits to the script and everything works. Thanks for nothing guys. :P

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...