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 → Nyeeearghhhhh... I'm not constapated, just frustrated w/ this cog
Nyeeearghhhhh... I'm not constapated, just frustrated w/ this cog
2001-10-27, 3:20 AM #1
This cog makes it so that when the player enters a sector, all three walls and a fake door explode in a hallway, and rock is revealed.

I got this to work w/o a timer, but it crashed the game. I'm positive everything else works, as before the game crashed I saw and heard explosions and the walls disappeared.

I looked at the XTANK cog, and saw they had the same bug and fixed it with the TimerEx command, but I really can't figure that command out, and am thus requesting help.

Previously, the Create Explosions, and DestroyThings were right under the If statement in the entered message.

Code:
symbols
message entered
message timer
sector entersect
thing wall1
thing wall2
thing wall3
thing extra
template explosion=+xtank1_exp\


end

# ========================================================================================

code

entered:

if(GetSenderRef() == entersect) {
	SetTimerEx(0.5, 0, 0);
}
return;

timer:
       KillTimerEx(GetSenderId());
	CreateThing(explosion, wall1);
	CreateThing(explosion, wall2);
	CreateThing(explosion, wall3);
	CreateThing(explosion, wall4);
	CreateThing(explosion, extra);
	DestroyThing(wall1);
	DestroyThing(wall2);
	DestroyThing(wall3);
	DestroyThing(wall4);
	DestroyThing(extra);
Return;


# ........................................................................................

end


------------------
Cordially,
Lord Tiberius Grismath
Head Administrator
GCWC.net

[This message has been edited by Lord_Grismath (edited October 27, 2001).]
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2001-10-27, 4:37 AM #2
I see your problem. Your symbols only list 4 objects, but you adress 5 in the code. Try adding 'thing wall4' to your symbols...

 

Simple enough...



------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-10-27, 5:57 AM #3
Yeah, destroying a thing that isn't there = bad.
2001-10-27, 1:07 PM #4
Bye bye player :P
2001-10-28, 12:44 AM #5
Nope.

The game crashes, and I don't even get a chance to see the explosions.

------------------
Cordially,
Lord Tiberius Grismath
Head Administrator
GCWC.net
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2001-10-28, 1:17 AM #6
Whoops. I forgot to delete the fourth wall in teh DestroyThings. It works now. Thank you so much!

------------------
Cordially,
Lord Tiberius Grismath
Head Administrator
GCWC.net
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2001-10-29, 9:22 AM #7
[edit] I am amazed that it worked because there's a lot more wrong with that cog:

1) Delete that slash after the template declaration.

2) The SetTimerEx() command should be: SetTimerEx(delay, timerID, flex param0, flex param1);

3) You don't need to kill that timer. It only runs once unlike a pulse.

4) You don't need to be checking the senderref of the sector since you only define one sector.

5) You don't even need to use a timer. I don't see why it would make any difference.

I'm pretty sure there is no bug with xtank's cog. They used a timer so the player could run away before it blew.

7) Once your cog runs, the player might reenter the sector and that would of course be a fiery crash :-) Do something like:

entered:
if(hasrun) Return;
hasrun=1;

8) If you don't define the fourth wall, then you can't create anything at it's position.

---

Fix those errors and your cog will run a lot better. [http://forums.massassi.net/html/wink.gif]

------------------
Thank you for sending me a copy of your book - I'll waste no time reading it.

[This message has been edited by SaberMaster (edited October 29, 2001).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-10-29, 4:46 PM #8
heres the best and simplest way, and guaranteed to work

symbols
message entered
sector trigga
thing wall1
thing wall2
thing wall3
thing wall4
thing extra
flex delay
template explosion=+xtank1_exp local
end
code
entered:
if(getsenderref() != trigga) return;
if(p == 1) return;
p = 1;
sleep(delay);
CreateThing(explosion, wall1);
CreateThing(explosion, wall2);
CreateThing(explosion, wall3);
CreateThing(explosion, wall4);
CreateThing(explosion, extra);
DestroyThing(wall1);
DestroyThing(wall2);
DestroyThing(wall3);
DestroyThing(wall4);
DestroyThing(extra);
return;
end

[This message has been edited by Strike1337 (edited October 29, 2001).]
2001-10-29, 7:08 PM #9
Why are you still typing all that , he's fixed the problem.
2001-10-30, 4:49 AM #10
oh, didnt see that message where he said it works, hehe. i was bored anyway, gives me something to do
2001-10-30, 10:38 AM #11
Yeah, he "fixed" it, but that cog needed some work.

------------------
Thank you for sending me a copy of your book - I'll waste no time reading it.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-10-31, 12:54 AM #12
Strike, if you have so much time in your hand to roam inside the dark core of the temple of Massassi, go outside and get some light!

------------------
http://millennium.massassi.net/ - Millennium

[This message has been edited by Hideki (edited October 31, 2001).]

↑ Up to the top!