Model won't move, collision box does?

Posted By: Spkka

Model won't move, collision box does? - 12/01/09 20:19

Since last night my door entity won't move after I pressed a button. I am pretty sure I didn't change any code.
Thing is I collide with the door before the button is pressed but after its pressed I can just walk through the door while the model stays in place. I have no clue what I am doing wrong.
Posted By: Redeemer

Re: Model won't move, collision box does? - 12/01/09 21:45

Sorry, but we can't help you if you don't show us your code.
Posted By: Spkka

Re: Model won't move, collision box does? - 12/01/09 23:29

Its a model in the WED, set with the polygon flag. And its name is Door. This action is called after I pressed the button. I tried and I get the pointer to the entity. I figured when I add the action to behaviour its just like it should work.
Code:
action OpenDoor()
{
	ENTITY* Door= ent_for_name ( "Door" );
	var a;
	for ( a = 0; a < 300; a++ )
	{
		Door.y -= 0.4;
	}
	wait(1);
}


Posted By: darkinferno

Re: Model won't move, collision box does? - 12/02/09 00:49

but why use ent_for_name ? cant you just assign the action to the model, then my would be equal to that model so you would have:

action Door()
{
var a;
for ( a = 0; a < 300; a++ )
{
my.y -= 0.4;
}
wait(1);
}

this is for a door that moves down? the problem with the above code would be that the door would move up as soon as the level is started
Posted By: Spkka

Re: Model won't move, collision box does? - 12/02/09 11:21

Thank you for the feedback. I worked with ent_for_name right now but it was wrong.
I changed it and assigned the action to the model.
One small question though, how could I make it easier for myself to use multiple doors controlled by keypads. I don't want to create a function for each model of course.
Posted By: rvL_eXile

Re: Model won't move, collision box does? - 12/02/09 13:57

Try to use Skills to identify which door meant the Player..

cYa Sebastian
Posted By: Redeemer

Re: Model won't move, collision box does? - 12/02/09 15:20

You could create a function that gets the scan code of the last key pressed, and then run a switch case with it. For different cases, just open different doors. You can use skills to identify which door the player wants to open like "rvL_eXile" said.
Posted By: Joey

Re: Model won't move, collision box does? - 12/03/09 10:34

wait has to be inside the loop.
Posted By: Spkka

Re: Model won't move, collision box does? - 12/09/09 10:13

Can I set skill70 for example somehow in the WED?
© 2023 lite-C Forums