NexusComa Posted November 18, 2016 Share Posted November 18, 2016 Here is a clip from one of my scripts with a 869 object array.(made into a script to show placement) Scriptname ARRAYS_TEST Extends ObjectReference Int oC = 0 ; object counterObjectReference[] Property o1 Auto Hidden ; object cachesObjectReference[] Property o2 Auto Hidden ;ObjectReference[] Property o3 Auto Hidden ;ObjectReference[] Property o4 Auto Hidden ;ObjectReference[] Property o5 Auto Hidden ;ObjectReference[] Property o6 Auto Hidden ;ObjectReference[] Property o7 Auto Hidden ; Int x0 = 0x000B28B4 ; light rubble ... a test object to be put down ; 896 object arrayEvent OnInit() o1 =(New ObjectReference[128]) o2 =(New ObjectReference[128]) o3 =(New ObjectReference[128]) o4 =(New ObjectReference[128]) o5 =(New ObjectReference[128]) o6 =(New ObjectReference[128]) o7 =(New ObjectReference[128]) GoToState("Mainloop")EndEvent State Mainloop Event OnBeginState() ; code EndEvent Event OnActivate(ObjectReference akActionRef) ; code EndEvent EndState ; an example of Objects being put down then added to the cacheFunction SetObj(Int sObj,Int xPos,Int yPos,Int zPos,Int zAng) ObjectReference Obj=(Game.GetPlayer().PlaceAtMe(Game.GetForm(sObj), 1, false, false)) Obj.SetPosition(xPos as Float, yPos as Float, zPos as Float) Obj.SetAngle(0 as Float, 0 as Float, zAng as Float) Self.CellCache(Obj)EndFunction Function CellCache(ObjectReference Obj) If(oC<(128)) o1[oC]=(Obj) ElseIf(oC<(256)) o2[oC-(128)]=(Obj) ElseIf(oC<(384)) o3[oC-(256)]=(Obj) ElseIf(oC<(512)) o4[oC-(384)]=(Obj) ElseIf(oC<(640)) o5[oC-(512)]=(Obj) ElseIf(oC<(768)) o6[oC-(640)]=(Obj) ElseIf(oC<(896)) o7[oC-(768)]=(Obj) EndIf oC+=(1)EndFunction Function ClearCache() Int r0=(0) ;--- r0=(o1.length) While(r0) r0-=(1) If(o1[r0]) o1[r0].Delete() o1[r0]=(None) EndIf EndWhile r0=(o2.length) While(r0) r0-=(1) If(o2[r0]) o2[r0].Delete() o2[r0]=(None) EndIf EndWhile r0=(o3.length) While(r0) r0-=(1) If(o3[r0]) o3[r0].Delete() o3[r0]=(None) EndIf EndWhile r0=(o4.length) While(r0) r0-=(1) If(o4[r0]) o4[r0].Delete() o4[r0]=(None) EndIf EndWhile r0=(o5.length) While(r0) r0-=(1) If(o5[r0]) o5[r0].Delete() o5[r0]=(None) EndIf EndWhile r0=(o6.length) While(r0) r0-=(1) If(o6[r0]) o6[r0].Delete() o6[r0]=(None) EndIf EndWhile r0=(o7.length) While(r0) r0-=(1) If(o7[r0]) o7[r0].Delete() o7[r0]=(None) EndIf EndWhile Utility.Wait(1.0) oC = 0EndFunction Link to comment Share on other sites More sharing options...
NexusComa Posted November 18, 2016 Author Share Posted November 18, 2016 (edited) I hope others enjoy this as it took me awhile to get this right ... Edited November 18, 2016 by NexusComa Link to comment Share on other sites More sharing options...
irswat Posted November 18, 2016 Share Posted November 18, 2016 haha awesome work around. Link to comment Share on other sites More sharing options...
Recommended Posts