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 → Problem with special sequencer cog
Problem with special sequencer cog
2002-11-29, 6:41 AM #1
Code:
symbols

message   created
message   timer

thing     dog       local
thing     mine      local

int       i=1       local

vector    dir       local

end
#==============================================================#
code
#------------------------------------------------------
created:
	SetTimerEx(2.0, GetSenderRef(), GetThingSignature(GetSenderRef()), 0);
	mine = GetSenderID();

Return;
#------------------------------------------------------
timer:
	if(GetParam(0) == GetThingSignature(GetSenderID()))
	{
		// Bring things towards the mine.
		dog = FirstThingInView(mine, 360, 4, 0x424);
		dir = VectorScale(VectorNorm(VectorSub(GetThingPos(mine), GetThingPos(dog))), 50);
		DetachThing(dog);
		ClearPhysicsFlags(dog, 0x1);
		ApplyForce(dog, dir);
		// Many times.
		for(i = 0; i < 10; i = i + 1)
		{
			dog = NextThingInView();
			dir = VectorScale(VectorNorm(VectorSub(GetThingPos(mine), GetThingPos(dog))), 50);
			DetachThing(dog);
			ClearPhysicsFlags(dog, 0x1);
			ApplyForce(dog, dir);
		}
		SetThingHealth(mine, 0.01);
	}

Return;
#------------------------------------------------------
end


Went through Parsec without a hitch when I tried it. This is the secondary (proximity) mine class cog. I lay down the mine, but nothing happens. The only thing I have changed is this cog. Can I have a little help?
2002-11-29, 6:51 AM #2
Hmmm... I'd suggest you take a look at your Timer Param0, you seem to be using GetSenderRef() and GetSenderID() interchangeably in a fashion that soens' seem too airtight.

Thar's my two cents.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-11-29, 11:28 AM #3
The only thing I can think of is its pulling things that don't exist towards itself, so it's getting back up. Use a while loop instead of a for, works much better.

Also, afterwords, the "dog" will still be um hum, how shall I say this, 'flying'. Chatch my drift. [http://forums.massassi.net/html/wink.gif] I'm outta ideas otherwise.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-11-29, 2:21 PM #4
FirstThingInView accepts 270 as a max angle, not more.

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-11-30, 11:30 AM #5
What Zagibu said. [http://forums.massassi.net/html/smile.gif] So what you want to do is create two ghost objects, and have both of those use 180 degrees facing in oppoisite directions, and move objects towards the mine.
-Hell Raiser

↑ Up to the top!