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 → Need a cog.
Need a cog.
2002-06-26, 3:40 PM #1
*glares at GBK*

Must be activated when a Thing, OR surface is activated, OR and adjoin is crossed.

Dont worry about making a seperate switch/trigger for each ghost, there only needs to be one switch.


What this one needs to do is generate a template (must be able to work on anything, like AI's, Guns, or projectile traps). Make it work for 5 ghosts, and possible for a different template for each ghost. Thanks a ton in advanced.

And since it is for MP, when somebody generates something, it must generate it on the server side and all client sides.

I know that when weapons are generated, after they have been generated they will continually respawn. Can you make it so this doesnt happen? Or will i just have to make a seperate gun template with no respawn value?


Sorry if this is to much to ask. But i wont need anything like it for awhile since it is a multipourpose thing that will work on anything.


------------------
The Dashmaster

[This message has been edited by Dash_rendar (edited June 26, 2002).]
2002-06-26, 4:35 PM #2
I'll do this one GBK. [http://forums.massassi.net/html/wink.gif]
Here's right off the top of my head.
Code:
#Demo cog
# This time, for Dash_rendar
#
# By Descent_pilot
#
# Dashs_cog.cog

symbols
thing    tactivator    linkid=0   # Thing to activate
surface  sactivator    linkid=0   # Switch to activate
surface  aactivator    linkid=1   # adjoin to cross

thing    ghost         nolink     # ghost postions
thing    ghost1        nolink
thing    ghost2        nolink
thing    ghost3        nolink
thing    ghost4        nolink

template zero                     # The templates
template one
template two
template three
template four

int      i             local      # For the For() statement
int      active=0      local      # So you can only activate when its not firing

sound    fireSound=turret-1.wav  local # Sound when the turret is firing.

float		autoAimXFOV=90
float		autoAimZFOV=180    # So it aims at the target it view


message     activated
message     crossed
end
# .......................................................................

Blast:     // user defined message
   If(!Active) Return;     // Failsafe, not needed
   For(i=0; i<=4; i=i+1) FireProjectile(ghost, template, FireSound, -1, '0 0 0', '0 0 0', 1.0, 0x60, autoAimXFOV, autoAimZFOV);     // actual firing
   Active = 0;     // Once done, can be activated agian
   SetWallCel(sactivator, 0);     // Changes the switch to off
   Return;

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

Activated:
   If(Active) Return;     // If all ready firing, can't be activated agian
   SetWallCel(sactivator, 1);     // Changes the switch to on
   Active = 1;
   If(GetSenderId()== 0) call Blast;
   Return;

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

Crossed:
   If(Active) Return;     // If all ready firing, can't be activated agian
   SetWallCel(sactivator, 1);     // Changes the switch to on
   Active = 1;
   If(GetSenderId()== 1) call Blast;
   Return;

end

Don't know a whole lot about multiplayer cogs. There is a tutor on Massassi on traps. I have to go to dinner, this cog should work. [http://forums.massassi.net/html/biggrin.gif] edit - Couldn't spell

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

[This message has been edited by Descent_pilot (edited June 27, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-06-26, 4:56 PM #3
Just skimming over your cog, I see fatal flaws; Invalid arrays.

First, An array should be done starting with zero;

Code:
Int Blah0
Int Blah1
Int Blah2
Int Blah3


....But that isnt nessarilly mandatory.

Pulling from your code, change the template array to;

Code:
Template Type_zero
Template Type_one
Template Type_two
Template Type_three
Template Type_four


...and change that bit in the fireproj command to "... Type_zero, ...".

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-06-26, 5:31 PM #4
I was commenting on Descent_piliot's code...

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-06-26, 5:34 PM #5
Oh ok. I dont know COG and i didnt know what you were talking about [http://forums.massassi.net/html/smile.gif]

------------------
The Dashmaster
2002-06-26, 5:41 PM #6
I feel dumb. [http://forums.massassi.net/html/redface.gif] (got rushing looking it over) I think if you add a 0 in the symbols, you have to add a 0 in the fire projectile, otherwise I don't think it'll work. *shurgs*
For the array I'd use
Code:
template     template
template     template1
template     template2
template     template3
template     template4

That's what I'd used. *shrugs agian*

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

[This message has been edited by Descent_pilot (edited June 26, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-06-27, 8:50 AM #7
Im confused.

I cant get the cog to work, what do i need to do to get it to work?

------------------
The Dashmaster
2002-06-27, 10:09 AM #8
Do this.
Code:
#Demo cog
# This time, for Dash_rendar
#
# By Descent_pilot
#
# Dashs_cog.cog

symbols
thing    tactivator    linkid=0   # Thing to activate
surface  sactivator    linkid=0   # Switch to activate
surface  aactivator    linkid=1   # adjoin to cross

thing    ghost         nolink     # ghost postions
thing    ghost1        nolink
thing    ghost2        nolink
thing    ghost3        nolink
thing    ghost4        nolink

template template                    # The templates
template template1
template template2
template template3
template template4

int      i             local      # For the For() statement
int      active=0      local      # So you can only activate when its not firing

sound    FireSound=turret-1.wav  local # Sound when the turret is firing.

float		autoAimXFOV=90
float		autoAimZFOV=180    # So it aims at the target it view


message     activated
message     crossed
end
# .......................................................................
code
Blast:     // user defined message
   If(!Active) Return;     // Failsafe, not needed
   For(i=0; i<=4; i=i+1) FireProjectile(ghost, template, FireSound, -1, '0 0 0', '0 0 0', 1.0, 0x60, autoAimXFOV, autoAimZFOV);     // actual firing
   Active = 0;     // Once done, can be activated agian
   SetWallCel(sactivator, 0);     // Changes the switch to off
   Return;

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

Activated:
   If(Active) Return;     // If all ready firing, can't be activated agian
   SetWallCel(sactivator, 1);     // Changes the switch to on
   Active = 1;
   If(GetSenderId()== 0) call Blast;
   Return;

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

Crossed:
   If(Active) Return;     // If all ready firing, can't be activated agian
   SetWallCel(sactivator, 1);     // Changes the switch to on
   Active = 1;
   If(GetSenderId()== 1) call Blast;
   Return;

end
Me, GBK, and maybe SaberMaster can debate this 0 thing some other time.

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

[This message has been edited by Descent_pilot (edited June 27, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-06-27, 10:22 AM #9
The cog still doesn't have a code section. [http://forums.massassi.net/html/tongue.gif]

Dash: I need you to clarify a few things. What exactly do you want created -
projectiles? Does the switch have cels that signify off/on? Do you want a thing or a
switch or both (aside from the adjoin)?

------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.

[This message has been edited by SaberMaster (edited June 27, 2002).]

[This message has been edited by SaberMaster (edited June 27, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-06-27, 10:52 AM #10
What I meant was, a total of 3 different ways to activate it. A Thing, a Surface, or an Adjoin.

Yes the switch for the Mat has 2 cells.

Im just going to be creating templates. Whether its just a 3do, an AI, a gun, or a projectile.

Five different ghost, with the possibility for a different template for each ghost.

Auto Aim if you can, but is not necessary.

Ask if you need more clarification, i know im a confusing person [http://forums.massassi.net/html/smile.gif]

------------------
The Dashmaster

[This message has been edited by Dash_rendar (edited June 27, 2002).]
2002-06-27, 1:30 PM #11
[http://forums.massassi.net/html/redface.gif] [http://forums.massassi.net/html/redface.gif] [http://forums.massassi.net/html/redface.gif] I feel really really stupid now. [http://forums.massassi.net/html/redface.gif] [http://forums.massassi.net/html/redface.gif] [http://forums.massassi.net/html/redface.gif] I changed my code above, it fits with everything you've said. Each ghost fires a different template. Mat with two cells, so on. Remember this GBK?
Quote:
<font face="Verdana, Arial" size="2">Most times, its the simple, easy things you forget.</font>


[This message has been edited by Descent_pilot (edited June 27, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-06-28, 11:15 AM #12
Try this cog:

Code:
# generator.cog
#
# An MP cog to fire five things at five ghosts when a thing
# or switch is activated or when an adjoin is crossed.
#
# [DP + SM]
#==============================================================#
flags=0x240
#==============================================================#
symbols

thing     object
thing     ghost0       nolink
thing     ghost1       nolink
thing     ghost2       nolink
thing     ghost3       nolink
thing     ghost4       nolink

surface   switch
surface   adjoin

template  temp0
template  temp1
template  temp2
template  temp3
template  temp4

sound     snd0
sound     snd1
sound     snd2
sound     snd3
sound     snd4

flex      fov=60
flex      fovDist=2
flex      fireWait=2

int       id=100
int       active=0       local
int       i            local

message   activated
message   crossed
message   trigger
message   timer

end
#==============================================================#
code
#------------------------------------------------------
activated:
	if(GetSenderRef() != object && GetSenderRef() != switch || active) Return;
	SendTrigger(-1, id, 0, 0, 0, 0);

Return;
#------------------------------------------------------
crossed:
	if(GetSenderRef() != adjoin || active) Return;
	SendTrigger(-1, id, 0, 0, 0, 0);

Return;
#------------------------------------------------------
trigger:
	if(GetSourceRef() != id) Return;
	active=1;
	SetSurfaceCel(switch, 1);
	for(i = 0; i < 5; i = i + 1) FireProjectile(ghost0, temp0, snd0, -1, '0 0 0', '0 0 0', 0, 0x0, fov, fovDist);
	SetTimer(fireWait);

Return;
#------------------------------------------------------
timer:
	active = 0;
	SetSurfaceCel(switch, 0);

Return;
#------------------------------------------------------
end


This should work. Reply if you need it modified.

------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

↑ Up to the top!