set my, unpassable?

Posted By: rtsgamer706

set my, unpassable? - 05/08/11 01:13

I am a programmer working with the free version of A8.
At one point in the game my character becomes passable through

set (my, PASSABLE);

once a collision has happened I added

reset (my, PASSABLE);

but my character is still passable!
What am I doing wrong?
Thanks
Rtsgamer706
Posted By: darkinferno

Re: set my, unpassable? - 05/08/11 01:39

hm ? can you show the code ? because thats weird, reset is what you should be calling ...
Posted By: rtsgamer706

Re: set my, unpassable? - 05/08/11 13:25

my "bad guy" has the following code set as "my.event ="
Quote:
action game_over()
{
if(event_type = EVENT_ENTITY)
{
if(jump < 1)
{
flashing = 65;`
if(!you.skill57)
{
alive -= 1;
set (your, PASSABLE);
wait(-0.5);
my.pan += 180;
if (flashing <= 1)
{
c_move (me, vector(0, 0, 37*time_step), nullvector, GLIDE); // move the player up
reset (character, PASSABLE);
flashing = 0;
}
if (flashing >= 1)
while (my)
{
flashing -= 1;
wait(1);
}
}
}
}
}


character is the pointer to my main character
I know the variable is decreasing and everything.
What happens is when I get hit I become invincible (passable) and gravity disables
After 65 frames gravity re-enables, but since my guy won't "reset" his passable I fall through the floor!
Thanks for the help and tell me if you need to know anything else.
Rtsgamer706
Posted By: Widi

Re: set my, unpassable? - 05/09/11 13:31

if(event_type = EVENT_ENTITY)

is wrong:

if(event_type == EVENT_ENTITY)

And use the code tags, more easy to "read" your code!
Posted By: rtsgamer706

Re: set my, unpassable? - 05/09/11 16:04

the second = didn't change anything
the action still runs fine, my problem is that I fall through the floor.
What do you mean by "code tags?"
Thanks for the help.
Rtsgamer706
Posted By: 3dgs_snake

Re: set my, unpassable? - 05/09/11 16:16

Hi,

Perhaps "your" and "character" variables point to different entities.

in your code :
Code:
set(your, PASSABLE);


and
Code:
reset(character, PASSABLE);



Is it really what you want?

Best regards.
Posted By: Rondidon

Re: set my, unpassable? - 05/09/11 17:51

Could you repost your code using the [ code ] tags instead of [ quote ]? It`s really hard to read your code. And comments would be nice.

Thatīs what I`m talking about:

Code:
//////////////////////////////////////////////////////////////
// Code to show a text with "hello world" on engine startup //
//////////////////////////////////////////////////////////////

#include <acknex.h>  //include the engine
#include <default.c> 

STRING* my_sample = "hello world"; //the sting

FONT* test_font = "arial#20b"; //the font

TEXT* my_notice = //text object "my_notice"
{
	pos_x = 100; //x,y position
	pos_y = 200;
	font = test_font; //attach font to text object
	string = my_sample; //attach string to text object
}

function main() //main function running on engine startup
{
	set(my_notice,VISIBLE); //Show the text object on engine startup 
}


Posted By: rtsgamer706

Re: set my, unpassable? - 05/09/11 21:38

Here it is:
Code:
action game_over()
{
	if(event_type == EVENT_ENTITY)
	{
		if(jump < 1)
		{
		flashing = 65;`
		if(!you.skill57)
		{
		alive -= 1;
		set (your, PASSABLE);
		wait(-0.5);
		my.pan += 180;
		if (flashing <= 1)
		{
		c_move (me, vector(0, 0, 37*time_step), nullvector, GLIDE); // move the player up
		reset (Mario, PASSABLE);
		flashing = 0;
		}`
		if (flashing >= 1)
		while (my)
		{
			flashing -= 1;
			wait(1);
		}
		}
		}
	}
}


Hope this helps
Rtsgamer706
Posted By: rtsgamer706

Re: set my, unpassable? - 05/14/11 22:25

Hey A8 community
I haven't gotten a reply since I posted my code properly.
was just wondering if there was something wrong with the post
or if I really just have an unfix-able problem.
Thanks for the help
Rtsgamer706
© 2023 lite-C Forums