View Full Version : Modified Rail Det Cog
KotL_Xavier
04-21-2002, 01:10 PM
Ok, here is what I need. Is there a way to make a Rail Detanator Missile thingy shoot at a player as long as he is in certain sectors, say like sectors 200-220? I need to make this thing recognize that the player is close to the sector before entering it, so that the missiles will begin to shoot right before he walks into the sector. Is this possible? Thanks
-xavier
Darth Reed
04-21-2002, 05:37 PM
If you're using Mots, open up jkm.goo file (in the episode folder) in conman/cage. Find a cog called s5l2_lightning. When placed in a level, if the player crosses an adjoin, it starts shooting lightning across two ghost objects at a certain interval. Just set the template for 'lightning' to whatever the raildet template is. I'd post it, but might get flak since it's mots and people could put it in JK. If you're using JK, i don't know what to tell you... Hope this helps, though.
------------------
"We've compiled 43 songs on one CD... But it's a big one... And it's made outta chocolate!"
- Ryan Stiles of 'Whose Line Is It Anyway?'
I say, to hell with the MOTS code, and write your own.
#04/2002 GBK - Packman573@aol.com
Symbols
Message Startup
Message Pulse
Thing Ghost
Template Type
Sound Fire_sound
Template Walk_player=walkplayer Local
Sector Zone
Flex Pulse_rate=0.5
Int I=0 Local
End
Code
Startup:
Sleep(0.5);
Setpulse(Pulse_rate);
Stop;
Pulse:
For(I=0;I<=Getthingcount();I=I+1)
If(Getthingtemplate(I) == Walk_player && Getthingsector(I) == Zone) {
Setthinglook(Ghost, Vectorsub(Getthingpos(I), Getthingpos(Ghost)));
FireProjectile(Ghost, Type, Fire_sound, 18, '0 0 0', '0 0 0', 1.0, 0x20, -1, -1); }
Stop;
End
I think the variables are self-explanitory, so I wont bother. It should work in MP...
------------------
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).
KotL_Xavier
04-22-2002, 06:37 AM
Wow. GBK that cog works better than I expected. Its great! Only problem I have found with it, is that it is too smart. I just simply need it to shoot straight ahead from its ghost. Instead it has been tracking the player to a point. Is there anyway to make these rockets stupid without causing you to much trouble? Thanks,
-xavier
Hrm. Umm. Ok...
# Quick & Dirty MP turrent, with 'stupifying' option....
#
# 04/2002 GBK - Packman573@aol.com
Symbols
Message Startup
Message Pulse
Thing Ghost
Template Type
Sound Fire_sound
Template Walk_player=walkplayer Local
Sector Zone
Flex Pulse_rate=0.5
Int Track_player=0 #Automatically aim at the victem? 0 = no.
Int I=0 Local
End
Code
Startup:
Sleep(0.5);
Setpulse(Pulse_rate);
Stop;
Pulse:
For(I=0;I<=Getthingcount();I=I+1)
If(Getthingtemplate(I) == Walk_player && Getthingsector(I) == Zone) {
If(Track_player != 0) Setthinglook(Ghost, Vectorsub(Getthingpos(I), Getthingpos(Ghost)));
FireProjectile(Ghost, Type, Fire_sound, 18, '0 0 0', '0 0 0', 1.0, 0x20, -1, -1); }
Stop;
End
Instead of making it permently stupid, I made it an option... http://forums.massassi.net/html/biggrin.gif
Credit me...
------------------
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).
KotL_Xavier
04-22-2002, 09:47 AM
lol. sorry that line of code "# Quick & Dirty MP turrent, with 'stupifying' option...." struck me as funny. Anyways, thanks. I will try it out once I get home. Right now i am at school.
-xavier
KotL_Xavier
04-22-2002, 07:32 PM
It did not work. I put the cog in notepad and saved it as stupid.cog, but alas, it would not work. Basically when I opened it up using f7 in jed, it did not give me any spaces for which to put the values in.
-xavier
Darth Reed
04-22-2002, 08:27 PM
Yeah, what was that about the mots code, GBK? Just kiddin. I respect somebody who naturally scraps pre-made code just to do it yourself. The only problem i see is that it lacks a return message at the end... I won't usurp gbk's code and tell you where to put it (hint, hint, i don't actually know where it goes). I don't know if some condition makes this unnecessary, but it may work to put one...
------------------
"We've compiled 43 songs on one CD... But it's a big one... And it's made outta chocolate!"
- Ryan Stiles of 'Whose Line Is It Anyway?'
zagibu
04-23-2002, 04:23 AM
He uses stop instead of return. That's not the problem.
------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
ZOOIkes
04-23-2002, 04:42 AM
the cog works fine, I checked, you must have done something wrong with renaming or pasting the code or something.
I just checked it, and it works fine.
Reinstall the cog.
------------------
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).
KotL_Xavier
04-24-2002, 06:59 PM
Whoops. Sorry. I just retested it. My fault.
-xavier
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.