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 → remember GBK's mouse vision cog? There something similar,
remember GBK's mouse vision cog? There something similar,
2003-02-23, 5:21 AM #1
Okey - i try to change that cog to work with ATR and with sector that it entering after run. Problem is similar : This wont work :|

Code:
# ATR fly
#
# 2/2002 stand of GBK's mouse vision cog . EH_AceCSF


Symbols

Message Startup
Message Activated
Message Pulse
Message Damaged

Thing Panel
Thing Player				Local
Thing ATR                               linkid=0
Thing Cam				Local

Thing Ally0
Thing Ally1
Thing Ally2
Thing Ally3
Thing Ally4
Thing Ally5
Thing Newpost0
Thing Newpost1
Thing Newpost2
Thing Newpost3
Thing Newpost4
Thing Newpost5
Thing Newpost6

Int StopFall=1		local #Move in slow controlled fashion?
Int Fly=0		local	#Fly?

sector    endsec

Flex Ac=4

Template shot

thing   gh     local

End


Code

Startup:

Player = JKgetlocalplayer();
Capturething(ATR);
Stop;

Activated:

Playsoundpos(Beep, Surfacecenter(Switch), 1, 0, 10, 0);
Cam = Createthingatpos(shot, Getthingsector(ATR), Vectoradd(Getthingpos(ATR), '0 0 0.0001'), '0 0 0');
Attachthingtothingex(Cam, ATR, 0x8);
Setcamerafocus(0, Cam);
Setcamerafocus(1, Cam);
Setactorflags(Player, 0x40000);
Setpulse(0.01);
Stop;

Pulse:

If(Getdebugmodeflags() == 0x400) Setpulse(0.0005); Else Setpulse(0.01);
If(!Getcurrentcamera()) Setthingcurgeomode(ATR, 0);
Else Setthingcurgeomode(ATR, 4);

Gh = Fireprojectile(Player, shot, -1, -1, '0 0 0', '0 0 0', 0, 0, 0, 0);
If(Gh == -1) { Print("Lookvector ghost creation failure."); Stop; } 

Setthinglook(ATR, Vectorset(Vectorx(Getthinglvec(Gh)), Vectory(Getthinglvec(Gh)), 0));
Setthinglook(Cam, Getthinglvec(Gh)); Destroything(Gh); Gh = -1;

If(Isthingcrouching(Player) == 1) {
If(!Fly) Setthingvel(ATR, Vectorscale(Vectorset(Vectorx(Getthinglvec(ATR)), Vectory(Getthinglvec(ATR)), 0), Ac));
Else Setthingvel(ATR, Vectorscale(Getthinglvec(Cam), Ac)); } 
Else If(StopFall) Stopthing(ATR);

If (GetThingSector(ATR) == endsec);
{
TeleportThing(Player, Newpost0); 
TeleportThing(Ally0,Newpost1); 
TeleportThing(Ally1,Newpost2); 
TeleportThing(Ally2,Newpost3); 
TeleportThing(Ally3,Newpost4); 
TeleportThing(Ally4,Newpost5); 
TeleportThing(Ally5,Newpost6); 
Destroything(ATR);
Setpulse(0);
Setcamerafocus(0, Player); Setcamerafocus(1, Player);
Destroything(Cam); 
Clearactorflags(Player, 0x40000);
}
Stop;

Damaged:
if ((GetSenderID() == 0)
Setpulse(0);
JKendlevel(0);

Stop;

End


also, I need to add 2 or 3 fighters that will folow and attack ATR (perhaps demaged should have more then 1 run), so someone (GBK [http://forums.massassi.net/html/smile.gif]) can help?


About Err check : when player active panel on board of ATR he see new post (sky) but, few moment late (after pulse) game broke...

------------------
2003-02-23, 2:54 PM #2
My eyes, they burn! rearrange that. VERY[/i] hard to read. Try to make all verbs have their own seperate lines, use tabs/spaces to indicate if/while/for loops, etc. I can't see anything wrong with it right now, but I had a very hard time trying to make sense of it all.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2003-02-23, 4:45 PM #3
And add comments!

------------------
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2003-02-23, 5:26 PM #4
Its good to know some of my code is still floating around out there.

Code:
# ATR fly
#
# 2/2002 stand of GBK's mouse vision cog . EH_AceCSF (fixed by GBK, with a little help from CogPad)

Symbols
Message Startup
Message Activated
Message Pulse
Message Damaged
Thing Panel
Thing Player Local
Thing ATR linkid=0
Thing Cam Local
Thing Ally0
Thing Ally1
Thing Ally2
Thing Ally3
Thing Ally4
Thing Ally5
Thing Newpost0
Thing Newpost1
Thing Newpost2
Thing Newpost3
Thing Newpost4
Thing Newpost5
Thing Newpost6
Int StopFall=1 local
Int Fly=0 local
sector endsec
Flex Ac=4
Template shot
thing gh local
Int I=0			Local

End
Code

Startup: 
Player = JKgetlocalplayer(); Capturething(ATR); 
Stop;

Activated:
Cam = Createthingatpos(shot, Getthingsector(ATR), Vectoradd(Getthingpos(ATR), '0 0 0.0001'), '0 0 0');
Attachthingtothingex(Cam, ATR, 0x8);
Setcamerafocus(0, Cam);
Setcamerafocus(1, Cam);
Setactorflags(Player, 0x40000);
Setpulse(0.01);
Stop;

Pulse:
If(Getdebugmodeflags() == 0x400) Setpulse(0.0005); Else Setpulse(0.01);
If(!Getcurrentcamera()) Setthingcurgeomode(ATR, 0);
Else Setthingcurgeomode(ATR, 4);

Gh = Fireprojectile(Player, shot, -1, -1, '0 0 0', '0 0 0', 0, 0, 0, 0);
If(Gh == -1) { Print("Lookvector ghost creation failure."); Stop; }

Setthinglook(ATR, Vectorset(Vectorx(Getthinglvec(Gh)), Vectory(Getthinglvec(Gh)), 0));
Setthinglook(Cam, Getthinglvec(Gh)); Destroything(Gh); Gh = -1;

If(Isthingcrouching(Player) == 1) {
If(!Fly) Setthingvel(ATR, Vectorscale(Vectorset(Vectorx(Getthinglvec(ATR)), Vectory(Getthinglvec(ATR)), 0), Ac));
Else Setthingvel(ATR, Vectorscale(Getthinglvec(Cam), Ac)); }
Else If(StopFall) Stopthing(ATR);

If (GetThingSector(ATR) == endsec) {
TeleportThing(Player, Newpost0);
For(I=0;I<=5;I=I+1) TeleportThing(Ally0,Newpost1);
Destroything(ATR); Setpulse(0);
Setcamerafocus(0, Player); Setcamerafocus(1, Player);
Destroything(Cam); Clearactorflags(Player, 0x40000); }
Stop;

Damaged:
if (GetSenderID() != 0) Stop;
Setpulse(0); JKendlevel(0);
Stop;
End



Oh, yeah. Just for you Emon, I squished it togther and removed the comments that did exist. Let the man code as he sees fit. If you dont like the way the code looks, change it. Thats why Scribe exists.

------------------
Createthingatpos(GBK, 0, '0 0 0', '0 0 0');

[This message has been edited by GBK (edited February 23, 2003).]
And when the moment is right, I'm gonna fly a kite.
2003-02-23, 5:30 PM #5
when i put that in CogWriter it says that its missing a ) in the damaged message area.
Code:
if ((GetSenderID() == 0)

should be
Code:
if ((GetSenderID() == 0))

try that

------------------
Famous last words - "It seemed like a good idea at the time."
2003-02-24, 3:50 AM #6
try If(GetSenderID() != 1) Return;
otherwise your still ending the level, just stopping the pulse.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2003-02-24, 4:31 AM #7
hmm... or the cog is still broken,or i make something wrong in level. enyway cog still break to windows..

------------------
The miners of Kiith Somtaaw sacificed much, and risked all. For their efforts they were brought into the inner most circle of Hiigaren power. Naabal, S'jet, and Sobanii bowed before them. And from that day to this, Somtaaw's children have been known to one and all as Beastslayers..
2003-02-24, 5:54 AM #8
When does it crash?

------------------
Createthingatpos(GBK, 0, '0 0 0', '0 0 0');
And when the moment is right, I'm gonna fly a kite.
2003-02-24, 8:23 AM #9
well.. after you press Console for sec you see sky where should be ATR (i dont see it, perhaps it is but timeis to short to ID it), and after thing (perhaps in next PULSE) game break..

------------------
The miners of Kiith Somtaaw sacificed much, and risked all. For their efforts they were brought into the inner most circle of Hiigaren power. Naabal, S'jet, and Sobanii bowed before them. And from that day to this, Somtaaw's children have been known to one and all as Beastslayers..
2003-02-24, 10:20 AM #10
erm.. i have another cog to check (aaaaaa dont kill me i dont do enytying! [http://forums.massassi.net/html/smile.gif])
Code:
#
#
# 2/2002 EH_AceCSF


Symbols

Message Startup
Message Pulse
message entered
message killed

Thing Player				Local

thing friendly0  linkid=1  mask=0x408           
thing friendly1  linkid=2  mask=0x408           
thing friendly3  linkid=3  mask=0x408           
thing friendly4  linkid=4  mask=0x408           

Thing post0
Thing post1
Thing post2
Thing post3
Thing post4
Thing post5
Thing post6
Thing post7

Thing enemy0
Thing enemy1
Thing enemy2
Thing enemy3
Thing enemy4
Thing enemy5
Thing enemy6
Thing enemy7

sector    sectorstart
sector    target1     linkid=5

ai passive_ai=pednarsh.ai
ai angry_ai

Flex Ac=4

Template shot
Template TermalDetonator

thing   cam1
thing   old_camera local

End


Code

Startup:

Player = JKgetlocalplayer();
aiSetClass(friendly0, passive_ai);
aiSetClass(friendly1, passive_ai);
aiSetClass(friendly2, passive_ai);
aiSetClass(friendly3, passive_ai);
stop;

Entered:

Print("Kyle! Stormtroops are there, we had to go out!");
AISetMoveThing(friendly0, post0);
AISetLookPos(friendly0, GetThingPos(post0));
sleep(3.0);
Print("Too much them! retreat!");
# there should be push of termal detonator by Friendly0 (he have blaster so i cant use Ai Fire)
AISetFireTarget(enemy0, friendly0);
AISetFireTarget(enemy1, friendly0);
AISetFireTarget(enemy2, friendly0);
AISetFireTarget(enemy3, friendly0);
AISetFireTarget(enemy4, friendly0);
AISetFireTarget(enemy5, friendly0);
AISetFireTarget(enemy6, friendly0);
AISetFireTarget(enemy7, friendly0);
stop;

killed:

if (GetSenderID() == 1)
{
Print("Ahh run!");
AISetMoveThing(friendly1, post1);
AISetLookPos(friendly1, GetThingPos(post1));
AISetMoveThing(friendly2, post1);
AISetLookPos(friendly2, GetThingPos(post1));
AISetMoveThing(friendly3, post1);
AISetLookPos(friendly3, GetThingPos(post1));
sleep(1);
AISetMoveThing(friendly1, post2);
AISetLookPos(friendly1, GetThingPos(post2));
AISetMoveThing(friendly2, post2);
AISetLookPos(friendly2, GetThingPos(post2));
AISetMoveThing(friendly3, post2);
AISetLookPos(friendly3, GetThingPos(post2));
Setpulse(0.01);
}
return;

Pulse:
if ((GetThingSector(friendly1) == target1) || GetThingSector(friendly2) == target1) || GetThingSector(friendly3) == target1))
{
setpulse(0);
Print("kyle! There are enter to the city canals, i thing that we can use it.");
      SetActorFlags(player, 0xa00000);
      old_camera = GetCurrentCamera();
      SetCurrentCamera(0);
      SetCameraFocus(0, cam1);
TeleportThing(Player, post3); 
sleep(1);
TeleportThing(friendly1, post3); 
sleep(1);
TeleportThing(friendly2, post3); 
sleep(1);
TeleportThing(friendly3, post3);
      sleep(5);
   ClearActorFlags(player, 0xa00000);
   SetCameraFocus(0, player);
   SetCurrentCamera(old_camera);
}
Return;

Stop;

End



------------------
The miners of Kiith Somtaaw sacificed much, and risked all. For their efforts they were brought into the inner most circle of Hiigaren power. Naabal, S'jet, and Sobanii bowed before them. And from that day to this, Somtaaw's children have been known to one and all as Beastslayers..
2003-02-24, 12:13 PM #11
Just looking over it quickly, I see that this line has a big mistake:

if ((GetThingSector(friendly1) == target1) || GetThingSector(friendly2) == target1) || GetThingSector(friendly3) == target1))

change it to:

if (GetThingSector(friendly1) == target1 || GetThingSector(friendly2) == target1 || GetThingSector(friendly3) == target1)

------------------
Team Battle.
Team Battle.
2003-02-24, 1:02 PM #12
GBK, I'd just thought you'd like some tips on how programmers work in the real world.

------------------
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2003-02-24, 1:12 PM #13
#1, Im not a programmer. I dont want to be one, I wont pretend to be one.

#2, this isnt the real world, and this isnt programming at all. This is scripting. The look of the script is completely and utterly irrelevent. Whether the cog has comments or not will not fetch you a better review.


In short; sod off.

------------------
Createthingatpos(GBK, 0, '0 0 0', '0 0 0');
And when the moment is right, I'm gonna fly a kite.
2003-02-24, 2:10 PM #14
And comments mean nothing if you don't know the code. not vica versa.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack

↑ Up to the top!