Jump to content

Trying to add items to a container via script.


OverlordManny

Recommended Posts

I'm having serious issues with the geck. We disagree on everything it seems. So I'm trying to build my first mod with a quest and such. Well here's what I'm trying to accomplish. I want a menu that removes Items from the player and then adds items to a (persistent) referenced container. The geck refuses to save my script.

 

Here's my code.

 

scn 00DMCapMachineScript

short awaitingInput00DM
short buttonVar00DM
short metal

Begin OnActivate
set metal to (player.getitemcount spareparts)
if (GetActionRef == player)
	ShowMessage 00DMCapPressMenuMessage
	set awaitingInput00DM to 1
endif
End

Begin GameMode
if awaitingInput00DM == 1
	set buttonVar00DM to getbuttonpressed
	if buttonVar00DM == 0
		if metal >= 1
			player.RemoveItem spareparts 1
			00DMCapCollectorREF.AddItem CounterfeitCaps 100
		else
			ShowMessage 00DMNotEnoughMetalMessage
		endif
	elseif buttonVar00DM == 1
		if metal >= 10
			player.RemoveItem spareparts 10
			00DMCapCollectorREF.AddItem CounterfeitCaps 1000
		else
			ShowMessage 00DMNotEnoughMetalMessage
		endif
	endif
endif
End

 

If I change the '00DMCapCollectorREF' to 'player' the script compiles and works great, taking scrap metal from the player and adding counterfeit caps to the player. But I want to add the counterfeit caps to a container. Is this not possible? I know it can be done for merchants because there's a tut for that in the wiki. So why is the geck giving me so much hell?

Link to comment
Share on other sites

It should work like it is, but the GECK is a beast with its own mind.

 

Try making the object reference of the counterfit device the container. Then use Getref and Myref instead of the ID. I am not a big scripter, but those I have done, have been a pain.

Link to comment
Share on other sites

I figured out the problem I think. I don't know why the hell it is a problem but it seems like the geck didn't like the two leading zeros in my reference name. I have been trying to build a quest of four days and honestly the geck is way too buggy and glitchy for me. It's just not worth my efforts to have to fight to try to figure out all its stupid little unwritten rules. Sorry don't mean to complain I'm just frustrated that the program is a pile of crap. I can't continue writing my quest since I can't use conditions on messages, (the game just shows blank menus if I do). I got pretty far but I'm not going to release a quest that is broken and buggy due to unintentional limitations of the editor. I'm amazed Obsidian or even Bethesda got a game created with it. I will no longer complain of bugs in their games because if this is the tools they used to create FO3 and FONV they are gods for getting anything done. Edited by OverlordManny
Link to comment
Share on other sites

  • Recently Browsing   0 members

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