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 → two cogs
two cogs
2004-09-10, 5:32 PM #1
Hi.

I have 2 cogs, they work alright but there is need for improvement. The first is my force_pull.cog, which is replaced by push, it causes the enemys to be pushed back and drop thier weapon. There needs to be two impovments done here. The first thing is that when you push an enemy, and he drops his weapon, but he doesnt die from the push, and then you push him again he drops another weapon, and so on and so forth. Id like it if you could make it so he can only ever drop his weapon once. Nextly, I found out today that if you use it to push a dark jedi you can kill them in about 1-2 pushes. Id like it if you could make this cog unable to target dark jedi.

Next cog, the bacta cog, it was made for me by Darth Slaw, it makes it when you consume a bacta that the surface in the level get set to transluctent for 10 seconds, this cog works fine, however there is one bug, if a surface in the level is already flaged as transluctent then sometimes after the vision goes back that surface becomes solid and you cant see through it anymore. So for the solution, Id like it if when you use the bacta that any surface already set as transluctent doesnt get affected by the cog.

Thankyou, the cogs are attached in a zip file.
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.

Rangi
2004-09-15, 10:10 PM #2
Ok ive been away for 5 days so sorry for bringing this back up but can someone please help?
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.

Rangi
2004-09-17, 6:01 AM #3
I'm just downloading the file at the moment, but one suggestion (for the first question): why not modify the "skill" message in the dark-jeci actor cog(s) to "ReturnEx (-1)", given the bin number for the force-push power being passed as Parameter 0 for the "skill" message...?

Just a thought :) As for the second one, I'd imagine (although haven't viewed the cog yet) that it would require some "heap" usage :o. I guess there's only one way to find out... ;)

-Jackpot
"lucky_jackpot is the smily god..." -gothicX
"Life is mostly froth and bubble, but two things stand in stone,
Kindness in another's trouble, courage in your own"
- "Ye Wearie Wayfarer"
|| AI Builder: compatible with both JK & MotS || My website ||
2004-09-17, 3:18 PM #4
Why is this a sticky?
ᵗʰᵉᵇˢᵍ๒ᵍᵐᵃᶥᶫ∙ᶜᵒᵐ
ᴸᶥᵛᵉ ᴼᵑ ᴬᵈᵃᵐ
2004-09-17, 3:55 PM #5
Quote:
Originally posted by jEDIkIRBY
Why is this a sticky?


Indeed, I have no idea.

Oh well.
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.

Rangi
2004-09-17, 4:36 PM #6
Quote:
Originally posted by jEDIkIRBY
Why is this a sticky?

So it would be given attention. :p
And when the moment is right, I'm gonna fly a kite.
2004-09-18, 3:45 PM #7
Hello? A little help here would be hot. At least for the bacta one.
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.

Rangi
2004-09-18, 3:54 PM #8
I have downloaded the files and will take a look. I will try to post help tomorrow.

:)
2004-09-19, 11:47 AM #9
I have looked at the item_bacta.cog and tested it in a level. I have not been able to reproduce the problem where a translucent surface was not returned to translucent. :( Do you have any more information on the problem, such as particular surfaces that are always problematic? Have you verified that the problem surfaces are using the FaceType flag = 0x2?

Note that there is a small bug in the item_bacta.cog. (I doubt it would cause the problem you described.) All of the for loops with GetSurfaceCount are checking a nonexistent surface index past the last one. It might not cause any problems, but it would certainly be better if it were more accurate. You could also make the for loops more efficient by storing the surface count in a symbol before the loop. Thus, change the lines that look like this:
For(I=0;I<=GetSurfaceCount();I=I+1)

Into this:
surfaceCount = GetSurfaceCount();
For(I=0;I<surfaceCount;I=I+1)


I will look at the force_pull.cog next.

:)
2004-09-19, 1:03 PM #10
I have looked through the force_pull.cog. I have some code changes that I think will do what you requested, but I have not tested them.

Starting with what you posted, delete this section of code (because it will never be called):
Code:
         else
         if((victim == -1) || (type == 2))
         {
               // Make victim drop powerup.
               throwThing = SkillTarget(victim, player, 24, 0);
               {
                  SetActorWeapon(victim, 1, 1);
                  DetachThing(victim);
                  ApplyForce(victim, VectorScale(GetThingLVec(player), 1000));
               }
         }

The bottom line of this code might not be needed because the previous sections of code apply the force push:
Code:
         // Throw item at player.
         {
 ...
            // Turn off gravity for the thing
            ClearPhysicsFlags(throwThing, 0x1);
               ApplyForce(victim, VectorScale(GetThingLVec(player), 1000));         }

The test for an actor having a weapon is incorrect. Change the bottom line of this code:
if(type == 2) // ACTOR
{
if(GetActorWeapon(victim, 1) != 1)

Into:
if(GetActorWeapon(victim, 1) != -1)


To avoid targeting dark jedi, add another test to the first if statement in the pulse. The test is for the actor flag 0x200 not being set (i.e. the actor is not a dark jedi). So, after this line (in the if statement):
!(GetActorFlags(potential) & 0x100) &&

Insert this line:
!(GetActorFlags(potential) & 0x200) &&


Let us know the results of your tests.

:)
2004-09-19, 4:53 PM #11
Thanks ZeqMacaw, I will test the force push now. Also in level 10 in the cargo ship those transparent forcefields which were not always visable always turned solid and sometimes surfaces like water that have a current went solid. Is it possible it cant change back surfaces easiliy with a cog attached?

Ill let you know of my force push result.
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.

Rangi
2004-09-19, 5:18 PM #12
Ok, I have tested and have these results.

Changed the lines in the bacta cog and now it seems to work fine, so thanks Macaw that problems out of the way.

For the pull cog, I couldnt figure out which part to replace to stop dark jedi targeting but I did come up with one problem. If you used pull on an enemy and he didnt die, you were unable to target him again. I need it so you can always target enemys even after they drop their gun but they only drop thier gun once.

Thanks again.
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.

Rangi
2004-09-19, 5:49 PM #13
From a_person:
Quote:
For the pull cog, I couldnt figure out which part to replace to stop dark jedi targeting
Hmm, you mean you could not find where to insert the line I gave? I'll try again giving more context.
The line I gave:
Code:
!(GetActorFlags(potential) & 0x200) &&
can be placed after the !GetActorFlags... line below:
Code:
pulse:
   // Check all things for our victim.
   victim = -1;
   maxDot = 0;
   // Search for all players, actors and items.
   potential = FirstThingInView(player, 20 + 15 * rank, 5.5, 0x424);
   while(potential != -1)
   {
      if(
         HasLOS(player, potential) &&
         (potential != player) &&
         (VectorDist(GetThingPos(player), GetThingPos(potential)) <= (0.5 + rank / 2)) &&
         !(GetThingFlags(potential) & 0x200) &&
         !(GetActorFlags(potential) & 0x100) &&
         !((jkGetFlags(potential) & 0x20) && !IsInvActivated(player, 23))
        )

I will work on the "not targeting again" problem and try to post a solution within the hour.

:)
2004-09-19, 6:37 PM #14
From a_person:
Quote:
If you used pull on an enemy and he didnt die, you were unable to target him again.
Okay, I am assuming you don't mean "can't target using reticle" (because the code looks right for that), but you mean that you can't force push the enemy again.

To fix the "not able to force push after first time" problem (as well as clean up the code a bit), change the following code in the deactivated handler...:
Code:
         if(type == 2)                       // ACTOR
...
            // Turn off gravity for the thing
            ClearPhysicsFlags(throwThing, 0x1);
               ApplyForce(victim, VectorScale(GetThingLVec(player), 1000));         }
      }

...into this:
Code:
			if(type == 2)                       // ACTOR
			{
				throwThing = SkillTarget(victim, player, 24, 0);
				if(throwThing != -1)
				{
					if(GetActorWeapon(victim, 1) != -1)
					{
						// Make victim drop powerup.
						SetActorWeapon(victim, 1, -1);
						AmputateJoint(victim, 3);
					}
				}
				DetachThing(victim);
				ApplyForce(victim, VectorScale(GetThingLVec(player), 1000));
			}
			else
			if(type == 10)                      // OTHER PLAYER
			{
				if(!(GetThingFlags(victim) & 0x200))
					retval = SkillTarget(victim, player, 24, rank);
				DetachThing(victim);
				ApplyForce(victim, VectorScale(GetThingLVec(player), 1000));
			}
			else
			if(type == 5)                       // ITEM
			{
				retval = SkillTarget(victim, player, 24, rank);
				if(retval != 0)
				{
				   if(!GetLifeLeft(victim))
					   SetLifeleft(victim, 30.0);

					// Handle gravity for items.

					SetTimerEx(1.5, 1, victim, 0);
					// Duplicate sends for lost packets
					SetTimerEx(3.5, 2, victim, 0);
					SetTimerEx(3.6, 2, victim, 0);
					// Turn off gravity for the thing
					ClearPhysicsFlags(victim, 0x1);
				}
			}

Whew! I hope that helps (and that I haven't missed something again).

:)
2004-09-20, 1:04 AM #15
Thanks Macaw I now have all the problems fixed. Your help was hvery apreciated.
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.

Rangi

↑ Up to the top!