Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (TipmyPip, AndrewAMD, NewbieZorro), 16,055 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
TEX_NAME help #176921
01/07/08 17:01
01/07/08 17:01
Joined: May 2007
Posts: 185
Netherlands
SurudoiRyu Offline OP
Member
SurudoiRyu  Offline OP
Member

Joined: May 2007
Posts: 185
Netherlands
Hi why doesn't this work ???

I should have a text displaying the texture im standing on.
But it doesn't do anything i can walk what ever i want -_-"

Hope someone can help me out.

Code:
 
//skill1: Health 100
//skill2: WalkingSpeed 10
//skill3: TurningSpeed 10
//skill4: JumpHeight 10
//skill5: AttackSpeed 10



//Debug Tekst
string str_type1 = "Aarde"; // Grond types
string str_type2 = "Grass"; // Grond types

//Lettertype
font fnt_century12 = <Centur12.pcx>,16,20; // Century12 font

//Debugging...
text txt_Grond1

{

pos_x = 0;

pos_y = 65;

layer = 15;

font fnt_century12;

string str_type1;

}

text txt_Grond2

{

pos_x = 0;

pos_y = 65;

layer = 15;

font fnt_century12;

string str_type2;

}
///Einde Debug Scripts

action Speler_Beweging()
{
player = my;
camera.genius = my;

c_setminmax(me);

while(my.skill1 > 0)
{
my.skill21 = (key_cuu-key_cud)*my.skill2*time_step;
my.skill22 = (key_cul-key_cur)*my.skill3*time_step;

my.skill30 = c_trace(my.x,vector(my.x,my.y,my.z-10000),IGNORE_PASSABLE|IGNORE_PASSENTS|IGNORE_ME|USE_BOX);
if(my.skill30 > 2)
{
my.skill23 -= 2*time_step;
}else
{
if(my.skill30 < 0)
{
my.skill23 = 5;
}else
{
my.skill23 = 0;
}
}

if(my.skill30 < 2 && key_ctrl)
{
my.skill23 = my.skill4;
my.skill25 = 1;
}

if(my.skill21 != 0)
{
my.skill24 += my.skill21;
my.skill24 %= 100;
ent_animate(me,"run",my.skill24,ANM_CYCLE);
}else
{
my.skill24 += 10*time_step;
my.skill24 %= 100;
ent_animate(me,"stand",my.skill24,ANM_CYCLE);
}

if(my.skill23 == my.skill4 || (my.skill25 < 100 && my.skill25 > 0))
{
my.skill25 += 100/my.skill4*time_step;
ent_animate(me,"jump",my.skill25,NULL);
}

if(key_space && my.skill23 == 0)
{
my.skill24 = 0;
while(my.skill24 < 100)
{
my.skill24 += my.skill5*time_step;
ent_animate(me,"taunt",my.skill24,NULL);

wait(1);
}
}

c_rotate(me,vector(my.skill22,0,0),IGNORE_PASSABLE|IGNORE_PASSENTS);
c_move(me,vector(my.skill21,0,my.skill23),nullvector,IGNORE_PASSABLE|IGNORE_PASSENTS);

wait(1);
}

my.skill24 = 0;



WHILE(player==me)
{
vec_set(temp, my.x);
temp.z -= 500; // trace downwards 500 quants below
c_trace (my.x,temp,IGNORE_ME|IGNORE_PASSABLE|IGNORE_MODELS|IGNORE_SPRITES|SCAN_TEXTURE);
// now TEX_NAME is set to the floor name below the MY entity

if((str_stri(tex_name,"sand") != 0))
{
txt_Grond1.visible = ON;
}
else
{
txt_Grond1.visible = OFF;
}
if((str_stri(tex_name,"grass") != 0))

{
txt_Grond2.visible = ON;
}
else
{
txt_Grond2.visible = OFF;
}
wait(1);
}
}





-The Dragon's Eye is alway's watching you!-
Re: TEX_NAME help [Re: SurudoiRyu] #176922
01/07/08 19:46
01/07/08 19:46
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
lol in the first moment I thought that the comments are german but with a lot of mistakes...^^

Your problem is that the second whileloop is only called if skill1 is null. Just put the content of the second whileloop into the first one or put the loop into an extra function which you call in front of the other loop.

Re: TEX_NAME help [Re: Slin] #176923
01/07/08 20:46
01/07/08 20:46
Joined: May 2007
Posts: 185
Netherlands
SurudoiRyu Offline OP
Member
SurudoiRyu  Offline OP
Member

Joined: May 2007
Posts: 185
Netherlands
How you mean ? i close the first loop :S
So it won't run like a loop in a loop ?
Its not german indeed hehe its dutch ur friendly neighbour hehe


-The Dragon's Eye is alway's watching you!-
Re: TEX_NAME help [Re: SurudoiRyu] #176924
01/07/08 21:27
01/07/08 21:27
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
I meant it like this:
Code:

//skill1: Health 100
//skill2: WalkingSpeed 10
//skill3: TurningSpeed 10
//skill4: JumpHeight 10
//skill5: AttackSpeed 10



//Debug Tekst
string str_type1 = "Aarde"; // Grond types
string str_type2 = "Grass"; // Grond types

//Lettertype
font fnt_century12 = <Centur12.pcx>,16,20; // Century12 font

//Debugging...
text txt_Grond1

{

pos_x = 0;

pos_y = 65;

layer = 15;

font fnt_century12;

string str_type1;

}

text txt_Grond2

{

pos_x = 0;

pos_y = 65;

layer = 15;

font fnt_century12;

string str_type2;

}
///Einde Debug Scripts

action Speler_Beweging()
{
player = my;
camera.genius = my;

c_setminmax(me);

while(my.skill1 > 0)
{
my.skill21 = (key_cuu-key_cud)*my.skill2*time_step;
my.skill22 = (key_cul-key_cur)*my.skill3*time_step;

my.skill30 = c_trace(my.x,vector(my.x,my.y,my.z-10000),IGNORE_PASSABLE|IGNORE_PASSENTS|IGNORE_ME|USE_BOX);
if(my.skill30 > 2)
{
my.skill23 -= 2*time_step;
}else
{
if(my.skill30 < 0)
{
my.skill23 = 5;
}else
{
my.skill23 = 0;
}
}

if(my.skill30 < 2 && key_ctrl)
{
my.skill23 = my.skill4;
my.skill25 = 1;
}

if(my.skill21 != 0)
{
my.skill24 += my.skill21;
my.skill24 %= 100;
ent_animate(me,"run",my.skill24,ANM_CYCLE);
}else
{
my.skill24 += 10*time_step;
my.skill24 %= 100;
ent_animate(me,"stand",my.skill24,ANM_CYCLE);
}

if(my.skill23 == my.skill4 || (my.skill25 < 100 && my.skill25 > 0))
{
my.skill25 += 100/my.skill4*time_step;
ent_animate(me,"jump",my.skill25,NULL);
}

if(key_space && my.skill23 == 0)
{
my.skill24 = 0;
while(my.skill24 < 100)
{
my.skill24 += my.skill5*time_step;
ent_animate(me,"taunt",my.skill24,NULL);

wait(1);
}
}

c_rotate(me,vector(my.skill22,0,0),IGNORE_PASSABLE|IGNORE_PASSENTS);
c_move(me,vector(my.skill21,0,my.skill23),nullvector,IGNORE_PASSABLE|IGNORE_PASSENTS);

vec_set(temp, my.x);
temp.z -= 500; // trace downwards 500 quants below
c_trace (my.x,temp,IGNORE_ME|IGNORE_PASSABLE|IGNORE_MODELS|IGNORE_SPRITES|SCAN_TEXTURE);
// now TEX_NAME is set to the floor name below the MY entity

if((str_stri(tex_name,"sand") != 0))
{
txt_Grond1.visible = ON;
}
else
{
txt_Grond1.visible = OFF;
}
if((str_stri(tex_name,"grass") != 0))

{
txt_Grond2.visible = ON;
}
else
{
txt_Grond2.visible = OFF;
}

wait(1);
}

my.skill24 = 0;
}




Re: TEX_NAME help [Re: Slin] #176925
01/07/08 22:34
01/07/08 22:34
Joined: May 2007
Posts: 185
Netherlands
SurudoiRyu Offline OP
Member
SurudoiRyu  Offline OP
Member

Joined: May 2007
Posts: 185
Netherlands
Ok this is nice i can now see the text ^-^
But next problem showed up is that when i walk over the other texture it doesn't change the text :S
What is wrong with this script ?

Thnx for the great help so far ^-^


-The Dragon's Eye is alway's watching you!-
Re: TEX_NAME help [Re: SurudoiRyu] #176926
01/08/08 10:36
01/08/08 10:36
Joined: May 2007
Posts: 185
Netherlands
SurudoiRyu Offline OP
Member
SurudoiRyu  Offline OP
Member

Joined: May 2007
Posts: 185
Netherlands
Ok i now changed the code a bit and tryed again.
Still the same thing
Like it loads the text only 1 time where it stand and the rest of the game it doesn't do it anymore.

What is wrong with my scanner ? :S


Code:
 
//skill1: Health 100
//skill2: WalkingSpeed 2
//skill3: TurningSpeed 10
//skill4: JumpHeight 10
//skill5: AttackSpeed 10


//defines
define Health, skill1;
define WSpeed, skill2;
define RSpeed, skill3;
define JumpHeight, skill4;
define AttackSpeed, skill5;

//Vars
var move_vec[3] = 0,0,0;
var idle_percent = 0;
var walk_percent = 0;

//Debug Tekst
bmap bmpGrond1 = "sand.pcx"; //Grass Grond
string str_type2 = "Grass"; // Zand Grond
//Water Grond
//Modder Grond

//Lettertype
font fnt_century12 = <Centur12.pcx>,16,20; // Century12 font

//Grond Panels
panel pnl_Grond1

{

bmap = bmpGrond1;

layer = 21;

pos_x = 0;

pos_y = 0;

//on_click = get_off_grond1;

flags = overlay,transparent,refresh;

}

text txt_Grond2

{

pos_x = 0;

pos_y = 65;

layer = 15;

font fnt_century12;

string str_type2;


}
///Einde Debug Scripts

function check_keys()
{
move_vec[0] = (key_w - key_s)*15 *time;
move_vec[1] = (key_a - key_d)*10 *time;

If (move_vec[0] == 0 && move_vec[1] == 0)
{
idle_percent = (idle_percent +5*time)%100;
ent_animate(me,"idle",idle_percent,ANM_CYCLE);
}
else
{
walk_percent = (walk_percent + sign(move_vec[0])*5*time)%100;
ent_animate(player,"walk",walk_percent,ANM_CYCLE);
}

move_mode = IGNORE_YOU + IGNORE_PASSABLE + IGNORE_PUSH + ACTIVATE_TRIGGER + GLIDE;
ent_move(move_vec,NULLVECTOR);

}

function Check_Ground()
{
if(me)
{
c_trace(my.x, vector(my.x, my.y, my.z -10000), IGNORE_SPRITES | IGNORE_PASSENTS | IGNORE_PASSABLE | IGNORE_MODELS | USE_BOX | SCAN_TEXTURE);
if(str_stri(tex_name, "grass") == 1)
{
pnl_Grond1.visible = on;
}
else
{
pnl_Grond1.visible = off;
if(str_stri(tex_name, "sand") == 1)
{
txt_Grond2.visible = on;
}
else
{
txt_Grond2.visible = off;
}
}

}
}




action Speler_Beweging()
{
player = my;
camera.genius = my;

c_setminmax(me);

while(1)
{
if(my.Health > 0)
{
check_keys();
check_ground();
}
wait(1);
}
}



Last edited by SurudoiRyu; 01/08/08 20:51.

-The Dragon's Eye is alway's watching you!-
Re: TEX_NAME help [Re: SurudoiRyu] #176927
01/08/08 21:40
01/08/08 21:40
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
I made a cuple of small changes but I am not sure if it works...:
Code:

//defines
define Health, skill1;
define WSpeed, skill2;
define RSpeed, skill3;
define JumpHeight, skill4;
define AttackSpeed, skill5;

//Vars
var move_vec[3] = 0,0,0;
var idle_percent = 0;
var walk_percent = 0;

//Debug Tekst
bmap bmpGrond1 = "sand.pcx"; //Grass Grond
string str_type2 = "Grass"; // Zand Grond
//Water Grond
//Modder Grond

//Lettertype
font fnt_century12 = <Centur12.pcx>,16,20; // Century12 font

//Grond Panels
panel pnl_Grond1

{

bmap = bmpGrond1;

layer = 21;

pos_x = 0;

pos_y = 0;

//on_click = get_off_grond1;

flags = overlay,transparent,refresh;

}

text txt_Grond2

{

pos_x = 0;

pos_y = 65;

layer = 15;

font fnt_century12;

string str_type2;


}
///Einde Debug Scripts

function check_keys()
{
move_vec[0] = (key_w - key_s)*15 *time;
move_vec[1] = (key_a - key_d)*10 *time;

If (move_vec[0] == 0 && move_vec[1] == 0)
{
idle_percent = (idle_percent +5*time)%100;
ent_animate(me,"idle",idle_percent,ANM_CYCLE);
}
else
{
walk_percent = (walk_percent + sign(move_vec[0])*5*time)%100;
ent_animate(player,"walk",walk_percent,ANM_CYCLE);
}

move_mode = IGNORE_YOU + IGNORE_PASSABLE + IGNORE_PUSH + ACTIVATE_TRIGGER + GLIDE;
ent_move(move_vec,NULLVECTOR);

}

function Check_Ground()
{
c_trace(my.x, vector(my.x, my.y, my.z -10000),IGNORE_ME | IGNORE_SPRITES | IGNORE_PASSENTS | IGNORE_PASSABLE | IGNORE_MODELS | SCAN_TEXTURE);
if(str_stri(tex_name, "grass"))
{
pnl_Grond1.visible = on;
}else
{
pnl_Grond1.visible = off;
if(str_stri(tex_name, "sand"))
{
txt_Grond2.visible = on;
}else
{
txt_Grond2.visible = off;
}
}
}

//skill1: Health 100
//skill2: WalkingSpeed 2
//skill3: TurningSpeed 10
//skill4: JumpHeight 10
//skill5: AttackSpeed 10
action Speler_Beweging()
{
player = my;
camera.genius = my;

c_setminmax(me);

while(my.skill1)
{
check_keys();
check_ground();

wait(1);
}
}



Re: TEX_NAME help [Re: Slin] #176928
01/09/08 01:24
01/09/08 01:24
Joined: May 2007
Posts: 185
Netherlands
SurudoiRyu Offline OP
Member
SurudoiRyu  Offline OP
Member

Joined: May 2007
Posts: 185
Netherlands
No it indeed still doesn't work :S
Does anyone have a sample or know how to do this ?
I just want to check the texture beyong my character and then display the sort of type grond it is on the screen.


Thnx allready for the great help slin maybe u know how to do it.
ill know it soon ^^. i hope...


-The Dragon's Eye is alway's watching you!-
Re: TEX_NAME help [Re: SurudoiRyu] #176929
01/09/08 09:29
01/09/08 09:29
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
I don't have the materials to test it out right now, but I'll get to it ASAP.

First thing I'd try is directly displaying tex_name in a text panel, instead of switching panels...


EDIT: Also, are you sure the loop is running?

Last edited by xXxGuitar511; 01/09/08 09:30.

xXxGuitar511
- Programmer
Re: TEX_NAME help [Re: xXxGuitar511] #176930
01/09/08 09:37
01/09/08 09:37
Joined: May 2007
Posts: 185
Netherlands
SurudoiRyu Offline OP
Member
SurudoiRyu  Offline OP
Member

Joined: May 2007
Posts: 185
Netherlands
Yeah cause i can walk and when i enter the game i see the first (panel in this way) thing related to the ground before i did it with 2 text's but i thought it was the flag refresh that needs to be on thats why there is 1 panel in.

only when i enter i see the thing related to the ground where i stand on but when i walk to another piece of ground it doesn't do anything.

I uploaded my map so you can download and test it your own
My Demo World

Last edited by SurudoiRyu; 01/09/08 09:48.

-The Dragon's Eye is alway's watching you!-
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