Help - Search - Members - Calendar
Full Version: AI Generated Modding Results
Chorrol.com > Mods > General modding
Renee
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)
Renee
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
Lena Wolf
I read this somewhere: "Letting an AI write a program is like giving a gourmet recipe to a fast food restaurant: you don't know what will come out but you can be sure it will be fried."
Renee
QUOTE(Lena Wolf @ Jan 19 2025, 01:03 PM) *

I read this somewhere: "Letting an AI write a program is like giving a gourmet recipe to a fast food restaurant: you don't know what will come out but you can be sure it will be fried."

Yeah, I realize this. tongue.gif I'm not blind to the fact that the idea of using AI seems horrible.

But I get to the point where I'm out of ideas. I get stuck. Hours begin to pile up, and I'm frustrated. I don't feel like posing some questions in a bulletin board which either get ignored, or only get half-answered!!!

I mean, what do you do when you get stuck?

Lena Wolf
QUOTE(Renee @ Jan 19 2025, 11:55 PM) *

But I get to the point where I'm out of ideas. I get stuck. Hours begin to pile up, and I'm frustrated. I don't feel like posing some questions in a bulletin board which either get ignored, or only get half-answered!!!

I mean, what do you do when you get stuck?

First, I don't think you ever get ignored if your post your questions here. It isn't a large forum, true, but between SubRosa, Ghastley and myself we have all your three favourite games covered. So try us.

People don't generally ignore you because they want to be evil. A question can go unanswered because no one with the knowledge had seen it, or may be there is no one around who knows the answer. It can be half-answered for the same reason. People answer what they can.

When I get stuck, I start with the Useful Scripts in the Construction Set Wiki. Useful indeed, many solutions are posted there. If I am still stuck, I search for a mod that does something similar and see how they've done it. If still stuck, I abandon the problem. I examine closely what it is that I am trying to achieve in the end of the day, and how I can do without.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2025 Invision Power Services, Inc.