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 → errors errors bloob blub
errors errors bloob blub
2003-03-27, 1:11 AM #1
i have made some remote mines and for some reason whenever i start the game it crashes, i don't know if it is my cogs or if i messed flags up or what it is so i am gonna post everything here for you guys to look at.


here is the lines i changed from my items.dat:
Code:
remote_mine             8               0       30      0x0a4   cog=weap_remmine.cog
detonator               42              1       1       0x122   cog=item_detonator.cog

those are the only two lines i changed

now for my template for the mine:
Code:
+seqchrg          +grenade2          timer=1.000000 model3d=seq0.3do size=0.010000 movesize=0.010000 soundclass=seq.snd 
surfdrag=5.000000 airdrag=1.000000 physflags=0x29d vel=(0.000000/0.100000/0.000000) angvel=(0.000000/0.000000/0.000000) 
buoyancy=0.150000 explode=+sequencer_exp fleshhit=+sequencer_exp typeflags=0x40380

+remmine         +seqchrg           thingflags=0x20000400 timer=60.000003

i do have all the bases above the template so thats not a prob.

here are my cogs:
this is the class cog:
Code:
symbols
template explosion=+sequencer_exp local
thing  mine local

message     created
message     trigger
end

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

code

created:
   mine = GetSenderRef();
   SetTimerEx(2.0, GetSenderRef(), GetThingSignature(GetSenderRef()), 0);
   Return;

trigger:
If(GetSourceRef()==98)FireProjectile(mine, explosion, -1, 16, '0 0.05 0.00', '0 0 0', 1.0, 0, 0.0, 0.0);


   Return;

end


here is my detonator code:
Code:
symbols

thing       player

message     activated
message     deactivated


end

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

code

activated:
SendTrigger(-1,98,0,0,0,0);
return;

deactivated:
SendTrigger(-1,98,0,0,0,0);
return;


end


what is supposed to happen is when the mine is created(using the original cog only slightly modified) it will sit there until the until the detonator blows it only problem is there must be a game crashing mistake in my stuff here.

------------------
roses are red, violets are blue, I am schizophrenic, and so am I!
roses are red, violets are blue, I am schizophrenic, and I am too!
2003-03-27, 3:27 AM #2
It's probably crashing because your detonator bin uses the 0x2 flag, but doesn't have a BM to use. You'll need 8 and 16 bit bm files named icdeton8.bm and icdeton16.bm respectively.

Also, why send trigger 98 on the deactivated event? The first trigger will have already blown up the mine. The detonator should only have to be a plain hotkey.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-03-27, 2:29 PM #3
the reason i have it in the deactivated message is because i didn't know if your press the hotkey button once would activate it and then when you press it again it would deactivate it, so i just did it as a precaution until i had a chance to test it.

thanks that prolly was my prob i have forgotten how to set up hotkeys but i do remember now

so if i make the flags for it 0x101 would that fix the prob? ahhh i'll just play around and figure it out..... thanks again
------------------
roses are red, violets are blue, I am schizophrenic, and so am I!

[This message has been edited by Han5678 (edited March 27, 2003).]
roses are red, violets are blue, I am schizophrenic, and I am too!
2003-03-27, 3:07 PM #4
i have it working now except it only detonates the last created mine and the one in the players hand. it makes no sense to me, can someone help me? i just need to know how to make it destroy all the mines created by a player, i am going to keep on tinkering but things go so much faster with help.

------------------
roses are red, violets are blue, I am schizophrenic, and so am I!
roses are red, violets are blue, I am schizophrenic, and I am too!
2003-03-28, 8:57 PM #5
MOTS has the same kind of mine & detonator. Maybe you should check out those cogs. It wouldn't be the BM file though because jk won't load the level if a BM is missing.

------------------
May the forks be with you.
Catloaf, meet mouseloaf.
My music
2003-03-29, 5:57 AM #6
The problem with your system is that you're expecting the class cog to be copied for each thing that uses it. But, JK will use the one copy of the class cog for every thing that references it.

I'd recommend something like this for your hotkey:
Code:
# mine_det.cog
#
# A hotkey cog to blow up all mines created by the local player.
# bin flags should be 0x120
#
# [SM]
#==============================================================#
symbols

thing     player                   local

int       i                        local

template  mineTemp=+remmine        local
template  expTemp=+sequencer_exp   local

message   activated

end
#==============================================================#
code
#------------------------------------------------------
activated:
	player = GetLocalPlayerThing();
	for(i = 0; i < GetThingCount(); i = i + 1)
	if(GetThingTemplate(i) == mineTemp && GetThingParent(i) == player)
	{
		FireProjectile(i, expTemp, -1, -1, '0 0.05 0', '0 0 0', 0, 0, 0, 0);
		DestroyThing(i);
	}

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


You could keep an array in your class cog of all the mines created, but that's far more limiting than the above cog. This should work alright. [http://forums.massassi.net/html/wink.gif]

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

[This message has been edited by SaberMaster (edited March 29, 2003).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

↑ Up to the top!