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 → SetThingClassCog()
SetThingClassCog()
2004-08-28, 10:46 PM #1
Is there an alternative to this verb? Or do you have an idea how I could achieve the following without using it:

- Create a new thing that has a custom 3do and reacts on touches without using a static.jkl, items.dat and standard cogs except JK singleplayer ones (e.g. item_keyyellow.cog)

What I did until now is create a healthpack template, send a trigger with a reference to it, retrieve this trigger in item_keygreen.cog and use SetThingClassCog(GetParam(0), GetSelfCog()) to give it a new class cog.
The problem is, that the SetThingClassCog() does not always work on client computers. I've added PrintInt(GetSelfCog()) and PrintInt(GetThingClassCog(GetParam(0))) right after it, and while they always match for the host, a client sometimes gets a -1 for the second print. But there are other times when it just works great...

------------------
"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-08-28, 10:56 PM #2
CaptureThing() works for me.

------------------
I am _ Ace_1 _ , and I approve this message.
I am _ Ace_1 _ , and I approve this message.
2004-08-28, 11:51 PM #3
Gonna test it right now.

------------------
"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-08-29, 12:15 AM #4
Doesn't work. Same behaviour as with SetThingClassCog(). Here is my code:
Code:
trigger:
	if(GetSourceRef() == 20920)
	{
		holo = GetParam(1);
		CaptureThing(holo);
		SetThingFlags(holo, 0x1000000);
		SetThingModel(holo, holoModel);
		SetThingLook(holo, '0 1 0');
		SetThingUserData(holo, 999999);
		started = 0;
	}

	Return;


------------------
"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-08-29, 8:47 AM #5
The problem is likely a classic case of using the wrong thing number because each computer will create the same thing but they might use different numbers.

To check if this is happening, you could print the thing number right after you create the "healthpack" thing (before you send the trigger). Also, print the thing number in the cog receiving the trigger (item_keygreen.cog). The thing number will always be the same on the host (server) because it is the same computer for both before and after the trigger. On a client, it will sometimes be the same, but sometimes it will be different.

The solution here is to move the create thing verb (whichever one you are using) to item_keygreen.cog after receiving the trigger.

Let us know the results of doing this, if you try it.

[http://forums.massassi.net/html/smile.gif]
2004-08-29, 9:25 AM #6
Quote:
<font face="Verdana, Arial" size="2">Originally posted by ZeqMacaw:
The problem is likely a classic case of using the wrong thing number because each computer will create the same thing but they might use different numbers.

To check if this is happening, you could print the thing number right after you create the "healthpack" thing (before you send the trigger). Also, print the thing number in the cog receiving the trigger (item_keygreen.cog). The thing number will always be the same on the host (server) because it is the same computer for both before and after the trigger. On a client, it will sometimes be the same, but sometimes it will be different.

The solution here is to move the create thing verb (whichever one you are using) to item_keygreen.cog after receiving the trigger.

Let us know the results of doing this, if you try it.

[http://forums.massassi.net/html/smile.gif]
</font>

Ok, I'll try the print thing. Not sure about moving the creation to the client cog...might result in multiple instances of the same thing. Anyway, won't be able to try it till tomottow evening at the earliest.

------------------
"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)

↑ Up to the top!