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 → mask........
mask........
2001-11-28, 6:22 AM #1
How do I use it? (ain't much said in JKspecs) Would it make player specific messages like sighted and touched work with actors?

------------------
-Hell Raiser
Cogging Guru
It's funtastical merriment time!
-Hell Raiser
2001-11-28, 6:51 AM #2
As long as you defined them in the symbols section, or used 'Capturething()' on them, those commands should work.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-28, 7:52 AM #3
Well, I'm trying to get touched to work with actors so my projectile/actor hybrid will explode when it hits a wall. I tried CatureThing() just now and it didn't work.

------------------
-Hell Raiser
Cogging Guru
It's funtastical merriment time!
-Hell Raiser
2001-11-28, 9:06 AM #4
Ive never had a problem with it. Although I might be misunderstanding what you need. I would try something like this:


Code:
Blah:
Missile = Fireprojectile(Lots, of, args);
Capturething(Missile);
Stop;

Entered:
Touched:
If(Getsenderref() == Missile) {
Dostuff(Lots, of, stuff); }
Stop;




------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-28, 10:08 AM #5
I know you have to mask stuff like surfaces if you want damaged:, etc. to work on them.. you couldn't use CaptureThing() for that, though.. right?
2001-11-28, 11:15 AM #6
Nope. Capturething() only works on things.. (Duh..)

Yes, you apply Masks so surfaces send Damaged: messages, but I am unaware of a need to do anything similar for things.


------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-28, 11:47 AM #7
I did exactly that GBK with some print statements, and it only printed out when it hit me, or another pojectile/actor hybrid.

[edit]Just saw the entered: message in your code, gonna try that next[/edit]

------------------
-Hell Raiser
Cogging Guru
It's funtastical merriment time!

[This message has been re-edited by Hell Raiser (re-edited November 28, 2001).]

[This message has been edited by Hell Raiser (edited November 28, 2001).]
-Hell Raiser
2001-11-28, 12:00 PM #8
Heres a thought. Wouldnt Impact damage work? Run it off the Damaged: message? As in, when the actor/projectile hits a surface/thing, it sends out a Damaged message.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-28, 12:16 PM #9
I haven't used masks, but you're trying the make a cog recieve messages from your actor/proj missiles, right?

Why don't you associate the cog to the missile though the missile's template? Just put cog=yourcog.cog in the missile's template line, and your cog will recieve the messages of all things which use that template.

------------------
There we were, three against a thousand. They came at us with knives, clubs, and spears. Bodies fell left and right...

They were the toughest three we ever fought.

[This message has been edited by SaberMaster (edited November 28, 2001).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-11-28, 12:58 PM #10
I already have the template linked to a cog. When I tried the entered: message, it did squat. Even with just a print statement and no ifs, it didn't print. If I could find out why it won't work, then I'd have it made in the shade. Here's what I've got:

Code:
# Test

symbols

thing		TestProj			local

message		created
message		touched
message		entered

end

code

created:

	Print("BWA!");
	TestProj = GetSenderRef();
	CaptureThing(TestProj);

return;

touched:

	if(GetSenderRef()==TestProj)
	{Print("TestProj, touched a thing!");}
	

return;

entered:

	Print("Bwa!2");

	if(GetSenderRef()==TestProj)
	{Print("TestProj, touched a wall");}

return;

end


It prints out "BWA!" when it's fired, which is good, cuz I know I haven't fudged anything. It prints out "TestProj touched a thing!" when it hits another projectile/actor hybrid and me. But it fails to print "Bwa!2" and "TestProj touched a wall" doesn't even matter untill I can get it to print "Bwa!2"....

Did I do something wrong? I'm not really keen on sector/surface type cogging, stuff you need in levels.

[edit]Well color me 65535 shades of idiot, I forgot the [/code] tag, lol[/edit]

[This message has been edited by Hell Raiser (edited November 28, 2001).]
-Hell Raiser
2001-11-28, 1:30 PM #11
I guess using touched message doesn't need a thing to work on a projectile, as I remember from writing the giving effects on proj tutorial.

------------------
http://millennium.massassi.net/ - Millennium
2001-11-28, 1:33 PM #12
No, sorry that't not right. It works because the thing is registered in the static.jkl.

But touching wall also gets called by "touched" message, not "entered".

Do both "mask" and "capture" so it should work.

------------------
http://millennium.massassi.net/ - Millennium
2001-11-28, 1:36 PM #13
Touched: works exactly the way I want it to. It's entered: that's givin me probs. =\

[edit]ok, how do I use mask?[/edit] (your second post showed up after I posted)

[This message has been edited by Hell Raiser (edited November 28, 2001).]
-Hell Raiser
2001-11-28, 1:42 PM #14
Entered: isnt going to work in this case.


The only way an object would send that out is if something stood on it...

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-28, 2:56 PM #15
Using mask is shown in darkjedi cogs.

thing darkjedi mask=0xfff


------------------
http://millennium.massassi.net/ - Millennium
2001-11-28, 3:11 PM #16
You're about 15 mins too late Hideki, I found it out, buuuuut, I'm not sure of the flags to put on it. I've got this:

thing TestProj Mask=0x400 local

but touched: still doesn't get called if it hits a surface, niether does entered:

Oh, BTW, CaptureThing(); doesn't need to be used for touched: like I previously thought. The JKspecs were decieving. "Sent by a surface or thing when player collides with it."
-Hell Raiser
2001-11-28, 8:18 PM #17
Nobody knows what flag is for what messages. So I suggest you go with 0xfff which should capture all messages.

jkspec was written like 3 years ago? Man give it a break! It's the bible of jk editing.

------------------
http://millennium.massassi.net/ - Millennium
2001-11-29, 5:38 AM #18
I tried 0xfff and entered: won't work, and touched: only sends messages for things touched. [http://forums.massassi.net/html/frown.gif]

------------------
-Hell Raiser
Cogging Guru
It's funtastical merriment time!
-Hell Raiser
2001-11-29, 5:57 AM #19
Quote:
<font face="Verdana, Arial" size="2">Originally posted by GBK:
Entered: isnt going to work in this case.


The only way an object would send that out is if something stood on it...

</font>




------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-29, 6:08 AM #20
Right, doh!

But still, shouldn't touched: work? =\
-Hell Raiser
2001-11-29, 10:22 AM #21
About that cog, HR:

1) You don't need to capture the thing. Because the cog is associated with the actor-proj in it's template, it will already receive the actor-proj's messages.

2) The entered message is for sectors and surfaces. Why would it work with an actor?

To find if your actor-proj hit a wall, try attaching a projectile to your actor-proj. The attached projectile will explode when it hits a wall and you can use the proj's removed message to tell your actor-proj's cog the attached proj has been destroyed.

That system is not perfect, but it's the best way I know of.

Hideki:

He shouldn't need to use mask or capturething() because the cog is already recieving the actor-proj's messages.

GBK:

I think that the touched message is called in a surface's, player's, actor's, and maybe proj's cog when an actor or player touches it.

And by "send that out" do you mean that the object would send the message to the sourceref as well as itself? AFAIK, cogs do not receive messages from objects not associated with them.

[This message has been edited by SaberMaster (edited November 29, 2001).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-11-29, 11:10 AM #22
Your right, cogs wont recieve massages from noncaptured things. Either from definition in the symbols section, or 'Capturething()' in the code.


But a thing will send the 'Entered' message, if it it flagged as 'Can be stood on', and you stand on it. Go ahead, try it...

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.

↑ Up to the top!