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 → Insight please...
Insight please...
2002-02-26, 4:20 PM #1
I've modified the 00_aisleep.cog like so:

symbols
message startup
message entered
message user0

thing door

thing enemy1 linkid=1
thing enemy2 linkid=1
thing enemy3 linkid=1
thing enemy4 linkid=1
thing enemy5 linkid=1

thing ally1 linkid=2
thing ally2 linkid=2
thing ally3 linkid=2
thing ally4 linkid=2
thing ally5 linkid=2

sector trigger

sound stleader
sound rtleader

int awake=0 local
end

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

code

startup:
AISetMode(GetSenderID(1), 0x2000);
AISetMode(GetSenderID(2), 0x2000);
Return;

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

entered:
MoveToFrame(door, 1, 8.0);
AISetMoveSpeed(GetSenderID(1), 1.5);
AISetMoveThing(GetSenderID(1), ghostpos);
WaitForStop(enemy5);
MoveToFrame(door, 0, 8.0);
AIClearMode(GetSenderID(1), 0x2000);
AIClearMode(GetSenderID(2), 0x2000);
AISetMode(GetSenderID(1), 0x200);
AISetMode(GetSenderID(2), 0x200);
PlaySoundThing(stleader, enemy1, .75, 0, 4.75, 0x80);
PlaySoundThing(rtleader, ally1, .75, 0, 4.75, 0x80);
Return;

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

user0:
call entered;
return;

end


And it's not working. Where am I going wrong?
Also, I didn't put user0 there and have no idea why it is being used, LEC put it there.
Massassi, delivering a million smiles a day. Well...almost. ;-)
2002-02-26, 5:17 PM #2
Whoops!
Silly me, I forgot to include the "ghostpos" in the Symbols section. I fixed that and did away with the user0 message, and it still doesn't work...what exactly is the user0 there for, if anything?
Massassi, delivering a million smiles a day. Well...almost. ;-)
2002-02-26, 5:25 PM #3
I'm not sure how I would setup sending the actor ID's into the cog but

GetSenderID()

does not have any paramaters.

Meaning use:

GetSenderID()

not

GetSenderID(1)

Also according to the JKSpecs it looks like GetSenderID() only returns values when sent with SendTrigger() or SetTimerEx() and you dont have a trigger: or timer: section.
- Wisdom is 99% experience, 1% knowledge. -
2002-02-26, 6:01 PM #4
Actully, no. Entered, activated, damaged, kissed, all will send SenderIDs.

------------------
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-02-26, 8:23 PM #5
lol

Too much of those GBK? [http://forums.massassi.net/html/biggrin.gif]

------------------
http://millennium.massassi.net - Millennium
Sniper Arena! - Enhancement Pack!
2002-02-27, 2:48 AM #6
[http://forums.massassi.net/html/smile.gif]

So what's the problem then?
Massassi, delivering a million smiles a day. Well...almost. ;-)
2002-02-27, 3:06 AM #7
can you use arrays with things? cause if you can you could array them instead i guess
roses are red, violets are blue, I am schizophrenic, and I am too!
2002-02-27, 5:25 AM #8
You cant use SenderIDs in this way. Arrays would be the simplest answer.



For(I=0;I<5;I=I+1) {

AIoddballcommand(Enemy0, param); }



Youll need to add the int I to your symbols, and rearrange your actors to start at 0, not 1.

------------------
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-02-27, 8:37 AM #9
I'm not sure I'm following you exactly...in regards to the integer I.
In the Symbols section, I'd add:
int I=(something)
Or do I not have to specify a specific value...?

And where exactly does this go?
"For(I=0;I<5;I=I+1)"

I've never used arrays before, nor integers all that much, so I'm a bit unfamiliar with their setup.

By the way, I assume I don't need the "awake=0" integer that LEC stuck in there, as it doesn't seem to be being used...
Massassi, delivering a million smiles a day. Well...almost. ;-)
2002-02-27, 9:04 AM #10
Oh...hang on. I think I get the idea now, after reading up on Arrays in SB's DataMaster reference (a very a good resource, I might add).

In whichever message I want to use I, I'd put:
For(I=0; I<5; I=I+1) Ai*xxxx*(Enemy0, param);

Is that it? And I don't assign a value to I in the symbols section...


[Or, I could do this:
For(I=0; I<5; I=I+1);
{
do whatever
}
No?]

[This message has been edited by Cguy (edited February 27, 2002).]
Massassi, delivering a million smiles a day. Well...almost. ;-)
2002-02-27, 9:23 AM #11
Bingo. [http://forums.massassi.net/html/smile.gif]

------------------
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-02-27, 9:40 AM #12
wow i was right i am soo proud of myself [http://forums.massassi.net/html/smile.gif]
roses are red, violets are blue, I am schizophrenic, and I am too!
2002-02-27, 9:53 AM #13
[http://forums.massassi.net/html/smile.gif]

The cog, after a bit of rewriting:
symbols
message startup
message entered

thing door
sound doorsnd

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=6.375/-3.525/0.05

sound stleader
sound rtleader

int I
end

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

code

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

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

entered:
MoveToFrame(door, 1, 6.0);
PlaySoundThing(doorsnd, door, .5, 0, 4.75, 0x0);
For(I=0; I<5; I=I+1)
{
AiSetMoveSpeed(enemy0, 1.5);
AiSetMoveThing(enemy0, ghostpos);
ifAiGetMovePos(enemy4)==st5vect
{
Sleep(.2);
MoveToFrame(door, 0, 6.0);
PlaySoundThing(doorsnd, door, .5, 0, 4.75, 0x0);
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


The door isn't opening, however. I'm assuming everything else works, and the door is just preventing it from happening, since I used "ifGetMovePos()".
Seeing as how it's a locked door, would that cause a problem? I would think I'd be able to operate the same door within a separate cog, regardless of whether it was locked or not...but maybe not.
Massassi, delivering a million smiles a day. Well...almost. ;-)
2002-02-27, 10:35 AM #14
Nope. Door cogs have a strange tendency to inter-operate with each other when they are tied to the same object.


Check your door, make sure you have the frames set up properly.


------------------
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-02-27, 11:01 AM #15
Several things...

1) You need to have parentheses around a condition. So instead of:

ifGetSomething()==1

use:

if(GetSomething() == 1)

2) You can't define vectors in the symbols section like that.

3) AIGetMovePos() does not work properly.

4) I don't think you need to set the AI modes as you are. And what is this 0x2000 AI Mode?

5)
Code:
For(I=0; I<5; I=I+1);
{
do whatever
}


Bad mistake there. That semicolon on the end of the for statement will make JK think that the loop has no code associated with it. Then the "do whatever" code would run like a normal code block.

BTW, I'm glad that tutorial was helpful. [http://forums.massassi.net/html/smile.gif]

Fix those mistakes and if it still doesn't work, I'll test the cog. BTW, you should get CogWriter to check your syntax.

------------------
Author of the Jedi Knight DataMaster.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-02-27, 12:52 PM #16
1) You need to have parentheses around a condition.

Hum. I always thought they weren't necessary, but you could if you wanted to.

2) You can't define vectors in the symbols section like that.

Really? That's a new one on me...

4) I don't think you need to set the AI modes as you are. And what is this 0x2000 AI Mode?

Haven't a clue, LEC put it in there. [http://forums.massassi.net/html/smile.gif] The AiSetMode() functions seemed to work before, in the original cog.

I stuck the "st5vect" under startup, like so:
st5vect = 6.375/-3.525/0.05

I presume that's acceptable?

Thanks for all the help, by the way. [http://forums.massassi.net/html/smile.gif]
Massassi, delivering a million smiles a day. Well...almost. ;-)
2002-02-27, 4:51 PM #17
No, no. You means, that is the incorrect format. This is the correct format:


Vector Dir=(0/0/0)


NO SPACES between the variable and the definition.

------------------
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-02-27, 5:47 PM #18
I've seen spaces used dozens of times before in LEC's cogs, without any seeming ill effects...

So what exactly does Vector Dir=0/0/0 do for me, and where is it supposed to go?
Massassi, delivering a million smiles a day. Well...almost. ;-)
2002-02-27, 6:09 PM #19
<sighs > Hopeless case...

Symbols
Vector Dir=(0/0/0)
End
Code
CRAP GOES HERE.
End

 

DONT FORGET THE PARENTHESIS!

(0/0/0)

------------------
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-02-27, 7:17 PM #20
temper, temper..
2002-02-28, 5:03 AM #21
You might want to double-check that, GBK. I think that you can define vectors from the JKL, but not directly in the symbols.

------------------
Author of the Jedi Knight DataMaster.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-02-28, 5:09 AM #22
Oh...
[http://forums.massassi.net/html/smile.gif]

If you communicated yourself lucidly enough the *first* time, there wouldn't've been any confusion, now would there? [http://forums.massassi.net/html/tongue.gif]
Massassi, delivering a million smiles a day. Well...almost. ;-)
2002-02-28, 5:46 AM #23
Hmm, your right. I just tried it. Oh well. [http://forums.massassi.net/html/frown.gif]

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

↑ Up to the top!