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 → "Touched" Message for All Surfaces
"Touched" Message for All Surfaces
2001-05-26, 12:01 AM #1
How would you go about making a cog that does something when a specified thing touches ANY surface in a level? (ie. a "touched" message is sent every time the thing touches a surface). I'd imagine it would probably involve using masks, but I'm not sure how.
2001-05-26, 6:32 AM #2
Off the top of my head, short of attaching a cog to EVERY surface, I would use a blocked message on the thing. If the thing is blocked, it has hit something. GetSenderID is the thing, GetSourceRef would be the thing doing the blocking. However, I'm not sure if geometry will throw that message. Try it and find out.
2001-05-26, 8:01 AM #3
Thanks, I'll try. I suppose the geometry should send the blocked message because the message probably works by checking if a thing is actually blocked, not just if it touches something. I thought the blocked message only worked for things with a frame\path movement though, and the thing I'm using moves by SetThingVel();
2001-05-26, 8:09 AM #4
[http://forums.massassi.net/html/frown.gif] Didn't work. Any other suggestions (other than adding all the surfaces to the cog). It's a pity there's no GetAllWorldSurfaces(); verb or something like that.
2001-05-26, 8:19 AM #5
Couldn't you use a for loop to loop through all the surfaces?

------------------
Together we stand.
Divided we fall.
2001-05-26, 10:25 AM #6
I never knew you could use a for loop for that. How would I go about doing it?
2001-05-27, 1:19 AM #7
There is an alternative method without hacking all surfaces.

You must modify the template of the thing that you want it to affect the surfaces.

In this method I don't think you can get the specified wall reference, but if that is not neccesary for you, it may do fine.

In the template of a thing, make its type "weapon" (If you give the parent template as "_weapon", it does it), give its type flag, so it gets exploded on every surfaces out there.

Then on the exploding template(make the parent template as "_explosion"), attach a cog(which you also need to add thingflag 0x400), and let the new cog to do something.

That way when it explodes(you don't need to give any effects on the exploding template, if you don't want anything visiual on hitting surfaces), the explosion gets created calling its cog to do something.

------------------
http://millennium.massassi.net/ - Millennium
2001-05-27, 5:26 AM #8
Genius [http://forums.massassi.net/html/smile.gif]
2001-05-27, 8:26 AM #9
Great! I can't thank you enough! I just hope it works, but it looks like it will.
2001-05-28, 7:42 AM #10
It didn't work properly that way, but I've managed to sort it out anyway by doing something else. Thanks anyway.
2001-05-29, 12:14 AM #11
Your a genius Hedeki ....
2001-05-29, 1:13 PM #12
I was going to suggest you talk with Hideki... [http://forums.massassi.net/html/wink.gif]

There is a way to get all surfaces. A surface reference is just a number - if you know how many there are, you can iterate through all of them.
2001-05-29, 2:29 PM #13
Case by case.

------------------
http://millennium.massassi.net/ - Millennium

↑ Up to the top!