A Better Way to Check for Existing Items Before Spawning
Many of you who have done my very first tutorial to create an item have been running into a problem. When the script checks to see if you already have the item before creating a new one, it essentially only looks in your bags. If the item isn’t in your bags, it can’t find it so creates a new one.
In this small tutorial we will look at a better way of checking for the item before spawning a new one. A method that should accurately find the item even if it is no longer in your bags.
CountItemsByTag
int CountItemsByTag ( object oPossessor,
string sTag
)Counts items with the given tag in the given container/inventory.
Parameters:
oPossessor – The placeable or creature to count items in.
sTag – The tag of the items to count.
In the original tutorial, we used the CountItemsByTag function to look and see if the player already had the item. Essentially this function counts how many of items with the indicated tag are currently present in the specified objects inventory. If the count was 0, then we figured the player did not have the item, so we created a new one.
This works, but it has several drawbacks. It only checks the player’s bags. If the player had the item, but it was somewhere else, the count would still come back as 0, so we would end up spawning a new one. This most commonly happens when you equip the item on the player or a party member, or stick it in your storage chest.
Essentially, the problem with CountItemsByTag is its limited scope. It only looks in one spot. We need something that will have a wider scope, looking in more places for the item.
GetObjectByTag
object GetObjectByTag ( string sTag,
int nNth = 0
)Returns the nth specified object with the appropriate tag, or OBJECT_INVALID on failure
Parameters:
sTag – The tag reference to get the object by
nNth – If there are multiple objects with the same tag, get the ‘nth’ specified object.Returns:
the desired object or OBJECT_INVALID on failure
GetObjectByTag is a more generic object function, and is exactly what we need. This function has a much wider scope and will return any object, anywhere, that matches the specified tag as long as that object is currently loaded by the game.
You will notice though that this function works a bit different. Instead of the function returning to us the number of items with the specified tag, it instead returns the actual object itself. By default it will return the first one it finds. To make this do what we need we need to combine it with another function.
IsObjectValid
int IsObjectValid ( object oObject )
Returns TRUE if the object oObject exists and is a valid object, FALSE otherwise.
Parameters:
oObject – The object which may be valid.Returns:
Returns TRUE if the object exists and is valid, FALSE otherwise.
Remarks:
This function is very similiar to checking whether an object is not equal to the OBJECT_INVALID constant, but this is a more robust check. An object that has been passed as a paramater in a delayed function call or has been stored as a local object will not equal the OBJECT_INVALID constant if the object has been destroyed since it was stored or passed. This function however will return FALSE in those circumstances. There is no instance where an object is equal to the OBJECT_INVALID constant and this function will return TRUE.
This function is very simple, and does exactly what it sounds like. It tells us if the specified object is a valid object or not.
So how would we use these to check for an item before spawning a new one? In pseudo-code:
Sword = GetObjectByTag("my_sword_tag") If IsObjectValid(Sword) Then Do nothing - We already have the item Else Spawn new Sword
Here is how this might fit into our original script
// All module events #include "utility_h" #include "wrappers_h" #include "events_h" void main() { event ev = GetCurrentEvent(); int nEvent = GetEventType(ev); Log_Events("", ev); switch (nEvent) { case EVENT_TYPE_MODULE_LOAD: { // get the object which contains the player object oPlayer = GetHero(); object oBow = GetObjectByTag("aga_bowofathena"); if (!IsObjectValid(oBow)) UT_AddItemToInventory(R"aga_bowofathena.uti",1); break; } default: { break; } } }
Credits
This tutorial is based upon a writeup by Attono on DAMods
can u post a complete script for multiple items that we can copy and paste on to our scripts? i know its rather lazy on my part, but i don’t understand scripting but i like making whole sets of armor in one module instead of separate mods for each item.
looking at all these words above and trying to understand what it all means is the equivalent of somebody opening my brain and placing a cherry bomb inside.
also, for our mod to be as professional as possible,(like if we are going to upload and share our mod)should the script just make the items appear once? so that once you sell/destroy all of the items you do not have them re-appear on the next load?
and another question if you don’t mind, is it possible to add a new area to the single player campaign where the player would have to fight a small battle to have the items drop or to access a chest containing the items?
oh and also i was wondering, why for your mods do i extract them to the overrides folder and for others i use the daupdater to install them?
It actually depends on what the mod overrides. However, since I made my early mods i’ve learned more and i’m actually rewriting them. I’ve already convert my No Follower Autolevel over to use custom events so it is now installed through DAUpdater. Hopefully I can do the same with the others.
I think a better way is using a plot mechanism. By using a plot it is like a scripted event, only that it happens on load – runs the script to give the items then saves in the module that the script has already been run. Then there is no reason to run the adding script again because the plot is never going to be set to the state that the plot needs to be for it to run.. Let me show you the code picked up out of a blog discussion on the community site.
(I assume images aren’t allowed in comments so I’ll just post the links to my screenshots.)
The code and process below was taken from Joshimoo
here: http://social.bioware.com/project/422/discussion/166/&p=6
^Make a new plot resource. For the code here UID is quickitem000pl_main
^Add a new flag. For the code here name is QUICKITEM_ADDED
Then we go to the scripts.
http://de.pastebin.ca/1662840
It works seemingly flawlessly, and doesn’t give the items multiple times if you destroy them as it is checking for the plot flag data not the inventory or game load status.
I realize I put the wrong image link for the second one. My mistake.
Also for those having trouble with creating a plotflag to begin with. Right clicking on the open area then creating a main flag works. I do not fully understand the difference between a main and defined flag, but main has worked for me.
Or you can press Ctrl+M.
A Plot flag is a good way, but i’ve avoided them for now because plot flags are supposedly broken in the toolset and can corrupt the single player campaign. I’m waiting for the toolset patch that fixes them before I talk about them.
I believe the problem with plot flags are matching id’s with the same warnings as using scripts.
I haven’t seen in any problems with my current play through using them but it is an exceptionally large game so it is quite likely there are some.
🙂 Honestly it is kinda fun messing around in a slightly broken toolset, because every little thing you do is an adventure. 😀
The main thing with plot flags that it seems you must do is make them module specific. In the properties that is.
That said, I understand waiting for the updates before messing with them.
Yeah there are ways to make it safe. I’ve done it with my No Starting Abilities mod, which actually modifies base game plot flags.
But polls show that about 80% of the readers for this blog consider themself a base beginner, so as long as there is even the possibility of a mistake irrevocably damaging a save game, I choose to avoid the subject 🙂 But you are 100% correct in that plot flags are a nice way to go. And once they fix the GUIDs I will talk about them 😀
Sometimes I am retarded. My first sentence makes no sense.
I meant to say with the broken database that we are currently working with. I don’t even know where that sentence came from.
I blame it on the 4 hours of sleep over the last 2 days.
Hey John I had to start all over (completely remove\reinstall game\toolset\sql so I’m trying to redo your Tutorials. I tried this script and tried for multiple items but I keep getting and erroe when compiling — E: 22:55:40 – cdon_event_handler.nss – cdon_event_handler.nss(15): No semicolon after expression —
Line 10 is my first object line and it has a semi colon at the end here is my script can you tell me what is wrong?
/——–start script—-/
#include “utility_h”
#include “wrappers_h”
#include “events_h”
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
Log_Events(“”, ev);
switch (nEvent)
{
case EVENT_TYPE_MODULE_LOAD:
{
object oPlayer = GetHero();
objest oAttrib = GetObjectByTag(“cdon_book_attrib”);
if (!IsObjectValid(oAttrib))
UT-AddItemToInventory(R”cdon_book_attrib.uti”, 99);
objest oSkill = GetObjectByTag(“cdon_book_skill”);
if (!IsObjectValid(oSkill))
UT-AddItemToInventory(R”cdon_book_skill.uti”, 99);
objest oTalentm = GetObjectByTag(“cdon_book_talentm”);
if (!IsObjectValid(oTalentm))
UT-AddItemToInventory(R”cdon_book_talentm.uti”, 99);
objest oTalentw = GetObjectByTag(“cdon_book_talentw”);
if (!IsObjectValid(oTalentw))
UT-AddItemToInventory(R”cdon_book_talentw.uti”, 99);
objest oHeal = GetObjectByTag(“cdon_pot_heal”);
if (!IsObjectValid(oHeal))
UT-AddItemToInventory(R”cdon_pot_heal.uti”, 99);
objest oInj = GetObjectByTag(“cdon_pot_inj”);
if (!IsObjectValid(oInj))
UT-AddItemToInventory(R”cdon_pot_inj.uti”, 99);
objest oMana = GetObjectByTag(“cdon_pot_mana”);
if (!IsObjectValid(oMana))
UT-AddItemToInventory(R”cdon_pot_mana.uti”, 99);
break;
}
default;
break;
}
}
/——end script—–/
The #1 cause of errors in programming is typos. “objest”? Try object 🙂
Now I feel dumb lol, that what I get for deciding to type it all out instead of copy\paste\replace””
Fixed object now getting this lol
E: 23:22:50 – cdon_event_handler.nss – cdon_event_handler.nss(17): No semicolon after expression
NV used – instead of _ lol
This is my working multiple items script using IsObjectValid:
// All module events
#include “utility_h”
#include “wrappers_h”
#include “events_h”
void main()
{
event ev = GetCurrentEvent();
int nEvent = GetEventType(ev);
Log_Events(“”, ev);
switch (nEvent)
{
case EVENT_TYPE_MODULE_LOAD:
{
// get the object which contains the player
object oPlayer = GetHero();
object oArmor = GetObjectByTag(“my_custom_armor”);
object oBoots = GetObjectByTag(“my_custom_boots”);
object oGloves = GetObjectByTag(“my_custom_gloves”);
object oHelm = GetObjectByTag(“my_custom_helm”);
if (!IsObjectValid(oArmor))
UT_AddItemToInventory(R”my_custom_armor.uti”,1);
if (!IsObjectValid(oBoots))
UT_AddItemToInventory(R”my_custom_boots.uti”,1);
if (!IsObjectValid(oGloves))
UT_AddItemToInventory(R”my_custom_gloves.uti”,1);
if (!IsObjectValid(oHelm))
UT_AddItemToInventory(R”my_custom_helm.uti”,1);
break;
}
default:
{
break;
}
}
}
Nicely done Lethal_Brahms
Thanks
Hi,
i did something that could be interesting for newbies 🙂
to be used like this :
exemple :
Here's a script I made if you guys wanna add multiple items
If your like me and you add more of an item you already have one of, like a ring or amulet. Instead of destroying or selling the copies you already have on your character or in your inventory. You can use this little function I made. For a function to work you need to place the header above void main() and the definition after. Then you can use the function as many times as you like within void main().
// Function Definition
void additem(resource rItem, int iCount, string iTag)
{
object oPlayer = GetHero();
int iItemCount = CountItemsByTag(oPlayer, iTag);
if(iItemCount < iCount)
{
int nItem = iCount-iItemCount;
UT_AddItemToInventory(rItem, nItem);
}
}
You know, you could condense your script a little further. There’s really no need to assign the result of GetObjectByTag() to a variable and then call IsObjectValid().
GetObjectByTag() returns OBJECT_INVALID if no object is found. So you could condense your code to:
Checking against OBJECT_INVALID isn’t 100% and can give a false result. That’s why the function IsObjectValid() exists. Granted you could still condense it down:
But in the end its a matter of style. I’ve just always tended to write more verbose code. Its easier to read in a few years when I go back to it.
Not just a matter of style, but also an extra step by the script when it is executed. I always try to condense when writing code professionally, you never know when you need that extra cycle. But to each his or her own. 🙂
Hi, I’m just wondering if the line “object oPlayer = GetHero();” is actually necessary with the new function. I mean: oPlayer variable is never used, right? Neither in GetObjectByTag(), nor in IsObjectValid(). It’s not even used by UT_AddItemToInventory().
The code compiles ok without that line.
You are correct in this case, because we use the utility function UT_AddItemToInventory which by default goes to the player. I guess its just such a habit to get the player object 🙂
//error I’m receiving its pointing out in (#include “utility_h”)
E: 01:08:47 – ma_script_mutipleitems.nss – ma_script_mutipleitems.nss(2): After compound statement at end
All “Compound Statement” errors occur because of bad quotes, usually caused by copying and pasting the code. Simply go through your code and re-type all the quotes as standard quotes.
Lolz… it took me all night figuring what went wrong … i re type the quotes and it works, i do not know much of scripting or so and i just simply follow your tutorial … thanks John .. God Bless
Hey all i have been followin the tutorial and they are great. but i run into an issue. i am using the same script as Caladon. the issue is that three of the items in the list of five that i am spawning keep spawning even after they are in my back pack. i have went over the script with a fine tooth comb and cannot find out why they are still spawning. can yo help?
here is my code:
okay, super noobish question
does “object oSword” include 2-handers?
“oSword” is just a name we give the variable so we can reference it again. It could just as well be “oKitten” or “oHamburgerTastesGood”, it really is irrelevant to the code.
I want to thank you for making these tutorials, they realy helped me out alot… since I’m new to the world of modding. but my question is… how do i tie these scripts into the original script that you made in your last tutorial without messing up the script an there for messing up the game!
also does this script
do what this script does
in your tutorial about creating items on toolsets?… or is there a way to add this script into the other original one you wrote
Pretty much, yes
with this method, the object will be added each time, ie it can not be removed from the inventory, it is not good, better to use a test plot. We add a plot and named my_item_check_plt, add the Main Flag, and rename FLAG_0 in MY_ITEM_CHECK_FLAG, and use this script
#include “utility_h”
#include “plt_my_item_check_plt” // plt_ + name created plot
void main()
{
//Check if the flag is set to TRUE, exit
//PLT_ + name created plot (MY_ITEM_CHECK_PLT)
if (WR_GetPlotFlag(PLT_MY_ITEM_CHECK_PLT, MY_ITEM_CHECK_FLAG) == TRUE)
return;
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
switch (nEventType)
{
case EVENT_TYPE_MODULE_LOAD:
{
UT_AddItemToInventory(R”my_ring001.uti”, 1);
// Set the flag that the item is added to the inventory
WR_SetPlotFlag(PLT_MY_ITEM_CHECK_PLT, MY_ITEM_CHECK_FLAG, TRUE);
break;
}
default:
break;
}
}
Now if we remove the item it will not be added again.
PS Sorry for my English 🙂
Plots were intentionally not used due to bugs in the toolset. Now that v1.01 of the toolset is out, and a lot of those bugs fixed, it is probably time to take another look at this.
The compound statement error means your quote marks are invalid. This is often caused by copying & pasting the script. Retype the quote marks.
Cheers for the guides.
Now the problem i run into is that when i Write up the code from the multiple objects script provided by Lethal_brah and replace the items i had created with ones similar to the ones provided it comes up with the ” E: 01:35:49 – test.nss – test.nss(1): After compound statement at end ” error and doesn’t complile. having read the previous posts and seeing that the comments is where the issue should be. i decided hey why not just delete the comments completly leaving my code like so
but when i try and re-complie said script, i continue to get the same error. now either something really simple is wrong that i’m missing or i need to look at re-writing the code without copy-paste.
i keep getting this error
and this is the script i used
// All module events
#include "utility_h"
#include "wrappers_h"
#include "events_h"
void main()
{
event ev = GetCurrentEvent();
int nEvent = GetEventType(ev);
Log_Events("", ev);
switch (nEvent)
{
////////////////////////////////////////////////////////////////////////
// Sent by: The engine
// When: The module loads from a save game, or for the first time. This event can fire more than
// once for a single module or game instance.
////////////////////////////////////////////////////////////////////////
case EVENT_TYPE_MODULE_LOAD:
{
// this event can fire multiple times, and we only want to do this once
// So we save a flag inside a number variable. We check it here and if its
// set already then we know we've already done this before. The name of the
// variable in quotes can be whatever you want.
int iModuleLoaded = GetLocalInt(OBJECT_SELF, "dksword");
if (iModuleLoaded == 1)
break;
// get the object which contains the player
object oPlayer = GetHero();
// The flag we save won't persist beyond the game session, so its a good idea to actually
// look to see if the player already has the item, unless you WANT them to get another one
// The name in quotes is the TAG of the item. So what we do is see how many of the item
// the player already has, and if its 0, we know we haven't given it to them yet (or they sold it :p)
int iItemCount = CountItemsByTag(oPlayer, "dksword");
// if its 0, then let's give them the item. Now this first parameter is a RESOURCE identifier. Note
// how its formatted. R"resource_file_name"
// The "R" part is important and identifies it as a resource. The filename is just the filename of the
// resource. You can see this in the toolset on the tabs up top.
// The number 1 means give 1 item.
if (iItemCount == 0)
UT_AddItemToInventory(R"dksword.uti",1);
// lastly we set that number variable we talked about earlier, to save the fact that we've
// done this already.
SetLocalInt(OBJECT_SELF, "dksword", 1);
break;
}
default:
{
break;
}
}
}
what am i doing wrong
Hello,
Could someone please have a look at this script and see what is wrong?
I get no errors in-game, but no items are added to my inventory upon load.
Or maybe I should actually attach this script to the module first. >_< Forgot about that. Thanks, all, it works now! 😀
😦
Well, I just can’t get the script to work for me. I don’t know why it won’t work, I just can’t find the item in my inventory. Darn it, was hoping to make an uber staff. 😛
Tried copying and pasting your script (while just changing the name since my is demonslayer not bowofathena), but no luck. 😦
Wait, fit into the original script? that final part goes into the original script? I’m quite confused. I tried copy and pasting the original script and it didnt work then uninstalled and the mod and re did the process only to find out the one on this page didn’t work either. grr! It makes me really appreciate the modding tool for Fallout 3. The GECK is a breeze to use compared to this. >: /
Frustrations with the Toolset
I’ve tried multiple peoples’ “Working Scripts” and I can’t get any working for the items I’m trying to import. At the moment I’m working on your (John’s) step-by-step for creating a custom vendor, figuring that if I can’t get the item to spawn, I’ll try to buy it instead. Here’s my current script, I get no errors except the starting area warning, and all exports are listing ‘successful’. Am I exporting wrong?
// All module events
#include “utility_h”
#include “wrappers_h”
#include “events_h”
void main()
{
event ev = GetCurrentEvent();
int nEvent = GetEventType(ev);
Log_Events(“”, ev);
switch (nEvent)
{
case EVENT_TYPE_MODULE_LOAD:
{
// get the object which contains the player
object oPlayer = GetHero();
object oKal_Armor = GetObjectByTag(“kal_armor”);
object oKal_Gloves = GetObjectByTag(“kal_gloves”);
object oKal_Lel_bow = GetObjectByTag(“kal_lel_bow”);
if (!IsObjectValid(oKal_Armor))
UT_AddItemToInventory(R”kal_armor.uti”,1);
if (!IsObjectValid(oKal_Gloves))
UT_AddItemToInventory(R”kal_gloves.uti”,1);
if (!IsObjectValid(oKal_Lel_bow))
UT_AddItemToInventory(R”kal_lel_bow.uti”,1);
break;
}
default:
{
break;
}
}
}
Obvious items, 1pc of Armor, 1 pair of gloves, and a longbow. Not getting any to spawn. While I wait for a response I’m going to clean out the mod folder and try another export from scratch… been editing and exporting for the last 2 1/2 hours to try and get it to work…. lol
I’ve tried using your guide but I’m unable to make my item appear in the game. I’ve created a ring – copying most of the stats including inventory subgroup, material type etc. from the blood ring – but it doesn’t show up. I have removed the blood mage requirement but I don’t know if the “Improves blood magic” is the cause of it not showing up.
This is my script:
// All module events
#include “utility_h”
#include “wrappers_h”
#include “events_h”
void main()
{
event ev = GetCurrentEvent();
int nEvent = GetEventType(ev);
Log_Events(“”, ev);
switch (nEvent)
{
case EVENT_TYPE_MODULE_LOAD:
{
// get the object which contains the player
object oPlayer = GetHero();
object oRing = GetObjectByTag(“tun_angantyr”);
if (!IsObjectValid(oRing))
UT_AddItemToInventory(R”tun_angantyr.uti”,1);
break;
}
default:
{
break;
}
}
}
Any help is appreciated
// All module events
#include “utility_h”
#include “wrappers_h”
#include “events_h”
void main()
{
event ev = GetCurrentEvent();
int nEvent = GetEventType(ev);
Log_Events(“”, ev);
switch (nEvent)
{
case EVENT_TYPE_MODULE_LOAD:
{
// get the object which contains the player
object oPlayer = GetHero();
object oRing = GetObjectByTag(“tun_angantyr”);
if (!IsObjectValid(oRing))
UT_AddItemToInventory(R”tun_angantyr.uti”,1);
break;
}
default:
{
break;
}
}
}
My addin only seems to work once, after that it does not work for a new game. It seems the plot flag is being set and stays that way.
// —- SCRIPT STARTS HERE —-
// Later on in this script, we will use the UT_AddItemToInventory()
// function to add an item to the player’s inventory.
// But before we could use it, we have to tell the toolset where
// to look for it. The function is in the “utility_h” script file
// under _Core Includes, we will include this file at the top of
// our script file, above the main function.
#include “utility_h”
#include “wrappers_h”
#include “plt_makers_set_plot”
void main()
{
// If our plot flag is set to TRUE, that means we have already
// given the items to the player, there is no need to continue
// running this script.
if ( WR_GetPlotFlag( PLT_MAKERS_SET_PLOT, MAKERS_SET_CHECK_FLAG ) == TRUE )
return;
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
// We will watch for every event type and if the one we need
// appears we will handle it as a special case. We will ignore the rest
// of the events
switch ( nEventType )
{
// This event happenes every time the module loads
// This usually happenes when creating a new game
// or loading a savegame
case EVENT_TYPE_MODULE_LOAD:
{
// The UT_AddItemToInventory function adds various resources to a
// creature’s inventory. Here we add one weapon and one shield.
UT_AddItemToInventory(R”makers_hat.uti”, 1);
UT_AddItemToInventory(R”makers_light_armor.uti”, 1);
UT_AddItemToInventory(R”makers_light_hat.uti”, 1);
UT_AddItemToInventory(R”makers_light_slippers.uti”, 1);
UT_AddItemToInventory(R”makers_longsword.uti”, 1);
UT_AddItemToInventory(R”makers_med_armor.uti”, 1);
UT_AddItemToInventory(R”makers_shield.uti”, 1);
UT_AddItemToInventory(R”makers_slippers.uti”, 1);
UT_AddItemToInventory(R”makers_sting.uti”, 2);
UT_AddItemToInventory(R”makers_wand.uti”, 1);
UT_AddItemToInventory(R”makers_med_touch.uti”, 1);
UT_AddItemToInventory(R”makers_light_touch.uti”, 1);
// Set our plot flag to TRUE, so the next time this script tries
// to run it will not add extra items to the player’s inventory
WR_SetPlotFlag( PLT_MAKERS_SET_PLOT, MAKERS_SET_CHECK_FLAG, TRUE );
// We have dealt with the event we were waiting for.
// At this point we can stop looking for other events
break;
}
default:
break;
}
}
// —- SCRIPT ENDS HERE —-
I have a problem to solve.
I created the item and works well, but when I load the game again, the item is equipped but also is in the bag, as it multiplies.
Maybe the script, but not understand the reason for which this happens.
Could someone help me
/ All module events
#include “utility_h”
#include “wrappers_h”
#include “events_h”
void main()
{
event ev = GetCurrentEvent();
int nEvent = GetEventType(ev);
Log_Events(“”, ev);
switch (nEvent)
{
case EVENT_TYPE_MODULE_LOAD:
{
// get the object which contains the player
object oPlayer = GetHero();
object oArmor = GetObjectByTag(“gvn_arcarm_armor”);
object oBoots = GetObjectByTag(“gvn_arcarm_boots”);
object oGloves = GetObjectByTag(“gvn_arcarm_glove”);
object oHelm = GetObjectByTag(“gvn_arcarm_helm”);
object oSword = GetObjectByTag(“gvn_arcarm_wep”);
object oDagger = GetObjectByTag(“gvn_arcarm_wep2″);
if (!IsObjectValid(oArmor))
UT_AddItemToInventory(R”gvn_arcarm_armor.uti”,1);
if (!IsObjectValid(oBoots))
UT_AddItemToInventory(R”gvn_arcarm_boots.uti”,1);
if (!IsObjectValid(oGloves))
UT_AddItemToInventory(R”gvn_arcarm_glove.uti”,1);
if (!IsObjectValid(oHelm))
UT_AddItemToInventory(R”gvn_arcarm_helm.uti”,1);
if (!IsObjectValid(oHelm))
UT_AddItemToInventory(R”gvn_arcarm_wep.uti”,1);
if (!IsObjectValid(oHelm))
UT_AddItemToInventory(R”gvn_arcarm_wep2.uti”,1);
break;
}
default:
{
break;
}
}
}
I cant seem to get this to work, can any1 help me?
PS: i have 0 scripting experience. this is purely copy paste and trial and error.
Oh yes and I have already changed the 2 xtra Helm in if (!IsObjectValid(oHelm))
to Sword and dagger to correspond to the object o(thing).
But it still gives me unknown state in compiller.
Sorry for the mass post, but i have figured out the Unknown state in compiler problem.
*But after sucessfully exporting it, the items, and generating the 2 files, the items wont appear in game*
*I have also solved the problem of it, for any1 that is interested heres how.
Remove the mod you have added(I use DAmodder,so its easy for me). Now go in game and destroy any item related to the mod you just removed( sometimes incomplete removal of the mod occurs, such as an item still in a shop which the DAmoddder failed to remove). Now find all the items related to the mod, and destroy them(if their in a shop, buy it, den right click the item, destroy)
Hope this little thing helps!
And thanks to whoever wrote the script I used!