A cog i have written fails when I add too many items to an array list. Right around 130 items it just decides not to do what it does...but under that number it does everything. Is this one of JK's limits?
This is the static archive of the Massassi Forums. The forums are
closed indefinitely. Thanks for all the memories!
You can also download
Super Old Archived Message Boards
from when Massassi first started.
"View" counts are as of the day the forums were archived, and will no longer increase.
list_a0 list_a1 list_a2 . . . list_a99 list_b0 list_b1 list_b2 . . .
# Jedi Knight Cog Script
symbols
thing spinbackdrop0
thing spinbackdrop1
thing spinbackdrop2
thing spinbackdrop3
thing spinbackdrop4
thing spinbackdrop5
thing spinbackdrop6
thing spinbackdrop7
thing spinbackdrop8
thing spinbackdrop9
thing spinbackdrop10
thing spinbackdrop11
thing spinbackdrop12
thing spinbackdrop13
thing spinbackdrop14
thing spinbackdrop15
thing spinner0
thing spinner1
thing spinner2
thing spinner3
thing spinner4
thing spinner5
thing spinner6
thing spinner7
thing spinner8
thing spinner9
thing spinner10
thing spinner11
thing spinner12
thing spinner13
thing spinner14
thing spinner15
thing spinner16
thing spinner17
thing spinner18
thing spinner19
thing spinner20
thing spinner21
thing spinner22
thing spinner23
thing spinner24
thing spinner25
thing spinner26
thing spinner27
thing spinner28
thing spinner29
thing spinner30
thing spinner31
thing spinner32
thing spinner33
thing spinner34
thing spinner35
thing spinner36
thing spinner37
thing spinner38
thing spinner39
thing spinner40
thing spinner41
thing spinner42
thing spinner43
thing spinner44
thing spinner45
thing spinner46
thing spinner47
thing spinner48
thing spinner49
thing spinner50
thing spinner51
thing spinner52
thing spinner53
thing spinner54
thing spinner55
thing spinner56
thing spinner57
thing spinner58
thing spinner59
thing spinner60
thing spinner61
thing spinner62
thing spinner63
thing spinner64
thing spinner65
thing spinner66
thing spinner67
thing spinner68
thing spinner69
thing spinner70
thing spinner71
thing spinner72
thing spinner73
thing spinner74
thing spinner75
thing spinner76
thing spinner77
thing spinner78
thing spinner79
thing spinner80
thing spinner81
thing spinner82
thing spinner83
thing spinner84
thing spinner85
thing spinner86
thing spinner87
thing spinner88
thing spinner89
thing spinner90
thing spinner91
thing spinner92
thing spinner93
thing spinner94
thing spinner95
thing spinner96
thing spinner97
thing spinner98
thing spinner99
thing spinner100
thing spinner101
thing spinner102
thing spinner103
thing spinner104
thing spinner105
thing spinner106
thing spinner107
thing spinner108
thing spinner109
thing spinner110
thing spinner111
thing spinner112
thing spinner113
sector sec
thing player local
int i=0 local
int j=0 local
int k=0 local
int m=0 local
int z=0 local
int section=-1 local
int lastsection=-1 local
int ghost=151 local
int HeapTotal=0 local
int HeapTotalHere=0 local
int Cropped=0 local
int lockpulse=0 local
vector vec local
flex dot local
vector pos local
flex y local
vector origin local
vector playerpos local
vector playerpos2 local
message startup
message pulse
message trigger
end
# ========================================================================================
code
startup:
Sleep(0.2);
player = GetLocalPlayerThing();
pos = vectorset(1,0,0);
origin = vectorset(0,0,0);
HeapNew(GetThingCount()+1000);
for (m=0; m<114; m=m+1)
HeapSet(m+1000, 0.1);
SetPulse(0.05);
Return;
Trigger:
If (GetSourceRef()==55558)
{
HeapTotal=HeapTotal+1;
PrintInt(HeapTotal);
HeapSet(HeapTotal, GetParam(0));
HeapSet(HeapTotal+1000, 0.1);
HeapSet(HeapTotal*3 , GetParam(1));
Return;
}
Return;
pulse:
playerpos=GetThingPos(player);
playerpos2=vectorset(VectorX(playerpos), VectorY(playerpos), 0);
vec = VectorSub(playerpos2, origin);
dot = VectorDot(VectorNorm(vec), VectorNorm(pos));
y = VectorY(vec);
if (dot > 0.951) section=0;
else if (dot > 0.809) section=1;
else if (dot > 0.588) section=2;
else if (dot > 0.309) section=3;
else if (dot > 0.000) section=4;
else if (dot > -0.309) section=5;
else if (dot > -0.588) section=6;
else if (dot > -0.809) section=7;
else if (dot > -0.951) section=8;
else if (dot > -1.000) section=9;
if (y<0) section = 19-section;
if ((section==lastsection) || (lockpulse==1)) Return;
lockpulse=1;
for(i=0; i<16; i=i+1)
JumpToFrame (spinbackdrop0, section, sec);
for(i=0; i<114; i=i+1)
{
JumpToFrame (spinner0, section, sec);
if (HeapTotal>0)
{
for(j=1 ; j<=HeapTotal; j=j+1)
{
if (VectorX(GetThingPos(spinner0))==HeapGet(j))
{
teleportThing(spinner0, ghost);
Print("Second teleport occured");
HeapSet(j+1000, 1);
}
}
}
}
lastsection=section;
if (HeapTotal<=0)
{
lockpulse=0;
Return;
}
HeapTotalHere=HeapTotal;
Cropped=0;
for (k=1; k<=HeapTotalHere; k=k+1)
{
if (HeapGet(k+1000)!= 1)
{
z=k;
while((k<=HeapTotal+1) && (z!=0))
{
if (HeapGet(k+1000+1)== 1)
{
HeapSet(z, HeapGet(k+1));
HeapTotal=HeapTotal-1;
Cropped=k-z+1;
z=0;
}
else
{
k=k+1;
HeapTotal=HeapTotal-1;
}
}
}
else
{
HeapSet(k-Cropped, HeapGet(k));
Print("Heap should be replacing value with the same value");
PrintInt(k);
PrintFlex(HeapGet(k));
}
}
for (m=1; m<=HeapTotal; m=m+1)
HeapSet(m+1000, 0.1);
lockpulse=0;
Return;
End