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 → Laser Projector
Laser Projector
2000-11-19, 8:11 AM #1
Can somebody examine this COG, I put it in JED, did all the usual stuff, tested it and it fired at itself twice before crashing the game:

symbols
message crossed
#The trigger the computer is meant to look for
surface adjoin0 id=1
surface adjoin1 id=1
surface adjoin2 id=1
surface adjoin3 id=1
#These are the surfaces which trigger the laserprojector
thing laserprojector
#Well duh...The laser projector
template laser=+stlaser
#The laser projectile itself
thing activator
#The person that crossed the adjoin
message pulse
#A pulse function to generate a loading time for the projector (I'm not evil enough to just make it kill them outright)
flex pulselength=0.5
#You can change this, but it is the best for the purpose.
flex damagedone=30
#This is the amount of damage each shot does, be as sadistic as you please
sound fire=trprsht1.wav
#The firing sound
end

code
crossed:
if(GetSenderID() == 1) {
#If it's one of the adjoins above
activator = GetSourceRef();
#Make the activator the person that activated the projector
Setpulse(pulselength);
#Starts the pulse

pulse:
FireProjectile(laserprojector, laser, fire, , actor, 0, , , 180, 1);
#Fires the laser at the activator
DamageThing(activator, damagedone);
#Damages the activator of the projector by the above flex
end

------------------
You were right about one thing master, the negotiators were short
http://jaggedconscience.serveftp.com/

Jagged Conscience
2000-11-19, 10:27 AM #2
's pr'y the fireprojectile command in the pulse message , it doesn't have values for all the parameters , jk doesn't like that..(:

peace.
-Dormouse

------------------
#define QUESTION((2b) | | !(2b))
/*Shakespeare*/
Also, I can kill you with my brain.
2000-11-20, 7:34 AM #3
I'm not a cog expert, but here are a few ideas:

You didn't end your "if" statement with a }. That might have something to do with it. It's just good practice to use proper coding.

Try putting in "-1" for the values you don't use in the "fireprojectile" statement.

You need a "return" at the end of your messages, or the game only thinks it needs to do it once.

I don't see what the purpose of the "pulse" message is. It seems that it could all be done under the "crossed" message.

------------------
Docking Bay 94
"Good Asian dubs are like Steven Segal and plot; they just dont appear in the same movie." -Spork
2000-11-20, 10:27 AM #4
Home Sliced is exactly right.. use Cogwriter to check your syntax, it's full of errors [http://forums.massassi.net/html/smile.gif]

As for the pulse, I believe it's to make the laser fire repeatedly... otherwise it'd fire once. Also, I'm pretty sure the laser will keep firing indefinitely, as there's no SetPulse(0.0);

-Jipe
2000-11-21, 9:14 AM #5
I've never understood what the return thing means, what exactly does it do? The pulse is to make it fire repeatedly and the reason why I didn't fill in the FireProjectile values is that JKSpecs doesn't tell you what they are, I haven't tried it yet but I'll give it a go.

PS Did anybody else realise that it the taskbar CogWriter is spelt cogwirter ?

------------------
You were right about one thing master, the negotiators were short
http://jaggedconscience.serveftp.com/

Jagged Conscience
2000-11-21, 10:46 AM #6
if you want it to shoot the stormtrooper rifle laser.. fill in FireProjectile() params in your cog that you don't know with the params in the st rifle cog [http://forums.massassi.net/html/smile.gif]

return; tells the cog that the current message has ended..

and yes.. cogwirter [http://forums.massassi.net/html/smile.gif]

-Jipe
2000-11-21, 10:14 PM #7
Cheers Jipe, I'll try that, I also noticed that my IDs are put as ID and not LinkID

------------------
You were right about one thing master, the negotiators were short
http://jaggedconscience.serveftp.com/

Jagged Conscience

↑ Up to the top!