PDA

View Full Version : errors errors bloob blub



Han5678
03-27-2003, 04:11 AM
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:


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:


+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:


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:


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!

SaberMaster
03-27-2003, 06:27 AM
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 (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), Scribe (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).

Han5678
03-27-2003, 05:29 PM
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).]

Han5678
03-27-2003, 06:07 PM
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!

DogSRoOL
03-28-2003, 11:57 PM
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.

SaberMaster
03-29-2003, 08:57 AM
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:


# 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 (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), Scribe (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).

[This message has been edited by SaberMaster (edited March 29, 2003).]