CreateItemOnObject Wrapper for use with DelayCommand
Don't I post a lot on these forums 
Does anyone have a good scripting solution for using Delay Comand with CreateItemOnObject?
Think I need a custom wrapper for it.
Does anyone have a good scripting solution for using Delay Comand with CreateItemOnObject?
Think I need a custom wrapper for it.
0
Comments
A function like this added to your library (note: this method does require you to "#include" your library script at the top of the script you use your custom functions in) could work:
void DelayCreateItemOnObject(string sItemTemplate, object oTarget, int nStackSize=1, string sNewTag=""); void DelayCreateItemOnObject(string sItemTemplate, object oTarget, int nStackSize=1, string sNewTag="") { CreateItemOnObject(sItemTemplate, oTarget, nStackSize, sNewTag); }And then using the above in a script would look like:#include "_my_mod_library" void main() { object oPC = GetLastUsedBy(); DelayCommand(5.0, DelayCreateItemOnObject("item resref", oPC)); }Or if you want to just add it to a script that you need it for, you just add it to the top, above the void main():
void DelayCreateItemOnObject(string sItemTemplate, object oTarget, int nStackSize=1, string sNewTag="") { CreateItemOnObject(sItemTemplate, oTarget, nStackSize, sNewTag); } void main() { object oPC = GetLastUsedBy(); DelayCommand(5.0, DelayCreateItemOnObject("item resref", oPC)); }Hope it helps.