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 → Just a simple cog
Just a simple cog
2001-09-27, 6:31 AM #1
It's ashame I can't do this on my own but I need a cog so that when a certain 3do is touched, if your on the Dark Side then you die, and if your a lighty then all your mana is restored. Simple enough right? [http://forums.massassi.net/html/tongue.gif]
Ummm... Errr. Eeeeee.
What to do for a signature? Oh well, back to the umms and errs again
2001-09-27, 3:01 PM #2
Code:
symbols
thing toucher   local
thing player    local
thing touchedob

message startup
message touched
end

code
startup:
player = GetLocalPlayerThing();
return;

touched:
toucher = GetSourceRef();
binvalue = GetInv(player, 75);

If (binvalue < 0 )
{
DamageThing(toucher, 80000);
}
Else if (binvalue > 0 )
{
SetThingHealth(toucher, 100);
}
return;
end


Okay this might be right and this might be worn but i think it is right. I did this off the top of my head except I did look up the bin [http://forums.massassi.net/html/smile.gif] Try it and if it doesn't work i will fix it.
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-09-27, 4:14 PM #3
No, I think thats wrong Han

Try this ...

Code:
# Dark/Light Death/Mana Boost Cog
# deathdark.cog
#
# Created by *_Seifer_*			

symbols

thing player   local
thing touchthing=-1 local

message touched

end

code

touched:

player = GetSourceRef();

if(GetInv(player, 64) == 1)
{
DamageThing(player, 1000);
}
else if(GetInv(player, 65) == 1)
{
SetInv(player, 14, 400);
}
                            
return;
                           
end
2001-09-28, 7:10 AM #4
Err... DamageThing() needs two more parameters than that or it won't work.

Quote:
<font face="Verdana, Arial" size="2">Use: damage = DamageThing(thing,flex damage,flag,damage causething); returns amount of damage taken</font>

-JKSpecs

So replace the line with something like this:
DamageThing(player, 1000, 0x1, -1);

0x1 being the impact damage flag.

------------------
Fiction must be more realistic than truth or no one will believe it.

[This message has been edited by SaberMaster (edited September 28, 2001).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-10-01, 8:43 AM #5
would somebody please just write out the correct version of the cog, or better yet even e-mail it to me.
Ummm... Errr. Eeeeee.
What to do for a signature? Oh well, back to the umms and errs again
2001-10-08, 3:06 PM #6
hello?
Ummm... Errr. Eeeeee.
What to do for a signature? Oh well, back to the umms and errs again
2001-10-09, 5:04 AM #7
Ok. Here's a modified version of Seifer's cog.

Code:
# Deathdark.cog
#
# Give light jedi full mana, or kill dark jedi when a 3do is touched
#===========================#
symbols

thing   player		local
thing   deathdark
message touched

end
#==========================#
code
touched:
   player = GetSourceRef();
   if(GetInv(player, 64)) DamageThing(player, 1000, 0x1, GetSenderRef());
   else if(GetInv(player, 65)) SetInv(player, 14, 400);

Return;
#=========================#
end


BTW, use Netscape if you want to copy the script.

[This message has been edited by SaberMaster (edited October 10, 2001).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-10-10, 4:55 AM #8
Um...
I've tried everything I know how to do (Which isn't that MUCH [http://forums.massassi.net/html/tongue.gif] )to get this cog to work. How am I supposed to make the thing recognize that there is a cog assigned to it. It's not like an elevator or a door where I can click "Get selected item". How do I make it work?
Ummm... Errr. Eeeeee.
What to do for a signature? Oh well, back to the umms and errs again
2001-10-10, 11:23 AM #9
I haven't used JED much because I'm working on patches. When I assign a cog to something in a static.jkl, I put "cog=somecog.cog" in the template. Don't know if you can do that in JED.

However, I've been told that if your 3do is named "darkdeath", then the cog with "thing darkdeath" in it's symbols section will recieve the messages of that object.

------------------
Fiction must be more realistic than truth or no one will believe it.

[This message has been edited by SaberMaster (edited October 10, 2001).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-10-12, 3:35 AM #10
Alright, Ignore the last message I posted. That was my fault. Now I know it has to be being recognized but it just doesn't want to work. Is there a flaw in the code?
Ummm... Errr. Eeeeee.
What to do for a signature? Oh well, back to the umms and errs again
2001-10-13, 12:51 PM #11
Hello again????
Ummm... Errr. Eeeeee.
What to do for a signature? Oh well, back to the umms and errs again
2001-10-13, 1:18 PM #12
Okay under Touched:

put Print("touched");

And tell me if it prints it when you touch the thing.
2001-10-13, 2:39 PM #13
Okay, it didn't say touched so I guess the problem is on my end. What am I doing wrong? [http://forums.massassi.net/html/confused.gif]
Ummm... Errr. Eeeeee.
What to do for a signature? Oh well, back to the umms and errs again
2001-10-14, 4:47 AM #14
Am I being ignored for a reason? [http://forums.massassi.net/html/confused.gif]
Ummm... Errr. Eeeeee.
What to do for a signature? Oh well, back to the umms and errs again
2001-10-16, 3:08 AM #15
Would somebody please respond? [http://forums.massassi.net/html/frown.gif]
Ummm... Errr. Eeeeee.
What to do for a signature? Oh well, back to the umms and errs again
2001-10-16, 5:19 AM #16
Hmm, you might try placing a conditional statement after the message, like so:


Touched:

If(Getsenderref() == Deathdark) { ... }




------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-10-16, 12:36 PM #17
I have no idea what your talking about. [http://forums.massassi.net/html/confused.gif]
Ummm... Errr. Eeeeee.
What to do for a signature? Oh well, back to the umms and errs again
2001-10-16, 4:02 PM #18
Use HealThing(Player, -500); for killing..it's a sure thing [http://forums.massassi.net/html/smile.gif]
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2001-10-17, 6:41 PM #19
How exactally are up implementing the cog?

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-10-18, 2:47 AM #20
Alright, I've got the 3do in the level. I give it THINGFLAGS, then I select used in cog. Then I hit f7 and add the cog from my project directory. Then I click "Get Selected Item" making sure the correct Thing is selected. I make sure everything is right and click save jkl and gob, and gob it to episode. It's that simple. [http://forums.massassi.net/html/tongue.gif]
Ummm... Errr. Eeeeee.
What to do for a signature? Oh well, back to the umms and errs again
2001-10-19, 8:16 AM #21
Alright. Rush delivery. I need the full, correct version of the cog by Sunday so help me out here would ya.
Ummm... Errr. Eeeeee.
What to do for a signature? Oh well, back to the umms and errs again
2001-10-20, 12:03 PM #22
It needs a few of changes. First, only 10 health is to be lost from a dark jedi. second, it can only work every 30 seconds (so I lighty can't sit there healing himself and so a dark jedi doesn't get obliterated every time he touches it.) Also make sure that if someone only has neutral powers or if they have both forces, nothing happens when it's touched. Could you do this?... Thanks
Ummm... Errr. Eeeeee.
What to do for a signature? Oh well, back to the umms and errs again
2001-10-22, 1:37 PM #23
I'm getting fed-up with keeping this post alive. Would someone please respond, it's very frustrating. [http://forums.massassi.net/html/mad.gif]
Ummm... Errr. Eeeeee.
What to do for a signature? Oh well, back to the umms and errs again
2001-10-24, 10:51 AM #24
wow this post must be real old i have something posted on it

Code:
symbols
thing player   local
thing switch=-1
message touched
end
code
touched:
player = GetSourceRef();
if(GetInv(player, 64) == 1)
{
HealThing(player, -1000);
}
else if(GetInv(player, 65) == 1)
{
SetInv(player,14,400);
return;                           
end

okay make this a cog then go into jed hit f7 then add the cog. after that select the thing u want to be the switch, then hit f7 again highlight the space where it says"switch -1" and then click getselected or whatever. Then make sure u have it in the directory right and it sohuld work.
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-10-25, 3:44 AM #25
Alright,
let's make this a whole lot more simple since nothing seems to work. All the cog has to do is this: If a thing is touched(not activated), then whoever touches it(Dark Side, Light Side, Neutral Side, Both Sides, or No Sides at all) loses 10 health. This cog can only work every 10 seconds.
Ummm... Errr. Eeeeee.
What to do for a signature? Oh well, back to the umms and errs again
2001-10-25, 4:48 PM #26
Quote:
<font face="Verdana, Arial" size="2">it's very frustrating.</font>


Now WHO are more frustrating to read such a thread...please, have patience. We help, you appreciate.

A very nice cog I will write for you.
You don't have to make things simple, you just need to apply this cog properly.

Damages dark side players by 10.
Heals light side players mana by full.
Nothing happens for neutral and uber jedi.
Only happens every 30 sec for each person.

Code:
# Deathdark.cog
# Give light jedi full mana, or kill dark jedi when a 3do is touched
#===========================#


symbol


thing   victim   local
thing   deathdark
message touched
message timer


end


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


code


touched:


   victim = GetSourceRef();


   if(GetThingUserData(victim)) return;


   if(GetInv(victim, 64) && !GetInv(victim, 65)) DamageThing(victim, 10, 0x1, GetSenderRef());
   else if(!GetInv(victim, 64) && GetInv(victim, 65)) SetInv(victim, 14, 400);


   SetTimerEx(30, 0, victim, GetThingSignature(victim));
   SetThingUserData(victim, 1);


return;


timer:


   if(GetThingSignature(GetParam(0)) != GetParam(1)) return;


   SetThingUserData(GetParam(0), 0);


   return;

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


end


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

[This message has been edited by Hideki (edited October 28, 2001).]
2001-10-25, 5:30 PM #27
Were there any other mistakes in that cog besides "symbol" instead of "symbols"?
That was the only mistake I could possibly catch(considering the fact that I don't know anything about cogs). I will work on implementing this cog more tommorow. For now, I'm going to sleep.
Ummm... Errr. Eeeeee.
What to do for a signature? Oh well, back to the umms and errs again
2001-10-26, 5:03 AM #28
I knew I deleted an unknown 's' floating around on my text editor when I pasted the cog from above posts...

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

↑ Up to the top!