Massassi Forums Logo

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.

ForumsCog Forum → Thing won't create.
Thing won't create.
2004-03-10, 11:10 AM #1
Hi!
I have here a piece of code.
Code:
pulse:
	if(GetThingSector(GetLocalPlayerThing())!=prev)
	{
		SetCameraFocus(1,GetLocalPlayerThing());
		if(gh!=-1) DestroyThing(gh);
		gh=-1;
		
			vertexpos=GetSectorVertexPos(GetThingSector(GetLocalPlayerThing()), rand()*GetNumSectorVertices(GetThingSector(GetLocalPlayerThing())));
			thevertex=VectorAdd(vertexpos, VectorScale(VectorNorm(VectorSub(GetSectorCenter(GetThingSector(GetLocalPlayerThing())), vertexpos)), 0.1));
			gh=CreateThingAtPos(g,GetThingSector(GetLocalPlayerThing()),thevertex,'0 0 0');
		
		CaptureThing(gh);
	}
	prev=GetThingSector(GetLocalPlayerThing());
	lv=VectorSub(GetThingPos(gh),GetThingPos(GetLocalPlayerThing()));
	lvr=VectorSet(-VectorX(lv),-VectorY(lv),-VectorZ(lv));
	SetThingLook(gh,lvr);
	SetCameraFocus(1,gh);
return;

Problem: In a custom levels (Dead Reckoning), the ghost is not created. When I add a while(gh==-1) around the creation of the ghost object, the game freezes. Could someone tell me, why my ghost ain't being created?

/Edward
Edward's Cognative Hazards
2004-03-10, 12:34 PM #2
Print all the vectors and check if one of them is invalid or something...

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2004-03-10, 4:46 PM #3
I seem to remember something about JK not being able to create the first template listed in the .jkl while in-game, and JED sometimes puts the ghost template first, so JK can't create it in-game.

------------------
*Takes out his blaster and fires shots at the wall, the blastmarks leave the words "S-TROOPER WUZ 'ERE!!!"
2004-03-10, 11:23 PM #4
Hm... Then... What if I create an invisable streetlightlamp. That could work... Maybe... Testing... OK, that worked for DR. I'll try others later...

/Edward
Edward's Cognative Hazards
2004-03-10, 11:53 PM #5
OK, I fixed it. I was hoping to get away with a non-static.jkl Mod, but I guess that's out of the question...

Thanks for the info!

/Edward
Edward's Cognative Hazards
2004-03-11, 7:17 AM #6
I encounted this *ALOT* when I was working on the TVTCS. It bugged the hell out of me too, because I was using ghosts for alot of stuff. I usually got around it by using the light0.1 template....

------------------
The future is here, and all bets are off.
And when the moment is right, I'm gonna fly a kite.

↑ Up to the top!