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 → Huh?!?!?
Huh?!?!?
2004-06-09, 6:44 AM #1
I have two stormtroopers that drop from spawns on the ceiling and are supposed to fire at each other. This USED to work... (and according to ParSec it still should)

Code:
Sleep(3.0);
CreateThing(boom, spawn0);
CreateThing(boom, spawn1);
Sleep(0.5);
bio0=CreateThing(biotroop, spawn0);
bio1=CreateThing(biotroop, spawn1);
ClearActorFlags(player, 0xa00000);
SetDebugModeFlags(0x1);
Sleep(1.5);
AISetLookPos(bio0, GetThingPos(bio1));
AISetLookPos(bio1, GetThingPos(bio0));
Sleep(1.5);
ClearDebugModeFlags(0x1);
AISetMode(bio0, 0x202);
AIClearMode(bio0, 0x1004);
AISetMode(bio1, 0x202);
AIClearMode(bio1, 0x1004);
AISetFireTarget(bio0, bio1);
AISetFireTarget(bio1, bio0);
AISetMode(bio0, 0x2);
AISetMode(bio1, 0x2);


Here is the template:

Code:
cbm     _humanactor        thingflags=0x20000400 model3d=st.3do puppet=st.pup 

soundclass=st_s1.snd maxvel=.25 weapon=+elaser weapon2=+st_punch health=10 

maxhealth=10 maxthrust=1 maxrotthrust=90 typeflags=0x20001 

fireoffset=(.0048/.05/.012) aiclass=st_def.ai
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-06-09, 10:29 AM #2
As per descent_pilot's request, here is the entire cog:

Code:
# sgb_specops.cog
# [Grismath]
#======================================================================================#
symbols
message	entered
int	played=0	local
thing	player	local
surface	screen0
surface	screen1
surface	screen2
sound	detect
sound	talk
sector	clerkroom
sound	alarm
thing	door
thing	spawn0
thing	spawn1
template boom
thing	bio0	local
thing	bio1	local
template biotroop
sector	entSect
end
#======================================================================================#
code
#--------------------------------------------------------
entered:
if(GetSenderRef()==entSect) {
if(played==0) {
played=1;
Sleep(0.5);
player=GetLocalPlayerThing();
SetActorFlags(player, 0xa00000);
StopThing(player);
PlaySoundLocal(detect, 1, 0, 0x0);
Sleep(1.0);
SetFaceGeomode(screen0, 4);
SetFaceGeomode(screen1, 4);
SetFaceGeomode(screen2, 4);
playsoundlocal(talk, 1, 0, 0x0);
Sleep(3.0);
SetFaceGeomode(screen0, 0);
SetFaceGeomode(screen1, 0);
SetFaceGeomode(screen2, 0);
PlaySoundlocal(alarm, 1, 0, 0x0);
SetSectorLight(clerkroom, 0, 0.2);
Sleep(1.0);
MoveToFrame(door, 1, 4.5);
Sleep(3.0);
CreateThing(boom, spawn0);
CreateThing(boom, spawn1);
Sleep(0.5);
bio0=CreateThing(biotroop, spawn0);
bio1=CreateThing(biotroop, spawn1);
ClearActorFlags(player, 0xa00000);
SetDebugModeFlags(0x1);
Sleep(1.5);
AISetLookPos(bio0, GetThingPos(bio1));
AISetLookPos(bio1, GetThingPos(bio0));
Sleep(1.5);
ClearDebugModeFlags(0x1);
AISetMode(bio0, 0x202);
AIClearMode(bio0, 0x1004);
AISetMode(bio1, 0x202);
AIClearMode(bio1, 0x1004);
AISetFireTarget(bio0, bio1);
AISetFireTarget(bio1, bio0);
AISetMode(bio0, 0x2);
AISetMode(bio1, 0x2);
}
}
return;
#--------------------------------------------------------
end


------------------
Rites of Xanthus

The TC that exacted a terrible toll on my time and eyesight.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-06-09, 11:03 AM #3
I can't see anything wrong with it. Check your settings in JED. I doubt it, but could it be too many sleep messages like that one cog awhile ago?

------------------
Major projects working on:
SATNRT
JK Pistol Mod
Aliens TC
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2004-06-09, 11:46 AM #4
Impossible. My templates have been getting pretty screwey as of late, though. If it were the sleeps, it would have killed the cog entirely. As it is, the troopers spawn, but they don't shoot.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-06-09, 1:29 PM #5
Tried printing anything? Maybe you set/cleared a wrong flag?

------------------
nytfyre m0d || f33l t3h p0w3r || t3h l0st c0gz || OMF > *
May the mass times acceleration be with you.
2004-06-09, 3:09 PM #6
Yes. And if I cleared a wrong flag, could you tell me which? I removed all the flag-clearing to no effect.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-06-10, 10:41 AM #7
Well, I did a quickie lookover, and it looks like flag clearing/setting is fine.

------------------
nytfyre m0d || f33l t3h p0w3r || t3h l0st c0gz || OMF > *
May the mass times acceleration be with you.
2004-06-10, 12:16 PM #8
Hm...
1. Try setting AI modes before clearing.
2. It has happened that actors won't move or do anything if you're not looking at them.
3. Print some flags. Test for the 0x20 AI mode flag (Actor has its target in attack range or sight.). How to print flags? int aiflags=AIGetMode(actor); Printint(aiflags);
Now, this will print not in hex (0x...) but in dec, unless someone knows how to print ints into the format you want. 0x20 = 32.

Hope this helps.

/Edward
Edward's Cognative Hazards
2004-06-11, 3:01 AM #9
The problem lie, as I had suspected, in the templates, which I reworked before finally releasing. [http://forums.massassi.net/html/biggrin.gif]
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.

↑ Up to the top!