Welcome Guest ( Log In | Register )

> AI Generated Modding Results, Asking AI for help
Renee
post Jan 19 2025, 05:38 PM
Post #1


Councilor
Group Icon
Joined: 19-March 13
From: Ellicott City, Maryland



I've been modding, quest-writing, and scripting for uh... eight years. I've watched a lot of tutorials (after a while these run out), bugged forumites on bulletin boards when I get stuck, which is usually dubious. Communication breakdowns, haughtiness, and so on. Or sometimes people generally want to help. They'll give me half-an-answer, yet I'm too bashful to ask for elaborations.

So screw it. I'm asking my favorite search engine's AI. That's what this thread shall be about. Will the answers actually work?

Question: How do I make a script which counts items? And I'm not just talking about the GetItemCount function, I'm talking about a script which collects item count data on the fly, from a specified container, and then displays some results.

------------------------------------------

Answer: Creating a script in the Oblivion Construction Set to count items in a player's inventory can be a fun and rewarding task. Here's a step-by-step guide to help you get started:

(I removed the obvious stuff, like how to start writing a script)


--Below is an example script that counts a specific item in the player's inventory. Let's say you want to count the number of Gold001 (gold coins) the player has.

scn CountGoldScript

short goldCount

begin GameMode
set goldCount to player.GetItemCount Gold001
; You can add additional logic here, such as displaying the count or triggering events
end
Save the Script:

Save the script with a meaningful name, such as CountGoldScript.
Attach the Script:

You can attach this script to an object, quest, or NPC depending on when and how you want the script to run. For example, if you want it to run continuously, you might attach it to a quest script.

Explanation

Script Name: CountGoldScript is the name of the script.
Variable Declaration: short goldCount declares a short integer variable to store the count of gold.
GameMode Block: The begin GameMode block runs the script every frame while the game is in progress.
GetItemCount: player.GetItemCount Gold001 gets the count of Gold001 (gold coins) in the player's inventory and stores it in goldCount.
Additional Tips
Display the Count: If you want to display the count to the player, you can use the MessageBox function.

scn CountGoldScript

short goldCount

begin GameMode
set goldCount to player.GetItemCount Gold001
MessageBox "You have %g gold coins.", goldCount
end
Trigger Events: You can add conditions to trigger events based on the item count.

scn CountGoldScript

short goldCount

begin GameMode
set goldCount to player.GetItemCount Gold001
if goldCount >= 1000
; Trigger an event, such as giving a reward
MessageBox "You have accumulated 1000 gold coins!"
endif
end

---------------------------------------------------

Did this work?: (answer to come)

This post has been edited by Renee: Jan 19 2025, 06:10 PM


--------------------
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topic
Replies
Renee
post Jan 19 2025, 06:39 PM
Post #2


Councilor
Group Icon
Joined: 19-March 13
From: Ellicott City, Maryland



Question: Construction Set, How do I add an item to a non-referenced NPC?

I want to be able to add items to people in the game, anybody in the game, without needing to know their Reference ID. I specified "construction set', which means Oblivion, but got results for the GECK and Creation Kit. Which is fine. The GECK often shares the same language as OB's CS.

--------------------------------------------------------------

Answer: Certainly! If you're working with a construction set for a game like Skyrim or Fallout, and you want to add an item to a non-referenced NPC, you can follow these general steps:

Using the Creation Kit (for Skyrim)
Open the Creation Kit:

Launch the Creation Kit and load the appropriate game files (e.g., Skyrim.esm).
Find the NPC:

In the Object Window, navigate to Actors > Actor. Find the NPC you want to modify. If the NPC is not referenced in the game world, you can still find them in this list.
Edit the NPC:

Double-click on the NPC to open their properties window.
Add the Item:

Go to the Inventory tab.
Click on the Add button to add a new item.
In the new window, search for the item you want to add and double-click it to add it to the NPC's inventory.
Save Your Changes:

Click OK to close the NPC properties window.
Save your plugin file (ESP).
Using the GECK (for Fallout)
Open the GECK:

Launch the GECK and load the appropriate game files (e.g., FalloutNV.esm).
Find the NPC:

In the Object Window, navigate to Actors > NPC. Find the NPC you want to modify.
Edit the NPC:

Double-click on the NPC to open their properties window.
Add the Item:

Go to the Inventory tab.
Click on the Add Item button.
In the new window, search for the item you want to add and double-click it to add it to the NPC's inventory.
Save Your Changes:

Click OK to close the NPC properties window.
Save your plugin file (ESP).
Script Method (Applicable for Both Skyrim and Fallout)
If you prefer to use a script to add an item to an NPC, you can do so by creating a new script and attaching it to a quest or another suitable object.

1). Example Script for Skyrim (Papyrus):

Scriptname AddItemToNPC extends Quest

Actor Property TargetNPC Auto
Form Property ItemToAdd Auto
Int Property ItemCount = 1 Auto

Event OnInit()
TargetNPC.AddItem(ItemToAdd, ItemCount)

EndEvent


2). Example Script for Fallout (GECK Script):

scn AddItemToNPCScript

ref TargetNPC
ref ItemToAdd
int ItemCount

begin gamemode
if (TargetNPC && ItemToAdd)
TargetNPC.AddItem ItemToAdd ItemCount
endif

end
In both cases, you need to fill in the properties (TargetNPC, ItemToAdd, and ItemCount) in the editor.

By following these steps, you can successfully add items to non-referenced NPCs in your game. If you need more specific guidance, feel free to ask!

---------------------------------------

Did this work? answer to come. laugh.gif


--------------------
User is offlineProfile CardPM
Go to the top of the page
+Quote Post



Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 

- Lo-Fi Version Time is now: 8th August 2025 - 03:52 PM