Gamestudio Links
Zorro Links
Newest Posts
Purchase A8 full licence version
by ukgamer. 04/29/26 18:09
Z9 getting Error 058
by k_ivan. 04/25/26 19:13
ZorroGPT
by TipmyPip. 04/25/26 16:09
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 5,733 guests, and 39 spiders.
Key: Admin, Global Mod, Mod
Newest Members
ukgamer, valino, juergenwue, VladMak, Geir
19210 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
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 Offline OP

X
rayp  Offline 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 frown

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 Offline
Member
GamerX  Offline
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: GamerX] #237409
11/20/08 02:31
11/20/08 02:31
Joined: Jul 2008
Posts: 2,111
Germany
rayp Offline OP

X
rayp  Offline OP

X

Joined: Jul 2008
Posts: 2,111
Germany
Sure ive tryed this...but somehow it wont work right...or mayby im too tired and thought it dont works...


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] #237411
11/20/08 02:35
11/20/08 02:35
Joined: Aug 2008
Posts: 218
U.S.
GamerX Offline
Member
GamerX  Offline
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: GamerX] #237415
11/20/08 02:40
11/20/08 02:40
Joined: Jul 2008
Posts: 2,111
Germany
rayp Offline OP

X
rayp  Offline OP

X

Joined: Jul 2008
Posts: 2,111
Germany
ure right. But in this case its the same. I just need a logic to
get the views to work. Im relly not fit with vector stuff...
I dont know why the f.ex. >0 <90 thing dont work


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] #237416
11/20/08 02:45
11/20/08 02:45
Joined: Aug 2008
Posts: 218
U.S.
GamerX Offline
Member
GamerX  Offline
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: GamerX] #237421
11/20/08 02:58
11/20/08 02:58
Joined: Jul 2008
Posts: 2,111
Germany
rayp Offline OP

X
rayp  Offline OP

X

Joined: Jul 2008
Posts: 2,111
Germany
When ill make it with 4 ifs like

Code:
IF(my.pan>0)&&(my.pan<90)   { ...RIGHT...}
IF(my.pan>90)&&(my.pan<270) { ...DOWN... }
..
.


It just dont changes correct the sides. Ill keep trying...


Last edited by rayp; 11/20/08 02:58.

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] #237424
11/20/08 03:01
11/20/08 03:01
Joined: Aug 2008
Posts: 218
U.S.
GamerX Offline
Member
GamerX  Offline
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.

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: GamerX] #237426
11/20/08 03:07
11/20/08 03:07
Joined: Jul 2008
Posts: 2,111
Germany
rayp Offline OP

X
rayp  Offline OP

X

Joined: Jul 2008
Posts: 2,111
Germany
Try ure code with all 4 directions...and look if it still works...if u want smile


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] #237429
11/20/08 03:24
11/20/08 03:24
Joined: Aug 2008
Posts: 218
U.S.
GamerX Offline
Member
GamerX  Offline
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.


Code:
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
Page 1 of 2 1 2

Gamestudio download | 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