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 → I still require a COG!
I still require a COG!
2003-05-19, 1:17 AM #1
Hi!
Remember last time I ask for something to be done. A player hits wrong button, a guy comes and kills the player, and kicks him out of the game?
Well, I know now what will happen exactly.
The player presses one of the following 4 switches, then a 10 second delay...
This guy materializes at this point (with particles) and then moves to... Oh, too many to count... But it won't be straight lines. It will be like he checks out his home.
I had the thought of you find this place that belongs to a Guy. Now he has put alarms on 4 essantial switches: a light switch, a phone switch, and 2 for the phone booth. You see, he has kids, and they can take care of themselves. But sometimes they are curious to see if they can make long distance calls with the phone. And that phone is a secret phone to some friends that the Guy is doing deals with. And he doesn't want his kids to mess it up for him. So he's on holiday, they press button, and his beeper goes and he dashes home and sees what is going on! Now why the light? Well, he wants to keep his underground home a secret. And of course, the light can give a flear, and then people will get curious and probebly hack at the walls to get in.
Now... Here's a plan of the home.
Code:
        +-------------------+
        |                   |
        |        £££        |
        |       £££££       |
        |        £££        |
        |         5         |
        +-----+-+-*x+-+-----+
              | * 4 | |
              | |   | |
              +-+ 3 * |
              | |   | |
              | * 2 | |
+-------------+-+   +-+-+      +--------+
'   C6                  |      |        |
|CC   CC +----------+   +-=----+   @@   |
|CC   CC |7               01::::  @@@@  |
+________+-+-------------------+   @@   |
         +E+                   |        |
         +-+                   +--------+
      +-++ +----+
      |9* 8     |
      | |       |
      | |       |
      | |;;;;;;;\
      +-+-------+

+ - | = walls
: = stairs
; = one step up ledge
_ = window out where the light is
\ = exit entrance
E = elevator
= = teleporter pannel
C = chair
* = door
@ = power core, home made power
£ = phone booth
' = light switch
x = phone booth switch for opening/closing

0 is starting point, where he materializes.
Then he will look in the direction of 1 for a second. Then turn and walk to 2 and looks through the door for a second. Then move on to 3 and looks through the door. Then number 4 and door to the left. Then Open the door infront of him and look in the direction of 5. If booth is open, then press switch to close it. Then to position 6 and looks towards the window. If the light is on, then turn it off with his weapon. Then off to 7 and if elevator is down, he uses his weapon to press the switch to bring it up. Then down the elevator, and to 8 and takes a look around. Then to 9 and looks. This is the kitchen. And if the water is running, turn it off. No one home? Then return to the starting point and activate the teleporting pannel, and dissapears (with particles).
Now here comes the tricky part... If he sees a player, and player=host, then he will put away his weapon and take up a book. Yes, linking book, so what? Anyway, takes up book, wants host to touch the book. If no activation after 10 seconds, then he looks disapointed, and walks to starting point and disappears. If host activates him again, he turns and holds up the book. If you activate him with book open, then you get teleported to a new place. I'll choose the position. If host damages the guy, then he pulls out weapon and kills host. Then gets kicked out of the game, taking everyone else with him!
If Guy sees player, and player!=host, quickly fire weapon, kill player, and a second later kick him out of the game.

OK... BIG COG! Please put plenty of comments explaining what happens here, because I don't know that much COG.

Thanks...
/Edward
Edward's Cognative Hazards
2003-05-19, 6:52 AM #2
:S
i would try and write that cog, but i dident understand a word of that. and who exactly do you want the guy to look "dissapointed"
coz that sounds like MAt's your gonna need. and a book? a book 3DO, if you ask me your gonna need a bit more than a cog for that job. :P

------------------
I am pjb.
Another post......
another moment of my life wasted.....
What do you mean? i dont knwo what i am doing..
at least i made a level.
PJB's JK page's
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2003-05-19, 7:01 AM #3
Hey! The Guy I can make easely... I think... The book is already done. The disapointment doesn't have to be on the face. Just a simple drop of the sholders and head. OK... Some of these things I said so that in the COG you would put keyframe. like...
"after 10 seconds, then he looks disapointed" means, put in the COG "keyframe sulk"

/Edward
Edward's Cognative Hazards
2003-05-19, 7:22 AM #4
what would happen if the guy saw two people, one host one not, or both not?

------------------
Famous last words - "It seemed like a good idea at the time."
Famous last words - "It seemed like a good idea at the time."
2003-05-19, 8:59 AM #5
Hm... If he sees 2 people. Then:
Shoot them both (Bang sleep(0.25) bang) and only the host may respawn. The other one will get kicked out of the game. If none of them were the host, then both get kicked out. Now I would like a sound from the Guy before he shoots.
Now no need to worry about contructing the Guy or his weapon or how he moves, I'll do that. You just do the COG, thank you.

/Edward
Edward's Cognative Hazards
2003-05-20, 9:59 AM #6
count me out, you need a expert for that

------------------
I am pjb.
Another post......
another moment of my life wasted.....
at least i made a level.
PJB's JK page's

-the PJB jedi rule book-
rule one,
Quote:
<font face="Verdana, Arial" size="2">never trust a barman with bad grammar</font>
-kyle katarn in JO

Rule Two,
Quote:
<font face="Verdana, Arial" size="2">Gravity is a crule misstress</font>
-kyle katarn in MotS, and the alternatior MK I in AJTD
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2003-05-20, 11:22 AM #7
do you want any of the 4 switches to be things or are they all surfaces?

can the places that he moves to and looks at be ghost things? they dont have to be, but if you need to keep the thing count down it would be better to just put all the cordinates in the cog, but that could make for ALOT of setup for the cog in jed. so its up to you, which do you want.

------------------
Famous last words - "It seemed like a good idea at the time."

[This message has been edited by DSLS_DeathSythe (edited May 20, 2003).]
Famous last words - "It seemed like a good idea at the time."
2003-05-20, 1:55 PM #8
You mean you're not an expert, pjb?
*GASP* [http://forums.massassi.net/html/eek.gif]

------------------
"The Just shall live by faith." - Galatians 3:11
Catloaf, meet mouseloaf.
My music
2003-05-20, 4:18 PM #9
First off, I'm not sure what that is, but it sounds quite cool! [http://forums.massassi.net/html/smile.gif] You may also want to make sectors in the shadows that when you enter them, you become invisible. It would simulate shadow hiding to get away from The Guy. [http://forums.massassi.net/html/smile.gif]

Anyways, the movement is pretty simple. There are some NPC routing tutorials on Massassi I believe, but I'm pretty sure it's basic COG that tells the NPC to move to a ghost position or somethings. There's a function you can call in COG to find out what's in the thing's view, or maybe it looks for the player in the view. Then there's stuff to check of a thing/player is the server or not, which you'll of course need. I don't have the time nor interest to make a COG like this anymore, but someone else might be willing to help you out with it. I suggest learning COG, too, it's a very simple language.

By the way, not entirely sure you can actually kick someone from the server (not sure if that's what you want) but you could teleport them back to a spawn location or something.

------------------
Bassoon, n. A brazen instrument into which a fool blows out his brains.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2003-05-20, 10:06 PM #10
The switches are surfaces. The Move-To points are ghosts. And I think you can have some hiding points. At the phone booth the Guy will only look at the phone booth, and if it is open, he will hit the switch to the right and walk out the door. Now the doors, phone booth, elevator, and sink are all controlled by thier own COG. And they all have an on/off int, and only an Activate message.
So, what do I need for the Guy to move to a door, elevator, etc, and activate it?

Now to kick someone out...
1: In a COG do an illigal verb or action that will crash the game.
2: Respawn to another place for ever and see through the eyes of the Guy. If the guy leaves, then set the view for another object. When he comes back, then set the view for him.
THERE!
Oh, and if damage Guy and is host, then simply respawn as default. Back into the game.

/Edward
Edward's Cognative Hazards
2003-05-22, 4:00 AM #11
or you could allways fade tehm, liek hackers do. its quite a neat trick.

dont mock the non expertynesses of me.

-pjb starts sticking his age old collection of pokemon cards all over the forum, ppl start screaming in terorr of the childishnesses

------------------
I am pjb.
Another post......
another moment of my life wasted.....
at least i made a level.
PJB's JK page's

-the PJB jedi rule book-
rule one, "never trust a bartender with bad grammar"-kyle katarn in JO

Rule Two, "Gravity is a crule misstress" -kyle katarn in MotS, and the alternatior MK I in AJTD
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2003-05-22, 8:27 AM #12
OK... I've thought about this COG. And I've come with a solution so that I make the COG. I know how to get an AI to move from where he is to an object, I know how to kill the player, and I know how to move objects here and there. Now... What I need to know are the following:
When the Guy sees a player, how do I test if he is Host or not?
How do I send a message to a COG saying Activated? I don't want the entire door/phonebooth/elevator COG in the Guy COG... I want the Guy COG to be able to activate these COGs.
Any suggestions?

Oh, and I'd like you to test something for me. Download this level (MP) and go to Cardia 2. Then find a room with lots of console5 objects. Then go to the window, and activate the pannel, furthest to the left, and tell me if your game freezes. I'd like to know on how many computers does it freezes like that. Maybe I could use that to Force the player to leave the game! Unless it freezes all players.

/Edward
Edward's Cognative Hazards
2003-05-22, 8:32 AM #13
IsServer();
Checks to see if the current pc is the server (host).

------------------
"The Just shall live by faith." - Galatians 3:11
Catloaf, meet mouseloaf.
My music
2003-05-22, 8:57 AM #14
Forgot one...
How do I see if the Guy has Seen an object?
I'd like to know what verbs I should use for:
Guy sees object
object is player

[This message has been edited by Edward (edited May 22, 2003).]
Edward's Cognative Hazards
2003-05-22, 2:00 PM #15
boolean=HasLOS(look_thing, target);

Tests to see if a target is in view of a look_thing and returns a boolean value. The look_thing does not have to be facing the target for HasLOS() to return true.



------------------
I am pjb.
Another post......
another moment of my life wasted.....
at least i made a level.
PJB's JK page's

-the PJB jedi rule book-
rule one, "never trust a bartender with bad grammar"-kyle katarn in JO

Rule Two, "Gravity is a crule misstress" -kyle katarn in MotS, and the alternatior MK I in AJTD
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2003-05-22, 2:03 PM #16
if you want to write the cog it heres some ideas i had on how you might be able to get it to work.

to send the activated message to other cogs you will need to list the door cog in your guy cog like this.
Code:
symbols
#-----
cog     doorCog01
cog     doorCog02
etc...
cog     elevatorCog01
etc...
#-----
end

then in jed all you have to do is list the cog number that jed gives the cog in the Placed Cogs window.
so if one of the door cogs that you want to send the activated message to is the first cog on the list you would put a 0 in the doorCog01 area.
then in the guy COG when you want the guy to open the door or move the elevator or whatever just do something like this:
Code:
SendMessage(doorCog01, activated);

ive never tried it but thats the only way i can think to do it without using a trigger.

to check to see if the guy can see a player you could use something like they use when targeting with forcepowers. it goes something like this:
Code:
pulse:
  // Check all things for our victim...
  victim = -1;
  // Search for all players...
  potential = FirstThingInView(guy, 90.0, 5.0, 0x400);
  while(potential != -1)
    {
    //-Check to see if the guy has LOS on the player...
    if(HasLOS(guy, potential))
      {
      victim = potential;
      }
    potential = NextThingInView();
    }
  // If we have a victim...
  if(victim != -1)
    {
    //-guy attacking stuff here...
    }
  else
    {
    //-guy has no target do something else...
    }
return;

add that to the guys actor cog. i havent tried to see if it would really work though.

heres my idea of how to kick a player out of the game. when the player gets killed by the guy, send a trigger like this:
Code:
//-Needed symbols...
int     endGame_trig=1
#-----
//-When the player gets killed by the guy send this trigger...
SendTrigger(-1, endGame_trig, player, 0, 0, 0);

you would have to find the player that is killed and put him in as the player that gets sent with the trigger.
this cog is the one that ends the game for that player:
Code:
# run the cog local and no-sync.
flags=0x240
symbols
#-----
message   startup
message   trigger
thing     player=-1     local
thing     victim=-1     local
int       endGame_trig=1
#-----
end
#=====
code
#-----
startup:
  player = GetLocalPlayerThing();
return;
#-----
trigger:
  //-Make sure its the right trigger...
  if(GetSourceRef() != endGame_trig) return;
  victim = GetParam(0);
  //-Check to see if the victim is this player...
  if(victim == player)
    {
    //-If the player isnt the server...
    if(!IsServer())
      {
      Print("Game Over for you...");
      jkEndLevel(0);
      return;
      }
    else
      {
      //-Do whatever for the server...
      return;
      }
    }
return;
#=====
end

only thing im not sure of is if it only ends the one players game or ends the game totally for everyone. i couldnt test it between my two comps because they are at different houses right now. [http://forums.massassi.net/html/frown.gif] the only testing i did with this was with a simple cog that when you activated a switch it ended the game with jkEndLevel. so it could work and it wouldnt freeze or kill the players computer.

i was going to test it all out as i made the cog for you, but if your going to make it ill just pass my ideas on to you.
hope some of that helps.

[edit]changed the kick player from game cog to account for the server.[/edit]

------------------
Famous last words - "It seemed like a good idea at the time."

[This message has been edited by DSLS_DeathSythe (edited May 22, 2003).]
Famous last words - "It seemed like a good idea at the time."
2003-05-22, 6:10 PM #17
What about when the player that gets killed by "the Guy" and it's the player on the server machine? If you eject that player, it'll end the game for everyone (I think). Not to mention you'll have to override the keyframe for the normal death animation.

...On second thought, that wouldn't be that hard. Just have the cog change the puppet to one with the disappointment keyframe as a death animation, or make up a new submode in the existing key and have the cog change to that submode. You might have to have the cog defer the damage of the final shot so you can set the animation first.
...Or you could just play the keyframe straight from the cog, but I'm not sure how that would work the puppet's death animation. Take your pick here, I guess.

------------------
"The Just shall live by faith." - Galatians 3:11

[This message has been edited by DogSRoOL (edited May 22, 2003).]
Catloaf, meet mouseloaf.
My music
2003-05-23, 4:36 AM #18
Ayayay...
It all started off nice. My COG department of the brain was working fine.
But then when I came to a part where I was going to get the Guy to move to the next position, do you know what happened? GRIND!
This was not so easy... I wonder if it realy is worth to have a guy in this secret area... Did I say secret area? I did, didn't I... Oh well, at least I'm not saying which level! I wonder... Secret area, that no-one would think of looking, and have an entire new AI there, or just leave people a link book for people to find.
Which should I do?

/Edward
Edward's Cognative Hazards
2003-05-24, 7:20 AM #19
one, its not worth it.
two, secret areas are WAY cool. as long as they dont riun teh game for a palyer, who after ejected often cant rejoin.(on MSN) (no MotS any more)

------------------
I am pjb.
Another post......
another moment of my life wasted.....
at least i made a level.
PJB's JK page's

-the PJB jedi rule book-
rule one, "never trust a bartender with bad grammar"-kyle katarn in JO

Rule Two, "Gravity is a crule misstress" -kyle katarn in MotS, and the alternatior MK I in AJTD
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?

↑ Up to the top!