View Full Version : help, whats wong?
[SF]pjb
04-18-2003, 03:38 PM
symbols
surface flush
message activated
surface loowater
sound flushs
flex howloud
end
code
activated:
//the surface is activated
//move the water and play the sound
PlaySoundGlobal(flushs , howloud, 0.0, 0x4); //playsound
SurfaceAnim(loowater,15,1);//play matiral animation
sleep(GetSoundLen(flushs)); //wait for the flush to stop
StopSurfaceAnim(loowater); //stop surface animation
return;
end;
//why wont that move the mat in MP?
# ***********************************
# ****PJB's Secret Apartment Cog*****
# ***********************************
# Lucasarts acsept no responsability for this cog, and it is not endorsed or made by them.
#
# made my PJb (pokejoyboy@aol.com, PJB@pjb.i8.com)
#18/04/03
#
#----------------now for the flags--------------
//ignore 0x40
#----------------now for the symbols--------------
symbols
thing roomdoor linkid=0
surface direct linkid=4
surface spass1 linkid=1
surface spass2 linkid=2
surface spass3 linkid=3
flex 1d=-1 local
flex pass1=-1 local
flex pass2=-1 local
flex pass3=-1 local
flex code1=a
flex code2=b
flex code3=c
flex locka=-1 local
flex lockb=-1 local
flex lockc=-1 local
message activated
end
#----------------now for the code--------------
code
activated:
id=GetSenderID(); //find out wich surface was activated, or the door
//commands for the door.
if (id==0) call door; //if its the door go to a scrtion to see if the passcode is correct.
//commands for surface 1;
if (id==1) pass1=pass1+1;
if (pass1==10) pass1=0;
if (id==1) SetSurfaceCel(spass1, pass1);
//commands for surface 2
if (id==2) pass2=pass2+1;
if (pass2==10) pass2=0;
if (id==2) SetSurfaceCel(spass2, pass2);
//commands for surface 3;
if (id==3) pass3=pass3+1;
if (pass3==10) pass3=0;
if (id==3) SetSurfaceCel(spass3, pass3);
//if your opening from inside
if (id==4) call odoor; //if your openign from the inside go strait to teh opendoor sectrion of cog.
return;
door: //find if the code is right, and open or dont open the door
//this part changes the data you enter into the code1 area data
if (code1==0) locka=0;
if (code1==1) locka=3;
if (code1==2) locka=5;
if (code1==3) locka=4;
if (code1==4) locka=2;
if (code1==5) locka=6;
if (code1==6) locka=8;
if (code1==7) locka=7;
if (code1==8) locka=9;
if (code1==9) locka=1;
//this part changes the data you enter into the code2 area data
if (code2==0) lockb=1;
if (code2==1) lockb=5;
if (code2==2) lockb=7;
if (code2==3) lockb=4;
if (code2==4) lockb=3;
if (code2==5) lockb=2;
if (code2==6) lockb=8;
if (code2==7) lockb=9;
if (code2==8) lockb=0;
if (code2==9) lockb=6;
//this part changes the data you enter into the code3 area data
if (code3==0) lockc=4;
if (code3==1) lockc=6;
if (code3==2) lockc=3;
if (code3==3) lockc=5;
if (code3==4) lockc=7;
if (code3==5) lockc=2;
if (code3==6) lockc=1;
if (code3==7) lockc=8;
if (code3==8) lockc=0;
if (code3==9) lockc=9;
if (pass1!=locka) return;
else if (pass2!=lockb) return;
else if (pass3!=lockc) return;
else call odoor; //find out if the combo is corect, if it is, then call opendoor
return;
odoor: //open door
movetoframe(roomdoor,1);
SetSurfaceCel(direct, 1);
sleep(2);
movetoframe(roomdoor,0);
SetSurfaceCel(direct, 0);
return;
end;
//why wont it work!
------------------
I am pjb.
Another post......
another moment of my life wasted.....
DSLS_DeathSythe
04-18-2003, 04:49 PM
in your seceret door code cog:
in the symbols you put
flex 1d=-1 local
you need it to be
flex id=-1 local
(might have just been a typo when you were posting it)
and
flex code1=a
flex code2=b
flex code3=c
i dont think flexs can equal letters.
down in the odoor section you didnt put the door move speed in.
---
movetoframe(roomdoor,1, ???MOVESPEED??? );
movetoframe(roomdoor,0, ???MOVESPEED??? );
---
also there doesnt need to be a ';' on that last 'end'.
those are some of the problems that i saw just looking it over.
------------------
[This message has been edited by DSLS_DeathSythe (edited April 18, 2003).]
[SF]pjb
04-19-2003, 05:27 AM
ahh, that sounds like it. thanks
p.s.if sabermaster reads this i sent him a e-mail at yahhoo
------------------
I am pjb.
Another post......
another moment of my life wasted.....
[SF]pjb
04-19-2003, 06:52 AM
ok, while i wait to knwo why the loowater dident move for other (non hosT) players, here that door.cog, and it still wont work.
# ***********************************
# ****PJB's Secret Apartment Cog*****
# ***********************************
# Lucasarts acsept no responsability for this cog, and it is not endorsed or made by them.
#
# made my PJb (pokejoyboy@aol.com, PJB@pjb.i8.com)
#18/04/03
#
#----------------now for the flags--------------
#----------------now for the symbols--------------
symbols
thing roomdoor linkid=0
surface direct linkid=4
surface spass1 linkid=1
surface spass2 linkid=2
surface spass3 linkid=3
flex id=-1 local
flex pass1=-1 local
flex pass2=-1 local
flex pass3=-1 local
flex code1=0
flex code2=0
flex code3=0
flex locka=-1 local
flex lockb=-1 local
flex lockc=-1 local
message activated
end
#----------------now for the code--------------
code
activated:
id=GetSenderID(); //find out wich surface was activated, or the door
//commands for the door.
if (id==0) call door; //if its the door go to a scrtion to see if the passcode is correct.
//commands for surface 1;
if (id==1) pass1=pass1+1;
if (pass1==10) pass1=0;
if (id==1) SetSurfaceCel(spass1, pass1);
//commands for surface 2
if (id==2) pass2=pass2+1;
if (pass2==10) pass2=0;
if (id==2) SetSurfaceCel(spass2, pass2);
//commands for surface 3;
if (id==3) pass3=pass3+1;
if (pass3==10) pass3=0;
if (id==3) SetSurfaceCel(spass3, pass3);
//if your opening from inside
if (id==4) call odoor; //if your openign from the inside go strait to teh opendoor sectrion of cog.
return;
door: //find if the code is right, and open or dont open the door
//this part changes the data you enter into the code1 area data
if (code1==0) locka=0;
if (code1==1) locka=3;
if (code1==2) locka=5;
if (code1==3) locka=4;
if (code1==4) locka=2;
if (code1==5) locka=6;
if (code1==6) locka=8;
if (code1==7) locka=7;
if (code1==8) locka=9;
if (code1==9) locka=1;
//this part changes the data you enter into the code2 area data
if (code2==0) lockb=1;
if (code2==1) lockb=5;
if (code2==2) lockb=7;
if (code2==3) lockb=4;
if (code2==4) lockb=3;
if (code2==5) lockb=2;
if (code2==6) lockb=8;
if (code2==7) lockb=9;
if (code2==8) lockb=0;
if (code2==9) lockb=6;
//this part changes the data you enter into the code3 area data
if (code3==0) lockc=4;
if (code3==1) lockc=6;
if (code3==2) lockc=3;
if (code3==3) lockc=5;
if (code3==4) lockc=7;
if (code3==5) lockc=2;
if (code3==6) lockc=1;
if (code3==7) lockc=8;
if (code3==8) lockc=0;
if (code3==9) lockc=9;
if (pass1!=locka) return;
else if (pass2!=lockb) return;
else if (pass3!=lockc) return;
else call odoor; //find out if the combo is corect, if it is, then call opendoor
return;
odoor: //open door
movetoframe(roomdoor,1,5);
SetSurfaceCel(direct, 1);
sleep(2);
movetoframe(roomdoor,0,5);
SetSurfaceCel(direct, 0);
return;
end;
p.s. if someone would be a mentor to me, that would help. (mentor means teacher right?)
------------------
I am pjb.
Another post......
another moment of my life wasted.....
DSLS_DeathSythe
04-19-2003, 10:45 AM
not sure if it would matter but you could put returns after all the different parts of the activated message, like this for the command 1
//-commands for surface 1
if(id == 1)
{
pass1 = pass1 + 1;
if(pass1 > 9) pass1 = 0;
SetSurfaceCel(spass1, pass1);
return;
}
and something like that for each of the other ones. the if(pass1>9) is probably a better thing to use than if(pass1==10), probably doesnt matter but thats what i usually use.
down were it checks the code to see if its right could be put differently too.
//-find out if the combo is corect, if it is, then call opendoor
if((pass1 != locka) || (pass2 != lockb) || (pass3 != lockc)) return;
else call odoor;
but im not sure if that matter either.
all them flexs up in the symbols could be ints since your not dealing with any decimals.
all these changes are just different was i would do it, im not sure if they really matter but you could try them.
dont know what the problem is with you loo cog.
------------------
[This message has been edited by DSLS_DeathSythe (edited April 19, 2003).]
[SF]pjb
04-19-2003, 10:58 AM
well i cant see why that would stop it working, but i will change it any way.
waits for the cool GBK or the cooler sabermaster.
------------------
I am pjb.
Another post......
another moment of my life wasted.....
[SF]pjb
04-19-2003, 11:00 AM
Note: the loo cog works, and people in MP hear it, but they cant see teh matirial move, (other from teh hosat that is for whom it works nicely)
------------------
I am pjb.
Another post......
another moment of my life wasted.....
[SF]pjb
04-21-2003, 04:15 AM
hmm, any one?
------------------
I am pjb.
Another post......
another moment of my life wasted.....
DSLS_DeathSythe
04-21-2003, 12:49 PM
i could fix the cogs so they work for you if you want. im not very good at explaining how to do it, its easier for me just to fix them. or you could wait around some more to see if GBK or SM show up.
your choice.
------------------
Descent_pilot
04-21-2003, 03:28 PM
Here, give this a try. Note the use of code tags.
# ***********************************
# ****PJB's Secret Apartment Cog*****
# ***********************************
# Lucasarts acsept no responsability for this cog, and it is not endorsed or made by them.
#
# made my PJb (pokejoyboy@aol.com, PJB@pjb.i8.com) [DP]
#18/04/03
#
#----------------now for the flags--------------
#----------------now for the symbols--------------
symbols
thing roomdoor linkid=0
surface direct linkid=4
surface spass1 linkid=1
surface spass2 linkid=2
surface spass3 linkid=3
flex id local
flex pass1=0 local
flex pass2=0 local
flex pass3=0 local
int code1=0
int code2=0
int code3=0
int locka=-1 local
int lockb=-1 local
int lockc=-1 local
message activated
end
#----------------now for the code--------------
code
Startup:
//this part changes the data you enter into the code1 area data
If(code1==0) locka=0;
If(code1==1) locka=3;
If(code1==2) locka=5;
If(code1==3) locka=4;
If(code1==4) locka=2;
If(code1==5) locka=6;
If(code1==6) locka=8;
If(code1==7) locka=7;
If(code1==8) locka=9;
If(code1==9) locka=1;
//this part changes the data you enter into the code2 area data
If(code2==0) lockb=1;
If(code2==1) lockb=5;
If(code2==2) lockb=7;
If(code2==3) lockb=4;
If(code2==4) lockb=3;
If(code2==5) lockb=2;
If(code2==6) lockb=8;
If(code2==7) lockb=9;
If(code2==8) lockb=0;
If(code2==9) lockb=6;
//this part changes the data you enter into the code3 area data
If(code3==0) lockc=4;
If(code3==1) lockc=6;
If(code3==2) lockc=3;
If(code3==3) lockc=5;
If(code3==4) lockc=7;
If(code3==5) lockc=2;
If(code3==6) lockc=1;
If(code3==7) lockc=8;
If(code3==8) lockc=0;
If(code3==9) lockc=9;
Return;
Activated:
id = GetSenderID(); // Find out what was activated
// Go check the door and if code is correct, open
If(id == 0)
{
If((pass1 == locka && pass2 == lockb && pass3 == lockc)) call door;
Return;
}
// Commands for surface 1;
If(id == 1)
{
pass1 = pass1 + 1;
if(pass1 == 10) pass1 = 0;
SetSurfaceCel(spass1, pass1);
Return;
}
// Commands for surface 2
If(id == 2)
{
pass2 = pass2 + 1;
If(pass2 == 10) pass2 = 0;
SetSurfaceCel(spass2, pass2);
Return;
}
// Commands for surface 3
If(id == 3)
{
pass3 = pass3 + 1;
If(pass3 == 10) pass1 = 0;
SetSurfaceCel(spass3, pass=3);
Return;
}
// If your opening from the inside, there becomes no need to check
If(id == 4) call door;
Return;
Door: // Open door
MoveToFrame(roomdoor, 1, 5);
SetSurfaceCel(direct, 1);
Sleep(2);
MoveToFrame(roomdoor, 0, 5);
SetSurfaceCel(direct, 0);
Return;
end;
Now all that's required is the close door part. http://forums.massassi.net/html/wink.gif note once again the use of code tags
------------------
The Sniper Missions. Current project, The Sniper Missions
The Magician Saber System.
[This message has been edited by Descent_pilot (edited April 21, 2003).]
[SF]pjb
04-22-2003, 11:46 AM
ohh, thanks desent, sorry about the code tags, i forgot about them, my mate was pestering me...
------------------
I am pjb.
Another post......
another moment of my life wasted.....
[This message has been edited by [SF]pjb (edited April 22, 2003).]
[SF]pjb
04-22-2003, 12:05 PM
ok somthing is wong with the cog.
i fixed the pass=3 insted of pass3 so the third cell woudld move,and the pass1=0 insted of pass3=0 and now.....
when i input the right conbonation, the door wont open!.
and i was wondering is there any way i could put a secret settign into the cog so i can open all doors its used on with my own combonation? a kind of back door code.
(and i will add this myself if you dont) but i would'ent mind if you coudl reset all the passcode data after the door opens. possebly on the walls aswell.
and it will probebly be simple, but i was kept up far to late by a party next door (note to self: must kill next door nabors), and then i was woken up far to early for school... so i am all-most dead on my feet i am so tired (guy shouts dead man walking, pjb trys to hit him but falls flat on his face and starts sleeping)
------------------
I am pjb.
Another post......
another moment of my life wasted.....
[This message has been edited by [SF]pjb (edited April 22, 2003).]
DSLS_DeathSythe
04-22-2003, 06:20 PM
heres the cog i made from editing your cog pjb. it worked when i tested it. i made it so it clears the data code data when the door is opened too.
# ***********************************
# ****PJB's Secret Apartment Cog*****
# ***********************************
# Lucasarts acsept no responsability for this cog,
# and it is not endorsed or made by them.
#
# made my PJb (pokejoyboy@aol.com, PJB@pjb.i8.com)
# 18/04/03
#
#----------------now for the symbols--------------
symbols
#-----
message activated
thing roomdoor linkid=0
surface direct linkid=4
surface spass1 linkid=1
surface spass2 linkid=2
surface spass3 linkid=3
int id local
int pass1=0 local
int pass2=0 local
int pass3=0 local
int code1=0
int code2=0
int code3=0
int locka=0 local
int lockb=0 local
int lockc=0 local
#-----
end
#----------------now for the code--------------
code
#-----
activated:
//-find out wich surface was activated, or the door
id = GetSenderID();
//-commands for the door.
//if its the door go to a scrtion to see if the passcode is correct.
if(id == 0)
{
call door;
return;
}
//-commands for surface 1;
if(id == 1)
{
pass1 = pass1 + 1;
if(pass1 > 9)
pass1 = 0;
SetSurfaceCel(spass1, pass1);
return;
}
//-commands for surface 2
if(id == 2)
{
pass2 = pass2 + 1;
if(pass2 > 9)
pass2 = 0;
SetSurfaceCel(spass2, pass2);
return;
}
//-commands for surface 3;
if(id == 3)
{
pass3 = pass3 + 1;
if(pass3 > 9)
pass3 = 0;
SetSurfaceCel(spass3, pass3);
return;
}
//-if your opening from inside
//-if your openign from the inside go strait to teh opendoor sectrion of cog.
if(id==4)
call odoor;
return;
#-----
door:
//-find if the code is right, and open or dont open the door
//-this part changes the data you enter into the code1 area data
if(code1 == 0) locka = 0;
if(code1 == 1) locka = 3;
if(code1 == 2) locka = 5;
if(code1 == 3) locka = 4;
if(code1 == 4) locka = 2;
if(code1 == 5) locka = 6;
if(code1 == 6) locka = 8;
if(code1 == 7) locka = 7;
if(code1 == 8) locka = 9;
if(code1 == 9) locka = 1;
//-this part changes the data you enter into the code2 area data
if(code2 == 0) lockb = 1;
if(code2 == 1) lockb = 5;
if(code2 == 2) lockb = 7;
if(code2 == 3) lockb = 4;
if(code2 == 4) lockb = 3;
if(code2 == 5) lockb = 2;
if(code2 == 6) lockb = 8;
if(code2 == 7) lockb = 9;
if(code2 == 8) lockb = 0;
if(code2 == 9) lockb = 6;
//-this part changes the data you enter into the code3 area data
if(code3 == 0) lockc = 4;
if(code3 == 1) lockc = 6;
if(code3 == 2) lockc = 3;
if(code3 == 3) lockc = 5;
if(code3 == 4) lockc = 7;
if(code3 == 5) lockc = 2;
if(code3 == 6) lockc = 1;
if(code3 == 7) lockc = 8;
if(code3 == 8) lockc = 0;
if(code3 == 9) lockc = 9;
//-find out if the combo is corect, if it is, then call opendoor
if((pass1 != locka) || (pass2 != lockb) || (pass3 != lockc)) return;
else
call odoor;
return;
#-----
odoor:
//-open door
MoveToFrame(roomdoor, 1, 5);
SetSurfaceCel(direct, 1);
//-Clear out code data...
SetSurfaceCel(spass1, 0);
SetSurfaceCel(spass2, 0);
SetSurfaceCel(spass3, 0);
pass1 = 0;
pass2 = 0;
pass3 = 0;
//-Close the door...
Sleep(2);
MoveToFrame(roomdoor, 0, 5);
SetSurfaceCel(direct, 0);
return;
#=====
end
i didnt that back door code part in. the only way i can think of to do that would be to make it so you have to hit the buttons in the right order. if that sounds like a good idea i, you or someone else can try to make it work like that.
do you still need that loo cog, or have you gotten that to work already?
------------------
[This message has been edited by DSLS_DeathSythe (edited April 22, 2003).]
[SF]pjb
04-23-2003, 05:11 AM
thanks, now i need to sync the loowater.
------------------
I am pjb.
Another post......
another moment of my life wasted.....
[This message has been edited by [SF]pjb (edited April 23, 2003).]
DSLS_DeathSythe
04-23-2003, 12:20 PM
this may work for you loo cog.
#-COG flags: make it run local (0x40), and not sync (0x200)
flags=0x240
symbols
#=====
message startup
message activated
message trigger
message timer
surface flush
surface loowater
sound flushs
flex howloud=1.0
int is_busy=0 local
#Trig
int flush_trig=1
#-----
end
#=====
code
#-----
startup:
//-Reset these when the level starts just to be safe...
is_busy = 0;
StopSurfaceAnim(loowater);
return;
#-----
activated:
//-The surface is activated...
//-Send the trigger that makes the cog work...
//-Check to see if its already on...
if(is_busy == 1) return;
SendTrigger(-1, flush_trig, 0, 0, 0, 0);
return;
#-----
trigger:
//-Check to see if its the right trigger...
if(GetSourceRef() != flush_trig) return;
is_busy = 1;
//-PlaySoundLocal...
PlaySoundLocal(flushs, howloud, 0.0, 0x4);
//-Play surface animation...
SurfaceAnim(loowater, 15, 1);
//-Wait for the flush to stop
SetTimer(GetSoundLen(flushs));
#-----
timer:
//-Stop surface animation...
StopSurfaceAnim(loowater);
is_busy = 0;
return;
#=====
end
see if that works for you. as with all triggers just make sure that the flush_trig is different from any other triggers in any other cogs you are using.
i didnt test it out but it should work.
------------------
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.