PDA

View Full Version : This is driving me insane.



Lord_Grismath
11-19-2003, 10:30 PM
# 01_conv_kapa.cog
# [Burrie] [Grismath]
# Handles the conversation with Ka'Pa the Hutt.

symbols

Message Activated
Message Pulse
Message Playeraction
Message EndConv

Thing Camera
Thing droid
Thing MainCam

Int Player Local
Int Conversation=0 Local

cog adventure

end

code

Activated:

SetCurrentCamera(0);
SetCameraFocus(0, Camera);

SetActionCog(-1, 0);
SetActionCog(GetSelfCog(), 0x7FFFFFFF);

SetPulse(1);
return;
Pulse:

Print("KA'PA: Yo dude, what's up?");
Print("1. Who are you?!");
Print("2. What are you doing in by bedroom?");
Print("3. How can I get out of here?");
Print("4. Why are you toting a copy of Jedi Outcast?");

Return;

Playeraction:

ReturnEx(0);

If(GetParam(0) != 7) Return;

If(GetParam(2) == 13)
{
SetPulse(0);
Print("KA'PA: I'm a brutha Hutt trying to make");
Print(" a living in a cruel world. Y'dig, cat?");
Print("");
Print("");
Print("");
Sleep(2.5);
}

If(GetParam(2) == 14)
{
SetPulse(0);
Print("KA'PA: I'm a wayward kinda sluggy thing,");
Print(" one day I might be in a palace, the next a");
Print(" hip night club. Today I happen to be in");
Print(" your bedroom, yo. Nice pad.");
Print("");
Sleep(2.5);
}

If(GetParam(2) == 15)
{
SetPulse(0);
Print("KA'PA: Oh yeah... I locked the door, sorry.");
Print(" Always one step ahead of the man. I have the");
Print(" key right... uh-oh... uhhh... sorry, dude.");
Print(" It's around here somewhere.");
Print("");
Sleep(2.5);
}

SetCurrentCamera(0);
SetCameraFocus(0, MainCam);

Print("Blargh");


SetActionCog(-1, 0);
SendMessage(adventure, user1);
SetActionCog(adventure, 0x7FFFFFFF);

Print("Blargh2");

Return;
end


For some unfathomable REASON (or lack thereof) the adventure cog does not become the ActionCog, nor does it even display the message I have it give when it receives the user1 message:


user1:
Print("ACTIVE");
active=1;
return;


I am in desperate and urgent need of help for this.

lucky_jackpot
11-20-2003, 03:47 PM
Hi there http://forums.massassi.net/html/smile.gif

From an initial glance, (I'm sorry I have to ask this) but... does any part of your cog script work? I mean in terms of printing lines out? I've got to say - I'm a believer in the old-fashioned "block-it-out-until-it works" type of cogger (obviously leaving the "return" of that message block in http://forums.massassi.net/html/wink.gif)

Also, there's no need to declare a "custom-made" message call, such as "EndConv" - once you use a "call" statement, the game engine deals with the rest (we'll ignore the fact that you've declared it in the symbols section but then haven't defined/used it in the actual code section lol http://forums.massassi.net/html/wink.gif). Although, maybe that's where the issue lies, if nothing is printing. Hmm - never tried it myself, to be fair... http://forums.massassi.net/html/redface.gif

Oh - also (although there's nothing really wrong with it) your variable "Conversation" declared in the symbols section is currently unused... http://forums.massassi.net/html/wink.gif

Hope this has (somewhat) helped http://forums.massassi.net/html/biggrin.gif. Sorry I can't analyse it for you at much greater length at the present moment as I'm off to sleep now - and I make sure I never code late at night (except when a project's due in the following morning...) because I tend to generate more errors than I resolve (beware nasty program bugs - they're worse than the bed-bugs... http://forums.massassi.net/html/redface.gif http://forums.massassi.net/html/wink.gif )

-Jackpot

[EDIT] - Just a last minute thought after I'd posted - have you made sure that the "playeraction" parameters that you're trying to capture (and perform tests on) are correct? Ok I've said my peace - please don't kill me....

------------------
Are you feeling lucky, cuz if you are, get your hands off me... ;p

"Life is mostly froth and bubble,
But two things stand in stone,
Kindness in another's trouble,
Courage in your own"
("Ye Wearie Wayfarer" - by Adam Lindsay Gordon)

[This message has been edited by lucky_jackpot (edited November 20, 2003).]

darthslaw
11-20-2003, 04:16 PM
This is not one of my strong areas of cogging (if any are really good enough to earn that title), but have you defined what cog 'Adventure' is?
i.e. adventure = GetSelfCog(player, blah blah blah)
(THIS IS MOST LIKELY NOT THE COG VERB YOU WANT TO USE IN THIS SITUATION!)
Maybe not having 'local' after defining it in the symbols section
Like I said, I'm not an expert in this area, but I hope you figure it out (and that this helped in some way)

------------------
We are Slaw of Borg.
You will be assimilated.
Resistance is futile.
-Darth Slaw, Dark Lord of the Borg

[This message has been edited by Darth Slaw (edited November 20, 2003).]

Descent_pilot
11-20-2003, 07:49 PM
Yes it is, cause how its used, you want to return the self cog so the playeraction in the self cog will be used. if that makes sense.


------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

The 2 riddle! (http://forums.massassi.net/html/Forum1/HTML/028595.html)

Checksum
11-21-2003, 08:56 AM
Print("KA'PA: I'm a brutha Hutt trying to make");
Print(" a living in a cruel world. Y'dig, cat?");
Print("");
Print("");
Print("");

Reason that would not print: JK only allows three printed strings on screen at once.

You have three blank ones at the end, so if you printed that whole block of five, the first two, the important two, would scroll off the screen the very instant they're printed, with no possibility of being seen at all.

[edit] Bah, sidescrolling.

------------------
Duel Zero (http://forums.massassi.net/html/Forum5/HTML/010438.html) key count: Zero! Down to guns and forces. Expect a release soon.

[This message has been edited by Checksum (edited November 21, 2003).]

Lord_Grismath
11-21-2003, 03:26 PM
Darth Slaw's proposal seems to have promise. I'll try it out as soon as I get back (I'm about to leave).

lucky_jackpot, the cog works fine until it should exit, where it doesn't hand control over to the adventure cog. (nor does it send the user0 message)

Checksum: This is for MotS, sorry for not having directly specified that before, but the fact that I'm using playeraction should make that self-explanatory.

EH_AceCSF
11-22-2003, 12:54 AM
Checksum.. this isnt true. There can be 5 strings printed at one time in JK and Mots, but only in DEBUG mode there are 3 lines..

------------------
The miners of Kiith Somtaaw sacificed much, and risked all. For their efforts they were brought into the inner most circle of Hiigaren power. Naabal, S'jet, and Sobanii bowed before them. And from that day to this, Somtaaw's children have been known to one and all as Beastslayers..

Lord_Grismath
11-22-2003, 06:30 AM
WOOOH!

It works. http://forums.massassi.net/html/biggrin.gif I set the adventure cog as the Master Cog, and used GetMasterCog to define the 'adventure' variable in the above cog.