|
2 registered members (3run, AndrewAMD),
667
guests, and 1
spider. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: set my, unpassable?
[Re: darkinferno]
#369882
05/08/11 13:25
05/08/11 13:25
|
Joined: Dec 2009
Posts: 361
rtsgamer706
OP
Senior Member
|
OP
Senior Member
Joined: Dec 2009
Posts: 361
|
my "bad guy" has the following code set as "my.event =" 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
|
|
|
Re: set my, unpassable?
[Re: rtsgamer706]
#369924
05/09/11 13:31
05/09/11 13:31
|
Joined: Aug 2007
Posts: 1,922 Schweiz
Widi
Serious User
|
Serious User
Joined: Aug 2007
Posts: 1,922
Schweiz
|
if(event_type = EVENT_ENTITY)
is wrong:
if(event_type == EVENT_ENTITY)
And use the code tags, more easy to "read" your code!
Last edited by Widi; 05/09/11 13:33.
|
|
|
Re: set my, unpassable?
[Re: rtsgamer706]
#369936
05/09/11 16:16
05/09/11 16:16
|
Joined: Feb 2010
Posts: 320 TANA/Madagascar
3dgs_snake
Senior Member
|
Senior Member
Joined: Feb 2010
Posts: 320
TANA/Madagascar
|
Hi, Perhaps "your" and "character" variables point to different entities. in your code : and
reset(character, PASSABLE);
Is it really what you want? Best regards.
|
|
|
Re: set my, unpassable?
[Re: 3dgs_snake]
#369947
05/09/11 17:51
05/09/11 17:51
|
Joined: Aug 2002
Posts: 2,183 Germany, BaW�
Rondidon
Expert
|
Expert
Joined: Aug 2002
Posts: 2,183
Germany, BaW�
|
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 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
}
|
|
|
Re: set my, unpassable?
[Re: Rondidon]
#369958
05/09/11 21:38
05/09/11 21:38
|
Joined: Dec 2009
Posts: 361
rtsgamer706
OP
Senior Member
|
OP
Senior Member
Joined: Dec 2009
Posts: 361
|
Here it is:
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
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|