|
0 registered members (),
5,733
guests, and 39
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Sprites with sides like in old 2d-3d-games
#237401
11/20/08 01:24
11/20/08 01:24
|
Joined: Jul 2008
Posts: 2,111 Germany
rayp
OP
 
X
|
OP
 
X
Joined: Jul 2008
Posts: 2,111
Germany
|
Can anybody tell me how i could write a action for sprite entitys to turn into the correct side-view when i walk around them. F.ex. i have 4 files: FRONT.PCX -front view of sprite entity RIGHT.PCX -right view of sprite entity BACK.PCX -... LEFT.PCX -.. How can i program the action to handle the 4 sides like in the DukeNukem3D, Doom times ? First i simple wanted to check my.pan like IF (MY.pan==90) { ...RIGHT.PCX... } But this would only work when my.pan is exactly 90 
Last edited by rayp; 11/20/08 01:30.
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;
|
|
|
Re: Sprites with sides like in old 2d-3d-games
[Re: rayp]
#237405
11/20/08 02:13
11/20/08 02:13
|
Joined: Aug 2008
Posts: 218 U.S.
GamerX
Member
|
Member
Joined: Aug 2008
Posts: 218
U.S.
|
If(my.pan > 40 && my.pan < 80)
if the pan is between 40 and 80. I think that is what u wanted right? If not sorry lol.
"You may never know what results come of your action, but if you do nothing there will be no result." -Mahatma Gandhi
|
|
|
Re: Sprites with sides like in old 2d-3d-games
[Re: rayp]
#237411
11/20/08 02:35
11/20/08 02:35
|
Joined: Aug 2008
Posts: 218 U.S.
GamerX
Member
|
Member
Joined: Aug 2008
Posts: 218
U.S.
|
Ahh ur using c_script i don't really use c-script other than particle function and stuff. I keep seeing people say that lite-c will probably be even more dominant in the future which is why i use it instead of c-script. Sorry:(
"You may never know what results come of your action, but if you do nothing there will be no result." -Mahatma Gandhi
|
|
|
Re: Sprites with sides like in old 2d-3d-games
[Re: rayp]
#237416
11/20/08 02:45
11/20/08 02:45
|
Joined: Aug 2008
Posts: 218 U.S.
GamerX
Member
|
Member
Joined: Aug 2008
Posts: 218
U.S.
|
You can try splitting it up like this if(my.pan > 0 &&(my.pan < 90))
Not sure but i seen that once, never used it my self so not sure but worth trying if you havn't. Don't know why the the x>0 && x<90 thing doesn't work for you i use it all the time.
"You may never know what results come of your action, but if you do nothing there will be no result." -Mahatma Gandhi
|
|
|
Re: Sprites with sides like in old 2d-3d-games
[Re: rayp]
#237424
11/20/08 03:01
11/20/08 03:01
|
Joined: Aug 2008
Posts: 218 U.S.
GamerX
Member
|
Member
Joined: Aug 2008
Posts: 218
U.S.
|
Well i did it in lite-c and had my character morph when he was turned between like 30 and 90 here is the code.
action turn_test()
{
while(1)
{
if(key_d) my.pan -=1;
if(key_a) my.pan +=1;
if(my.pan > 30 && my.pan < 90)
{
ent_morph(me,"player4.mdl");
}
wait(1);
}
}
Proly something like you been trying so i don't know why it wouldn't work, but it could be just that ur using c_script.
"You may never know what results come of your action, but if you do nothing there will be no result." -Mahatma Gandhi
|
|
|
Re: Sprites with sides like in old 2d-3d-games
[Re: rayp]
#237429
11/20/08 03:24
11/20/08 03:24
|
Joined: Aug 2008
Posts: 218 U.S.
GamerX
Member
|
Member
Joined: Aug 2008
Posts: 218
U.S.
|
Ahh the only prob with that script is the pan goes into the neg because it takes away to much or it goes really high. Can fix that easily. And yes i made it with 4 morphs and it worked.
action turn_test()
{
while(1)
{
if(key_d) my.pan -=1;
if(key_a) my.pan +=1;
if(my.pan > 0 && my.pan < 100)
{
ent_morph(my,"player4.mdl");
}
if(my.pan > 100 && my.pan < 200)
{
ent_morph(my,"player2.mdl");
}
if(my.pan > 200 && my.pan < 300)
{
ent_morph(my,"player5.mdl");
}
if(my.pan > 300)
{
ent_morph(my,"player1.mdl");
}
if(my.pan < 0) my.pan = 360;
if(my.pan > 360) my.pan = 0;
wait(1);
}
}
Last edited by GamerX; 11/20/08 03:27.
"You may never know what results come of your action, but if you do nothing there will be no result." -Mahatma Gandhi
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|