Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
3 registered members (Martin_HH, steyr, alibaba), 509 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
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 Offline OP
Senior Member
sadsack  Offline 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 Offline OP
Senior Member
sadsack  Offline 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 Offline OP
Senior Member
sadsack  Offline 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:
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 Offline
Expert
EvilSOB  Offline
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...
Code:
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 Offline OP
Senior Member
sadsack  Offline 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

Page 2 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1