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 → rifle range cog, please help me.
rifle range cog, please help me.
2001-04-18, 4:43 AM #1
I need a cog which does the following
(it's for a rifle range like the one in half-life only it works only for eweb and you get a powerup when you hit.):
-move 3do from frame 0 to 1 and back continuesly. shouldn't play any sounds when moving.
-when hit by eweb laser it should stop moving; a little explosion template should appear. (the object must not disappear.)
A healthpack should be created at a ghost position.

I had tried the cog myself and asked it at tacc but I still don't seem to get it working can anybody please help?
thanks.



[This message has been edited by Darth Vedder aka ZOOIkes (edited April 18, 2001).]
And shepards we shall be, for thee my lord for thee, power hath descended forth from thy hand, that our feet may swiftly carry out thy command, and we shall flow a river forth to thee, in teeming with souls shall it ever be, in nomine patri, et fili, et spiritus sancti
2001-04-18, 9:44 AM #2
for the target,
Code:
symbols
message damaged
thing player local
end
#--------------------------------------------
code
damaged:
player=GetSenderRef
SetInv(player, POWERUP BIN FROM ITEMS.DAT,1 or 0)
end

Add any more code that you want, I hope you know the basics of cog...

BTW: This is for the target, I dunno what you meant about the frames.(for a keyfile, it has to be)

[This message has been edited by scott_karana (edited April 18, 2001).]

[This message has been edited by scott_karana (edited April 18, 2001).]

[This message has been edited by scott_karana (edited April 18, 2001).]

[This message has been edited by scott_karana (edited April 18, 2001).]
Hey, I'm here! But who cares?
2001-04-19, 5:19 AM #3
symbols
template Powerup
template Explosion
Thing Ghost
message damaged
thing target
thing player local
end
#--------------------------------------------
code
damaged:
player=GetSenderRef;
SetInv(player, 92, 0);
CreateThing(Explosion, target);
CreateThing(Powerup, Ghost);
end


is this what I need to use then?
(this doesn't do the 3do moving yet I know)
And shepards we shall be, for thee my lord for thee, power hath descended forth from thy hand, that our feet may swiftly carry out thy command, and we shall flow a river forth to thee, in teeming with souls shall it ever be, in nomine patri, et fili, et spiritus sancti
2001-04-19, 1:15 PM #4
i think u would have to do it something like this
Code:
# Jedi Knight Cog Script
#
# DEFAULT.COG
#
# This Cog is Not supported by LucasArts Entertainment Co
 


symbols
template     powerup                                                          
template     explosion                                                        
thing        ghost                                                            
thing        target                                                           
thing        player                             local                         
keyframe     key                                                              
flex         delay                                                            

message      damaged                                                          
message      startup                                                          
end                                                                           
# ========================================================================================
code
damaged:
   player=GetSenderRef;
   SetInv(player, 92, 0);
   CreateThing(explosion, target);
   CreateThing(powerup, ghost);
   StopKey(target,key,delay);
  return;
# ========================================================================================
startup:
   //the 0x3 flag should make the key loop
   PlayKey(target,key,1,0x3);
  return;
end

please don't hold me to this but i think this will make the key loop and when it is damaged stop the key after the delay time is up
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-04-20, 6:59 AM #5
mine didn't work; I'll try yours and see if it does something wrong; then I'll try to fix it.
And shepards we shall be, for thee my lord for thee, power hath descended forth from thy hand, that our feet may swiftly carry out thy command, and we shall flow a river forth to thee, in teeming with souls shall it ever be, in nomine patri, et fili, et spiritus sancti
2001-04-20, 1:17 PM #6
hey post if mine does something wrong. I will test it to though and i will tell u if i got it to work.
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-04-21, 2:13 AM #7
doesn't do anything either; and btw which key should I use? I don't know anything about keys...
And shepards we shall be, for thee my lord for thee, power hath descended forth from thy hand, that our feet may swiftly carry out thy command, and we shall flow a river forth to thee, in teeming with souls shall it ever be, in nomine patri, et fili, et spiritus sancti
2001-04-21, 1:35 PM #8
oh a key is an animation file. nd well u use the one u want the target to be doing. so my cog did nothing?
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-04-22, 2:13 AM #9
noting...
And shepards we shall be, for thee my lord for thee, power hath descended forth from thy hand, that our feet may swiftly carry out thy command, and we shall flow a river forth to thee, in teeming with souls shall it ever be, in nomine patri, et fili, et spiritus sancti
2001-04-22, 3:14 AM #10
ok I've allmost done it; I just need a little more help. I now have the cog:
----------------------------------------------------
Code:
# Jedi Knight Cog Script
#
# S4L2_shipexplode.COG
#Modified for Rifle range usage. By ZOOIkes aka Darth Vedder. (A Pirate's Tale: level 1: the Escape)
# Ship explosion for end of level S4L2
#
# [DB]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved

symbols

message		damaged

thing		ship					mask=-1

sound		shipcrack
sound		shipexplode

thing		ghost1
thing		ghost2

template	explosion_tpl		
template	powerup

flex        	curdamage=0                 	local
flex		damage

end


code
  
damaged:

   curdamage=curdamage + GetParam(0);

   if (curdamage<damage) Return;

	playsoundpos(shipexplode, getthingpos(ship), 1.0, -1, -1, 0);

	Sleep(0.05);
   CreateThing(explosion_tpl, ghost1);
   Sleep(0.05);
   CreateThing(powerup, ghost2);

	return;

end

----------------------------------------------------
(offcourse in my case the ship is a target.)

the cog does it allmost; except 2 things:
-explosions keep appearing forever. (should be only one)
-It doesn't let the target move

if anyone could help me with this, please do.

[This message has been edited by Darth Vedder aka ZOOIkes (edited April 22, 2001).]

[Hideki - Easy read.]

[This message has been edited by Hideki (edited April 22, 2001).]
And shepards we shall be, for thee my lord for thee, power hath descended forth from thy hand, that our feet may swiftly carry out thy command, and we shall flow a river forth to thee, in teeming with souls shall it ever be, in nomine patri, et fili, et spiritus sancti
2001-04-22, 9:56 AM #11
please use code tags
uuum u don't have anything in your cog making it move. I don't understand y it keeps on making a bunch of explosions but u might want to make it fire a projectile, it works much better and i know it only creates one explosion, try this code here
Code:
      FireProjectile(ship, explosion_tpl, -1, 8, '-0.0 0.0 0', '0 0 0', 1.0, 0, 0.0, 0.0);
that code will wrk fine
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-04-23, 4:15 AM #12
does the same [http://forums.massassi.net/html/frown.gif]

maybe it would work if I put a:

Code:
if (curdamage>damage) end


in it. But cogwriter says it's wrong; is there an other command for 'stop' that I could use?
And shepards we shall be, for thee my lord for thee, power hath descended forth from thy hand, that our feet may swiftly carry out thy command, and we shall flow a river forth to thee, in teeming with souls shall it ever be, in nomine patri, et fili, et spiritus sancti
2001-04-23, 4:17 AM #13
I also don't get the moving to work; whatever I try it all doesn't seem to work.
And shepards we shall be, for thee my lord for thee, power hath descended forth from thy hand, that our feet may swiftly carry out thy command, and we shall flow a river forth to thee, in teeming with souls shall it ever be, in nomine patri, et fili, et spiritus sancti
2001-04-23, 11:28 AM #14
geez me must be stupid, hideki will come along and give some super definition and u will be done in a couple seconds. try putting this after your sleep
Code:
DestroyThing(explosion_tpl, ghost1);
but then u would have to use
DestroyThing(explosion_tpl, ghost1);
and not fire projectile

i will get back to u about the movement, i am going to mess with some frames and stuff.




------------------
Join the army,
Visit new places,
Meet new people,
Then drop bombs on them
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-04-27, 6:13 AM #15
It doesn't seem to work either. (or is it ust me [http://forums.massassi.net/html/smile.gif])

I did noticed something; When I blast the target with the eweb numerous explosions (and healthpacks)are created; but they do stop after a minute or 2. When I shoot the target with a concussion rifle (nothing should happen, but...) one or 2 explosions (and healthpacks)are created.

So something is definitly wrong here, since the target reacts on all weapons; even if you blast it with a bryar a few times.
And shepards we shall be, for thee my lord for thee, power hath descended forth from thy hand, that our feet may swiftly carry out thy command, and we shall flow a river forth to thee, in teeming with souls shall it ever be, in nomine patri, et fili, et spiritus sancti

↑ Up to the top!