|
|
Re: door up stop, door down,stop that would be nice
[Re: EvilSOB]
#293291
10/10/09 14:33
10/10/09 14:33
|
Joined: Aug 2008
Posts: 408 mi usa
sadsack
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2008
Posts: 408
mi usa
|
EvilSOB I will try that out now Thank You renny
I have A7 Commercial .............. Now I just need to learn how to use it
|
|
|
Re: door up stop, door down,stop that would be nice
[Re: sadsack]
#293430
10/11/09 13:07
10/11/09 13:07
|
Joined: Aug 2008
Posts: 408 mi usa
sadsack
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2008
Posts: 408
mi usa
|
Well with the help of the people here I got it to work, giong to refine it some for my needs and will put up the. Thank You renny
I have A7 Commercial .............. Now I just need to learn how to use it
|
|
|
Re: door up stop, door down,stop that would be nice
[Re: sadsack]
#293939
10/15/09 00:40
10/15/09 00:40
|
Joined: Aug 2008
Posts: 408 mi usa
sadsack
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2008
Posts: 408
mi usa
|
Ok one last problem, I hope. I am doing something dumb, I can't get this if else statement to compile. It been a long day, I can't see what I am doing wrong. CODE:
function act_door1()
{
while(!my) {wait(1);}
door1 = my;
my.ambient = 10;
while(my)
{ if(port_door == 0)
if(vec_dist(player1.x,my.x) <= 225)
{ c_move (my,vector(0,0,.3),nullvector,IGNORE_MODELS); }
my.z = clamp(my.z, 0, 85);
port_door = 1;
{
else
}
if(port_door == 1)// door is open
if(vec_dist(player1.x,my.x) <= 225)
{c_move (my,vector(0,0,-.3),nullvector,IGNORE_MODELS); }
my.z = clamp(my.z, 85, 0);
wait(1);
}
}
Is some one can look and see what dumb thing I am doing and let me know. I know it is the else, if I take that out it compiles and run fine. renny
I have A7 Commercial .............. Now I just need to learn how to use it
|
|
|
Re: door up stop, door down,stop that would be nice
[Re: sadsack]
#293942
10/15/09 00:57
10/15/09 00:57
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
You are doing something odd with your "curly" brackets around the else... The 'true' portion of the if doesnt have a closing curly bracket, AND your 'else' portin doesnt have enough brackets, or in the right place. AND you are missing brackets on the very first if in the loop. (dont do this till you are better experienced, VERY hard to debug them.) Looking at your code, Im guessing this is what you want. Ive only arranged this, not tested...
function act_door1()
{
//while(!my) {wait(1);} //dump this line - Not possible to MY to be empty in an action.
door1 = my;
my.ambient = 10;
while(my)
{ if(port_door == 0) // door is closed
{ if(vec_dist(player1.x,my.x) <= 225)
{ c_move (my,vector(0,0,.3),nullvector,IGNORE_MODELS); }
my.z = clamp(my.z, 0, 85);
port_door = 1;
}
else // door is open
{ if(vec_dist(player1.x,my.x) <= 225)
{ c_move (my,vector(0,0,-.3),nullvector,IGNORE_MODELS); }
my.z = clamp(my.z, 85, 0);
}
//
wait(1);
}
}
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: door up stop, door down,stop that would be nice
[Re: EvilSOB]
#293991
10/15/09 12:37
10/15/09 12:37
|
Joined: Aug 2008
Posts: 408 mi usa
sadsack
OP
Senior Member
|
OP
Senior Member
Joined: Aug 2008
Posts: 408
mi usa
|
Oh yes, the little deman things, they are a pain in tht ass. Thank you , I will try to keep the lettle demans in line. renny
I have A7 Commercial .............. Now I just need to learn how to use it
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|