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 → Last Minute Tweaking of my Level
Last Minute Tweaking of my Level
2004-04-08, 4:43 PM #1
Right, you may remember my thread for my level. THankyou immensely everyone for all your help, now I'm just working out a few last bugs. It might help if you saw the original thread for my level (contatining cogs) so the link is here.

Here are the problems:

1) Force powers don't work.

2) The Tie Bomber will bomb the level several times, but will mysteriously halt after the third or fourth try.

These are all the major problems. Overall my level is bug-free excluding these issues, and turns out error free according to the JED consistency check. so I'm happy. If anyone knows how to resolve these couple of simple problems (most likely involving simple cog errors) I'd really appreciate it.

Thanks,

Daft



------------------
~ Vader's Corner ~ The place to submit your poetical works!
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2004-04-10, 3:37 AM #2
*Pleaseeee!*

------------------
~ Vader's Corner ~ The place to submit your poetical works!
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2004-04-10, 5:32 AM #3
Post your startup and Tie Bomber cogs.

------------------
I used to believe that we must fight the future, lest change come without our consent. I was wrong. The truth is that we must embrace the future, for only with change can we remain the same.
And when the moment is right, I'm gonna fly a kite.
2004-04-10, 5:47 AM #4
If you have sleeps in the TIE cog, try using timers instead. Too many sleeps may have been running at the same time and "killed" your cog. (btw, I am not saying the cog called the "killed" message, but I was saying your cog won't work right. Just to clear up any misleadings [http://forums.massassi.net/html/wink.gif]).

------------------
Bond, Power, CA, The Force, Saber, IC, Epic, Oily Mexican Food, BG, /\ |> /\ /\/\, Sentences.
Now you know where I've been.

[This message has been edited by Darth Slaw (edited April 10, 2004).]
May the mass times acceleration be with you.
2004-04-10, 6:45 AM #5
Please GBK, I would appreciate it if you read more carefully. If you followed the link I mentioned in the post, the Tie Bomber cog is on that thread. Sorry, I don't mean to be rude or sound exhasperated. Thanks!

But in case you still can't find it, here is the code for the Tie Bomber and startup:

Code:
##########################################################
# Jedi Knight Cog Script  (JK)
#---------------------------------------------------------
# TIEBOMBER_CLSTR01.COG
# ===================
# TIEBOMBER TEMPLATE:
# ===================
# _movething        _walkstruct        move=physics surfdrag=0.0 airdrag=0.0 mass=0.0 height=0.05 physflags=0x425d thingflags=0x48
# tiebomber_02      _movething         size=.742893 movesize=0.001      3d=tieb.3do
#---------------------------------------------------------
# Written By DSLS_DeathSythe
# This COG is NOT supported by LucasArts Entertainment Co.
##########################################################
symbols
#---------------------------------------------------------
message     startup
message     timer
message     pulse
#--------------------#
flex        fly_delay=60.0
thing       Pos_A=-1
thing       Pos_B=-1
thing       Pos_C=-1
template    bomb_tpl=08tiebomb
template    tiebomber_tpl
sound       tiebomber_snd
flex        move_speed=4.0
flex        bomb_spread=2.5
int         bomb_num=8
#--------------------#
thing       tiebomber=-1                                  local
vector      look_dir                                      local
vector      move_dir                                      local
int         next_pos=0                                    local
int         a=0                                           local
vector      randVec                                       local
flex        randSpread=0.0                                local
int         channel=-1                                    local
#---------------------------------------------------------
end
#=========================================================
code
#---------------------------------------------------------
startup:
Sleep(1.0);  [http://forums.massassi.net/html/confused.gif] {could this be the prob?}
//Print("tie cog started");
	SetTimer(fly_delay);
	look_dir = GetThingPos(Pos_B);
	look_dir = VectorSet(VectorX(look_dir), VectorY(look_dir), -1.0);
	look_dir = VectorSub(look_dir, GetThingPos(Pos_B));
	SetThingLook(Pos_B, look_dir);
return;
#---------------------------------------------------------
timer:
//Print("timer up");
	//- Create the tiebomber
	tiebomber = CreateThing(tiebomber_tpl, Pos_A);
	SetCollideType(tiebomber, 0);

	//- Start the bomber sound
	if(channel == -1)
		channel = PlaySoundThing(tiebomber_snd, tiebomber, 1.0, -1, 100, 0x181);

	//- Make the tiebomber look at Pos_B
	look_dir = VectorSub(GetThingPos(Pos_B), GetThingPos(tiebomber));
	SetThingLook(tiebomber, look_dir);

	//- Start the tiebomber moving to Pos_B
	move_dir = VectorScale(VectorNorm(look_dir), move_speed);
	SetThingVel(tiebomber, move_dir);

	//- Update the pos and start checking for arrival
	next_pos = 1;
	SetPulse(0.1);
return;
#---------------------------------------------------------
pulse:
	if((next_pos == 1) && (VectorDist(GetThingPos(Pos_B), GetThingPos(tiebomber)) < 0.25))
		{
//Print("Arrived at pos_b");
		//- Drop the bombs
		for(a=0; a<bomb_num; a=a+1)
			{
			// Get random bomb spread
			randVec = VectorSet(((Rand() - 0.5) * 5.0), (Rand() - 0.5) * 5.0, 0.0);
			randSpread = (Rand() - 0.5) * bomb_spread;
			FireProjectile(Pos_B, bomb_tpl, -1, -1, '0 0 0', randVec, randSpread, 0x1, 0.0, 0.0);
			}

		//- Make the tiebomber look at Pos_C
		look_dir = VectorSub(GetThingPos(Pos_C), GetThingPos(tiebomber));
		SetThingLook(tiebomber, look_dir);

		//- Start the tiebomber moving to Pos_C
		move_dir = VectorScale(VectorNorm(look_dir), move_speed);
		SetThingVel(tiebomber, move_dir);
		next_pos = 2;
		return;
		}

if((next_pos == 2) && (VectorDist(GetThingPos(Pos_C), GetThingPos(tiebomber)) < 0.25))
		{
//Print("Arrived at pos_c");
		StopThing(tiebomber);
		if(channel != -1)
			{
			StopSound(channel, 0.0);
			channel = -1;
			}
		if(tiebomber != -1)
			{
			DestroyThing(tiebomber);
			tiebomber = -1;
			}
		SetPulse(0.0);
		SetTimer(fly_delay);
		}
return;
##########################################################


Thanks Slaw, that could be the problem.
Would you please rewrite the code though, 'cuz I'm worry I'll mess it up.

Here's the startup cog:

Code:
#Level master COG
#Generated by JED 0.951 beta

symbols
message   startup
message timer
int       player    local
end

code

startup:
  // Register COG as master COG
  SetMasterCOG(GetSelfCOG());
  player = GetLocalPlayerThing();
  // Initialise Goals
  SetInv(player, 99, 1000);
  // Give player weapons and ammo
  SetInv(player, 1, 1);   // fists
  SetInv(player, 2, 1);   // briar
  SetInv(player, 11, 100);   // Energy
  // Initialize weapon.
  SetFireWait(player, -1);
  SetMountWait(player, 0);
  SetCurInvWeapon(player, 0);
  SelectWeapon(player, AutoSelectWeapon(player, 1));

SetTimer(15);
timer:
  // Force ranking
  SetInv(player, 20, 0);
  SetInv(player, 14, 4*50);

jkSyncForcePowers();
  Return;

end


Could my startup cog have something to do with why my Force Powers aren't working? *shrugs*

Thanks!

------------------
~ Vader's Corner ~ The place to submit your poetical works!


[This message has been edited by Daft_Vader (edited April 10, 2004).]

[This message has been edited by Daft_Vader (edited April 10, 2004).]
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2004-04-10, 7:55 AM #6
the tiebomber cog never stopped when i tested it.
is your level a MP or SP, because i did most of my testing in a MP and some in a SP but it still didnt stop.
how fast are you making the tiebomber go?
if you make it go too fast it could miss one of its destinations and that could screw the cog up.
you could try removing the // from all the Print() statments to see if everything is happening in the cog.

i dont know why it would be stopping sorry.

------------------
Famous last words - "It seemed like a good idea at the time."
Famous last words - "It seemed like a good idea at the time."
2004-04-10, 8:06 AM #7
Oh, don't feel bad about it, I'm not suggesting it's your fault. I really appreciate you just making me the cog, and I'm sure it's easily fixed. The problem most likjely lies in how I'm applying it, not how you created it. [http://forums.massassi.net/html/smile.gif]

My level is MP, and the Tie Bomber is set to go at a speed of 4 (which doesn't seem to fast). I also have it set at a 48 seconds delay.

------------------
~ Vader's Corner ~ The place to submit your poetical works!
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2004-04-10, 9:38 AM #8
Please! I would love to get my level out today!!!

------------------
~ Vader's Corner ~ The place to submit your poetical works!
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2004-04-10, 10:00 AM #9
if its MP then you dont need a startup cog.
take it out and see if that fixes the force problem.

the tiebomber problem may be that its missing one of its destinations. you could try making the pulse faster just change where it sets the pulse from SetPulse(0.1) to SetPulse(0.01), you could also try slowing down the bomber. that may fix it but im not sure.

------------------
Famous last words - "It seemed like a good idea at the time."
Famous last words - "It seemed like a good idea at the time."
2004-04-10, 10:06 AM #10
THanks, let me give it a try

------------------
~ Vader's Corner ~ The place to submit your poetical works!
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2004-04-10, 10:18 AM #11
Thanks, I got the force powers working properly now. I never knew you didn't have a startup cog in multiplayer. [http://forums.massassi.net/html/redface.gif]

I'll try out what you suggested with the bomber. Although mightn't you do what Darth Slaw suggested just in case? Thanks! [http://forums.massassi.net/html/biggrin.gif]



------------------
~ Vader's Corner ~ The place to submit your poetical works!
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2004-04-10, 10:38 AM #12
Eureka! It appears to work! Expect my level on the Showcase Forum sometime today!!! [http://forums.massassi.net/html/biggrin.gif]

------------------
~ Vader's Corner ~ The place to submit your poetical works!
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2004-04-10, 10:39 AM #13
if you want to try it, the only sleep in the cog is the one in the starup message so you can either put // in front of it to comment it out or delete it from the cog.
it doesnt really need to be there i just put it there kind of out of habbit.

------------------
Famous last words - "It seemed like a good idea at the time."
Famous last words - "It seemed like a good idea at the time."
2004-04-10, 6:34 PM #14
My new level can now be found on the Proelium Revisited thread! I hope you like it! [http://forums.massassi.net/html/biggrin.gif]

------------------
~ Vader's Corner ~ The place to submit your poetical works!
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels

↑ Up to the top!