View Full Version : Need a cog.
Dash_rendar
06-26-2002, 06:40 PM
*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).]
Descent_pilot
06-26-2002, 07:35 PM
I'll do this one GBK. http://forums.massassi.net/html/wink.gif
Here's right off the top of my head.
#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[i], template[i], 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).]
Just skimming over your cog, I see fatal flaws; Invalid arrays.
First, An array should be done starting with zero;
Int Blah0
Int Blah1
Int Blah2
Int Blah3
....But that isnt nessarilly mandatory.
Pulling from your code, change the template array to;
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 [i]think we can't have.
JK editing resources (http://www.tbns.net/GBK/ol/index.htm).
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 (http://www.tbns.net/GBK/ol/index.htm).
Dash_rendar
06-26-2002, 08:34 PM
Oh ok. I dont know COG and i didnt know what you were talking about http://forums.massassi.net/html/smile.gif
------------------
The Dashmaster
Descent_pilot
06-26-2002, 08:41 PM
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
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).]
Dash_rendar
06-27-2002, 11:50 AM
Im confused.
I cant get the cog to work, what do i need to do to get it to work?
------------------
The Dashmaster
Descent_pilot
06-27-2002, 01:09 PM
Do this.
#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[i], template[i], 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).]
SaberMaster
06-27-2002, 01:22 PM
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 (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).
[This message has been edited by SaberMaster (edited June 27, 2002).]
[This message has been edited by SaberMaster (edited June 27, 2002).]
Dash_rendar
06-27-2002, 01:52 PM
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).]
Descent_pilot
06-27-2002, 04:30 PM
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? (http://forums.massassi.net/html/Forum4/HTML/003191.html)
<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).]
SaberMaster
06-28-2002, 02:15 PM
Try this cog:
# 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[i], temp0[i], snd0[i], -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 (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.