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 → This really elludes me...
This really elludes me...
2002-10-01, 11:52 AM #1
I have changed the sequencer charge template and class cog, so that it creates another thing after it's creation. The class cog:
Code:
# Jedi Knight Cog Script
# "TI-11" Energywall
# zagibu@gmx.ch

symbols

template	wall=+energywall	local

message		created
message		timer

end

# ========================================================================================

code

created:
	SetTimerEx(2, GetSenderRef(), GetThingSignature(GetSenderRef()), 0);
		
	Return;

# ........................................................................................

timer:	
	if(GetParam(0) == GetThingSignature(GetSenderId()))
	{
		CreateThing(wall, GetParam(0));
		AttachThingToThingEx(wall, GetParam(0), 0x8);
	}

	Return;
end

The strange thing is: The timer message does not seem to get called at all. The created does, though. Any ideas?

There's another problem with class cogs. One of my multiplayer levels seems to prevent some of the standard LEC ones from working. I have not touched the rail detonator, but I see no smoke behind the rails...

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)

[This message has been edited by zagibu (edited October 01, 2002).]
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-10-01, 3:52 PM #2
With new class cogs, you have to define them in the COG Section of the static.jkl you added the weapon template too.

For example, mine looks like so:
Quote:
<font face="Verdana, Arial" size="2">
########## COG scripts #########
Section: cogscripts
World scripts 80
0: class_ballmine.cog
1: class_clustermine.cog
2: else_flash.cog
3: else_stunbolt.cog
4: else_stunboltp.cog
5: kyle.cog
6: else_disrupt.cog
7: class_seeker.cog
8: class_cseeker.cog
9: else_radblind.cog
10: class_flashmine.cog
11: else_flashmine.cog
end
################################
</font>


That fixed up most of the problems i had. And how can you tell the message isn't being called but the created is? Isn't the created UNDER that message?
2002-10-01, 11:37 PM #3
I was referring to the created: message. And I can tell the timer: message is not get called, because I have put these lines after it:
Code:
jkStringClear();
jkStringConcatAsciiString("it works");
jkStringOutput(-3, -1);

But it never prints anything. Anyway, I'm gonna try that with the static.jkl...

------------------
"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)
2002-10-01, 11:54 PM #4
False alarm. Everything works fine, except the thing is not being created. I have that now:
Code:
symbols

template	wall=+energywall	local

message		created
message		timer

end

# ========================================================================================

code

created:
	SetTimerEx(2, GetSenderRef(), GetThingSignature(GetSenderRef()), 0);
	jkStringClear();
	jkStringConcatAsciiString("created");
	jkStringOutput(-3, -1);

	Return;

# ........................................................................................

timer:
	jkStringClear();
	jkStringConcatAsciiString("timer");
	jkStringOutput(-3, -1);

	if(GetParam(0) == GetThingSignature(GetSenderId()))
	{
		jkStringClear();
		jkStringConcatAsciiString("if");
		jkStringOutput(-3, -1);

		FireProjectile(wall, GetParam(0), -1, -1, '0 0 0', '0 0 0', 1, 0x20, 0, 0);
		//AttachThingToThingEx(wall, GetParam(0), 0x8);
	}

	Return;
end

And when I fire a seqcharge, it prints out:
created
timer
And after two seconds:
timer
if

BUT, it does not fire the damn projectile...

------------------
"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)
2002-10-02, 4:18 AM #5
Since it has the flags of ox20 (in the FireProjctile) it want the autoaim, but since there is none, JK get all [http://forums.massassi.net/html/confused.gif] and won't fire it, change the flags to 0x0 and it should work, and if not, switch to GetSourceRef() but I don't think you'll have to. [http://forums.massassi.net/html/wink.gif]


BTW, Print("blah") is so much easier to type. You use the concat string stuff for when you want to insert things into line like "blah blah x blah" and you can have x = anything, so don't listen to GBK on this point. [http://forums.massassi.net/html/tongue.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

[This message has been edited by Descent_pilot (edited October 02, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-10-02, 5:30 AM #6
Quote:
<font face="Verdana, Arial" size="2">Since it has the flags of ox20 (in the FireProjctile) it want the autoaim,</font>

What Pilot said, and also:
Code:
FireProjectile(wall, GetParam(0),

should be:
Code:
FireProjectile(parent, template,


Quote:
<font face="Verdana, Arial" size="2">I have not touched the rail detonator, but I see no smoke behind the rails...</font>


Make sure that the rail's class cog is running and that the smoke template is in the JKL. Without more information, that's all I can think of.

Quote:
<font face="Verdana, Arial" size="2">With new class cogs, you have to define them in the COG Section of the static.jkl you added the weapon template too.</font>


Note that there's a big difference between the Cog section and the Cogscripts section. The Cog section is for level-specific cogs, and the Cogscripts section is for class cogs.

Also, JK doesn't seem to be very strict on defining class cogs in their section - upping the count usually works, but you should define them anyway.

Quote:
<font face="Verdana, Arial" size="2">BTW, Print("blah") is so much easier to type.</font>


Ditto. [http://forums.massassi.net/html/wink.gif] And I have never had a Print() fail to print its text. And I don't see why the concat verbs would be any more reliable.

It's only worth using the concat verbs for debugging when you want to print to other computers or when you need something like hex output.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-10-02, 7:04 AM #7
Did not work. Updated cog:
Code:
symbols

template	wall=+energywall	local

message		created
message		timer

end

# ========================================================================================

code

created:
	SetTimerEx(2, GetSenderRef(), GetThingSignature(GetSenderRef()), 0);

	Print("created");
	Return;

# ........................................................................................

timer:
	Print("timer");
	if(GetParam(0) == GetThingSignature(GetSenderId()))
	{
		Print("if");
		CreateThing(wall, GetParam(0));
		//AttachThingToThingEx(wall, GetParam(0), 0x8);
		Print("creatething done");
	}

	Return;

end

The thing gets created when I move the CreateThing to the created: message. So it can't be the template that's wrong. It does not work with FireProjectile(), either.

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)

[This message has been edited by zagibu (edited October 02, 2002).]
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-10-02, 7:32 AM #8
I just played Canyon Oasis, fire one of those damn things...and it got created! But 100 feet away. So it seems the GetParam(0) is not returning the right thing...strange.

------------------
"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)
2002-10-02, 11:35 AM #9
It should be GetSenderID() that the thing is created at. The first param is the signature. After fixing that it should work. [http://forums.massassi.net/html/wink.gif]

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-10-02, 1:14 PM #10
And once again, SaberMaster saves the day...

------------------
"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)
2002-10-03, 6:57 AM #11
Glad I could help. [http://forums.massassi.net/html/wink.gif]

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

↑ Up to the top!