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 → More cog help...
More cog help...
2002-07-15, 6:56 AM #1
This is essentially a turret cog that fires off projectiles in all directions, except that what the projectiles do is not mentioned in this version...

Code:
# Filename.COG
# blargh
# [scott_karana] 

symbols

thing        turret                        
thing    projectile   local                      
template projectile1=ghost local

sound       fireSound=trprsht2.wav              local

message      startup                                                          
message      touched                                                          
message      pulse                                                            

flex         X                                           local                     
flex         Y                                           local                     
flex         Z                                           local                     

vector       shootvec                            local                             

end                                                                           


code

startup:

Setpulse(0.1);

Return;

pulse:

for (x=0;x<10000;x=x+1)
for (y=0;y<10000;y=y+1)
for (z=0;z<10000;z=z+1)
shootvec=VectorSet(X,Y,Z);
FireProjectile(turret, projectile1, fireSound, 8, '0.0 0.0 0.0', shootvec, 1.0, 0x30, 0, 0);
Return;

touched:
projectile=GetSourceRef();
#not telling what the projectiles do tho...
Return;

end


the problem is that the projectiles don't do their 'thing' and if I put in Print("") lines, I still get nothing. Help.




[This message has been edited by scott_karana (edited July 15, 2002).]
Hey, I'm here! But who cares?
2002-07-15, 10:05 AM #2
Three things to start with.

First, tell us what the projectiles do (the touched message). We need to check that because there maybe an error in that part. [http://forums.massassi.net/html/wink.gif]

Second thing. It should be GetSenderRef() in the touched message. SaberMaster or GBK, I don't exactly know what to do after that with the current info. [http://forums.massassi.net/html/redface.gif] So if either of you have ideas, please speak.

Third, and lastly. Your shooting only one projectile (I think). If so try this instead.
Code:
For(x=0;x<10000;x=x+1)
{
   For(y=0;y<10000;y=y+1)
   {
      For(z=0;z<10000;z=z+1)
      {
         shootvec = VectorSet(x, y, z);
         FireProjectile(the stuff);
      }
   }
}
Becuase your FireProjectile is after the For()s, it only does it once with the same vector 10000/10000/10000. (I think)

------------------
The Sniper Missions. Current project, The Sniper Missions [edit]Damn tags don't like me right now. [http://forums.massassi.net/html/mad.gif] [/edit]

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

Completed
Judgement Day (HLP), My level pack
2002-07-15, 12:38 PM #3
Karana, do you really want to fire a trillion projectiles? [http://forums.massassi.net/html/tongue.gif] Not really sure what you're trying to do with the projectile and vector code, could you explain that better?

What do you mean by "I put in Print("") lines, I still get nothing". The Print() statements don't print?

Quote:
<font face="Verdana, Arial" size="2">It should be GetSenderRef() in the touched message</font>


Think of it this way. When something happens to a thing (in this case the turret), it sends the appropriate event message to cogs that it's associated with. So in one of these messages, the turret will be the sender. The thing that caused the event will be the sourceref. So in the touched message, GetSenderRef() will return the turret, and GetSourceRef() will return the fired projectile if the projectile touches the turret as it's fired.

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

[This message has been edited by SaberMaster (edited July 15, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-07-15, 3:00 PM #4
This is one of those rare times when I openly disagree with you SaberMaster. Here's a part from Millenium's GetSenderRef() vs. GetSenderRef()
Code:
Message      GetSenderRef()         GetSourceRef()
touched      What touched           What got touched
*Thinking logicly here* Sender is what touched a thing/surface to send the message. The Source of the message is what got touched by the sender.

Anyway... See why I think it should be GetSenderRef(). Any thoughts? [http://forums.massassi.net/html/wink.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-15, 3:25 PM #5
What's the thing limit again? If I remember correctly, that should exceed the thing limit by about 9 orders of magnitude. I don't think the JK engine can handle 1000000000000 projectiles at once.
And meanwhile the bus with legs has destroyed half of disneyland . . . and nobody cares!
2002-07-15, 3:35 PM #6
Quote:
<font face="Verdana, Arial" size="2">Sender is what touched a thing/surface to send the message. The Source of the message is what got touched by the sender.</font>


Yes, the sender sends the message, but it is the source that touches the sender. Not all things can touch. Take surfaces for example, they can't touch things, but they can be touched by actors. When that happens, the surface will send the touched message with the actor as the sourceref.

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

[This message has been edited by SaberMaster (edited July 15, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-07-15, 4:10 PM #7
Good point SaberMaster. [http://forums.massassi.net/html/wink.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack

↑ Up to the top!