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 → Need a cog (fairly simple so I've been told)
Need a cog (fairly simple so I've been told)
2002-08-24, 10:17 AM #1
Over the past few months ive been making a level. Half-way throught it's production I ran into a Cog problem. I decided to do everything else and then go back and add the cog. After many failing attempts I tried to Register. However,Massassi was not accepting new members so, I had to wait. The person I am making this for is becoming quite aggitated and has for a great deal of time been subtley pressing me to complete this final cog.

The reason for this narrative was to show my desparation and hopefully create a greater probablilty of a reply as this is becoming of very great importance to me.

People have told me that it would be very easy to produce and I hope it is.

If your familiar with Mario, Then you probably recall the doughnut blocks that fall with a short delay after you step on them. The idea has been used in many games, of which mine happens to me one of them.

My barrels are meant to blow up after a short delay from the initial touch and then respawn 20- 30 seconds later so as to provide multiple attempts.

I would be very grateful if someone more capable then myself could post and answer to my problem. I would sumbit and write here the cog as far as I have advanced it but I fear my "enhancments" are only a sad butchering of the cog in it's original state. So I decided to Leave it out as it would only serve as a mockery to myself..

-Caleb Creed


------------------
-------------------------
Remember now they Creator in the days of thy youth, while the evil days come not, nor the years draw nigh, when thou shalt say I have no pleasure in these days. - Ecclesiasties 12:1
2002-08-24, 10:50 AM #2
RGRMORTIS, I thought I resolved this cog issue with you a while back on IRC?
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-08-24, 10:54 AM #3
It never worked. A fact, by the way which I count as purely my own incometence and nothing on the part of you or any other advisors. Thank you though very much it did further my understanding of the script.

You gave me the Cog script however I failed to implement it correctly. That's why I need someone to type one for me so I can just plug it in. I'm sorry to cause trouble over something that should be so easy.
2002-08-24, 11:37 AM #4
Try this, Rigor. [http://forums.massassi.net/html/wink.gif]

Code:
# step_stone.cog
#
# Destroy a barrel after the player has stepped on it.
# Then create it again later. To recieve the entered
# message, the barrels must have the 0x40 Thing Flag.
#
# [SM]
#======================================================================================#
symbols

message entered
message	timer

thing		player		local

thing		barrel0
thing		barrel1
thing		barrel2
thing		barrel3
thing		barrel4
thing		barrel5
thing		barrel6
thing		barrel7
thing		barrel8
thing		barrel9

vector	pos0		local
vector	pos1		local
vector	pos2		local
vector	pos3		local
vector	pos4		local
vector	pos5		local
vector	pos6		local
vector	pos7		local
vector	pos8		local
vector	pos9		local

sector	sec0		local
sector	sec1		local
sector	sec2		local
sector	sec3		local
sector	sec4		local
sector	sec5		local
sector	sec6		local
sector	sec7		local
sector	sec8		local
sector	sec9		local

int		i			local
int		id			local

template	barrelExp
template	barrelTemp

flex		destroyDelay=0.8
flex		createDelay=20

end
#======================================================================================#
code
#--------------------------------------------------------
entered:
	for(i=0; i < 10 && barrel0 != GetSenderRef(); i=i+1);
	pos0=GetThingPos(barrel0);
	sec0=GetThingSector(barrel0);
	SetTimerEx(destroyDelay, 1, i, 0);

Return;
#--------------------------------------------------------
timer:
	if(GetSenderID() == 1)
	{
		id=GetParam(0);
		DestroyThing(barrel0[id]);
		CreateThingAtPos(barrelExp, sec0[id], pos0[id], '0 0 0');
		SetTimerEx(createDelay, 2, id, 0);
	}
	else if(GetSenderID() == 2)
	{
		id=GetParam(0);
		barrel0[id]=CreateThingAtPos(barrelTemp, sec0[id], pos0[id], '0 0 0');
		SetThingPos(barrel0[id], pos0[id]);
		CaptureThing(barrel0[id]);
	}

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


It should be easy enough to use. The entered message is called when an object with the 0x40 Thing Flag is stood upon by the player. So make sure your template has that flag.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-08-24, 11:46 AM #5
Thank you very much, I did not expect to have a cog returned so quickly. Thank you very much. Ill should have the level in by tonight.
-Caleb Creed
2002-08-24, 12:33 PM #6
I was unable to implement the code. I think followed the instructions all flags are 0x40. Their all in the same sector if that makes a difference.
2002-08-25, 3:09 AM #7
The cog works correctly, but I'll need to see how it will be used in your level. Could you zip the level (with the above cog) and email it to sabermastery@yahoo.com? If the zip is greater than 3MB, then remove any new textures from the zip.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-08-29, 1:57 PM #8
In Response to Email (explanation of subject redundancy)


I was not able to acctually... And I did set flags to 0x40. I think I did everything right but again my skills aren't all to hot so it could be very well an err on the part of my own incompetence.
2002-08-29, 2:58 PM #9
Does the cog do anything at all? Did you define all of the symbols in JED?

If you haven't already, try putting a Print() in the entered message. If that works, try printing other variables like pos0 and sec0. You should be able to figure out what is and isn't running from the output.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

↑ Up to the top!