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 → S'more related help...
S'more related help...
2002-03-04, 4:36 PM #1
... [http://forums.massassi.net/html/smile.gif]

This damn thing has been giving me fits...to say the least...

Anyway, I can use this condition like so, right?

if(GetThingSector(enemy0)==trigger2)
{
SetThingCaptureCog(door, doorkey);
}

And then in the doorkey cog itself, I'd have to check whether that condition had been met, right? If that's the case, would I use GetThingCaptureCog();?

[By the by, I'm making use of the 00_doorkey.cog, in this instance.]

Oh, and if you don't the have the slightest idea of what I'm talking about, just refer to my post from a few days ago. [http://forums.massassi.net/html/smile.gif]
Massassi, delivering a million smiles a day. Well...almost. ;-)
2002-03-04, 5:59 PM #2
It would be easier to ditch the other cogs, and incorperate the door code into your cog.

------------------
Success is the inverse relationship between effort, gain, and loss.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-03-05, 4:43 PM #3
That's what I thought, initially. [http://forums.massassi.net/html/smile.gif]

I'd still have to set it up in a particular way, however, as I would only want it to function as a locked door after the other stuff took place.

Here's the cog as it stands now:

symbols
message startup
message entered

thing door

thing enemy0
thing enemy1
thing enemy2
thing enemy3
thing enemy4

thing ally0
thing ally1
thing ally2
thing ally3
thing ally4

sector trigger
thing ghostpos
vector st5vect

sound stleader
sound rtleader

int I
int player local
end

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

code

startup:
For(I=0; I<5; I=I+1)
{
AiSetMode(enemy0, 0x2000);
AiSetMode(ally0, 0x2000);
}
Return;

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

entered:
if(GetThingSector(player)==trigger)
{
MoveToFrame(door, 1, 6.0);
For(I=0; I<5; I=I+1)
{
AiSetMoveSpeed(enemy0, 1.5);
AiSetMoveThing(enemy0, ghostpos);
if(AiGetMovePos(enemy4)==st5vect)
{
Sleep(.2);
MoveToFrame(door, 0, 6.0);
AiClearMode(enemy0, 0x2000);
AiClearMode(ally0, 0x2000);
AiSetMode(enemy0, 0x200);
AiSetMode(ally0, 0x200);
PlaySoundThing(stleader, enemy0, .75, 0, 4.75, 0x80);
PlaySoundThing(rtleader, ally0, .75, 0, 4.75, 0x80);
}
}
}
Return;

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


end


And, as I said, I want to incorporate it with 00_doorkey.cog.
I'm just not too sure on how "exactly" I'd combine them to work correctly, in the manner I described above.
Massassi, delivering a million smiles a day. Well...almost. ;-)
2002-03-05, 6:32 PM #4
The following is a snippet of code, that should help...

Code:
Message Activated
Message Arrived
Message Timer
Int Key_bin
Int L=0    Local

 

//Blah blah blah...


 

Activated:
If(Getsenderref() != Door) Stop;

If(Getinv(Player, Key_bin) != 0 || L == 0) Call Opendoor;
Stop;

Opendoor: Movetoframe(Door, 1, 6.0); Stop;

Arrived:
If(Getsenderref() == Door && Getcurframe(Door) == 1) Settimer(0.2);
Stop;

Timer: Movetoframe(Door, 0, 6); Stop;




A bit sloppy, but it should help. Add that under your code, and add 'L=1;' to your Entered code.

 

BTW, 'Key_bin' is the BIN number of the required key.

------------------
Success is the inverse relationship between effort, gain, and loss.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-03-06, 12:57 PM #5
Ok...
What's the point of saying that ifGetInv(blahblah) is not equal to 0?
I'm not seeing how that makes a difference...
Where are you getting the 0 from?

I imagine I can set Key_bin=47 in the symbols, no?

Actually, I don't follow the ifGetSenderRef() is not equal to door, either.

If you could just elaborate on that a bit, I could figure out where you're coming from. [http://forums.massassi.net/html/smile.gif]
Massassi, delivering a million smiles a day. Well...almost. ;-)

↑ Up to the top!