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 → R2 Unit repairs panel
R2 Unit repairs panel
2001-12-02, 8:44 AM #1
I want this cog to open a door when panel is damaged. You damage panel, door opens, r2 unit comes out repairs panel and goes back, doors close. But it doesn't work...

symbols

message damaged
message pulse

surface panel linkid=1
thing sparkspos local
thing door
thing r2

template sparks=+sparks
int status=0 local


end

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

code
damaged:
sparkspos = GetSurfaceCenter(panel);
if(GetSenderID() == 1)
{
status = 1;
SetSurfaceCel(panel,1);
SetPulse(1);
Sleep(1.0);
MoveToFrame(door, 1, 8);
WaitForStop(door);
AiSetMoveFrame(r2, 1);
WaitForStop(r2);
AiSetMoveFrame(r2, 2);
WaitForStop(r2);
AiSetLookPos(r2, sparkspos);
Sleep(10.0);
SetPulse(0);
AiSetMoveFrame(r2, 1);
WaitForStop(r2);
AiSetMoveFrame(r2, 0);
WaitForStop(r2);
MoveToFrame(door, 0, 1);
Sleep(1.0);
act = 0;
}
else
if(status == 1) return;
return;

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

pulse:
CreateThing(sparks, sparkspos);
return;

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

end

Maybe this helps to imagine how it's meant to be:
[http://www.massassi.net/ec/images/1861.jpg]

------------------
*Elmo is Elmo
Elmo's JK Corner

[This message has been edited by Elmo (edited December 02, 2001).]
* Elmo is Elmo
2001-12-02, 11:21 AM #2
It took me 2 seconds to find your problem.


You forgot to apply the damage mask to the panel. It should be:


Surface Panel LinkID=1 Mask=0x448


That should fix the problem.



------------------
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!