You can read and reply to posts and download all mods without registering.
We're an independent and non-profit fan-site. Find out more about us here.
DML1+ObjProp "TargetArchetype" "Scripts"{ "Script 0" "MyCustomScript"}
DML1CreateArch "Misc Metaprops" "MyCustomMeta"{}+ObjProp "MyCustomMeta" "Scripts"{ "Script 0" "MyCustomScript"}+MetaProp "TargetArchetype" "MyCustomMeta"
+ObjProp "TargetArchetype" "Scripts"{ "Script 0" "MyCustomScript" "Script 1" "" "Script 2" "" "Script 3" ""}
//This is both the most amazing AND most disgusting thing I have ever made NewDark do //I'm really sorry... function DynamicScriptAdd(item,script) { local script1 = Property.Get(item,"Scripts","Script 0"); local script2 = Property.Get(item,"Scripts","Script 1"); local script3 = Property.Get(item,"Scripts","Script 2"); local script4 = Property.Get(item,"Scripts","Script 3"); if (script1 == "" || script1 == 0) Property.Set(item,"Scripts","Script 0",script); else if (script2 == "") Property.Set(item,"Scripts","Script 1",script); else if (script3 == "") Property.Set(item,"Scripts","Script 2",script); else if (script4 == "") Property.Set(item,"Scripts","Script 3",script); else print ("Error: Object " + item + " (" + ShockGame.GetArchetypeName(item) + ") has no available script slots!"); }
Adding scripts dynamically at runtime does unspeakable things to the game