Gamestudio Links
Zorro Links
Newest Posts
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 715 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 3 1 2 3
Re: Water block not beeping [Re: Wjbender] #452983
07/02/15 20:58
07/02/15 20:58
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
Originally Posted By: Wjbender
Code:
action water()
{
	fx_mirrorWater();
	while(1) {
		if(key_hit("1")) terrain_raise(me,-0.5);
		if(key_hit("2")) terrain_raise(me,0.5);
// skills are defined as var, but shaders use float values 
// conversion is not automatic here, thus we need floatv/fixv
		if(key_hit("3")) my.skill43 = floatv(fixv(my.skill43)-5);
		if(key_hit("4")) my.skill43 = floatv(fixv(my.skill43)+5);
		if(key_hit("5")) my.skill44 = floatv(fixv(my.skill44)-5);
		if(key_hit("6")) my.skill44 = floatv(fixv(my.skill44)+5);
		if(key_hit("7")) mtl_hdr.skill2 = floatv(fixv(mtl_hdr.skill2)+1);
		if(key_hit("8")) mtl_hdr.skill2 = floatv(fixv(mtl_hdr.skill2)-1);
----------------->>>>>> water_height = terrain_get_z(my,1);<<<<<---------------------------------------
		water_ripple = fixv(my.skill43);
		water_scale = fixv(my.skill44);
		hdr_threshold = fixv(mtl_hdr.skill2);
		wait(1);
	}
}



yeah only one i can find too , have you assigned this action to a block or something ?

Ah! Okay, I think you hit on something. I do have a texture in the WED with this same water() action assigned to it, with all the same code assigned to that action, such as fx_mirrorWater(), etc.

I am at work right now. When I get home, I will try deleting this texture from the WED, and see what happens. Thank you! :-)

Re: Water block not beeping [Re: Ruben] #452985
07/03/15 06:04
07/03/15 06:04
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
Okay, so I deleted the file containing the water() action, and I deleted the terrain that used the water() action. I re-attached the main script file in Map Properties in WED to refresh it. I compiled the WED, but I am still getting the same error pop-up about terrain_get_z .

I tried going to a different WED file of mine that never had the water() terrain in it. I placed a region inside of it, and I am still getting the same error pop-up about terrain_get_z .

Does the error just persist even after I deleted the water() file containing terrain_get_z ?

Re: Water block not beeping [Re: Ruben] #452986
07/03/15 06:35
07/03/15 06:35
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
next option is terrain.c level.c

Last edited by Firoball; 07/03/15 11:31.
Re: Water block not beeping [Re: FBL] #452987
07/03/15 09:45
07/03/15 09:45
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
Code:
/ get and set terrain height
function terrain_get_z(ENTITY* ent,number)

// returns the height of the next vertex at the given position
function terrain_height(ENTITY* ent,VECTOR* position)

// return a terrain position above ground
VECTOR* terrain_pos(ENTITY* terrain,x,y,z)

// raise all terrain vertices by the given value
function terrain_raise(ENTITY* terrain, var raise_z)

// raise one terrain vertex by the given value
function terrain_raisevertex(ENTITY* terrain,var x,var y,var raise_z)

function terrain_fence(ENTITY* terrain, var height)

// place an entity at a random position between two height values on terrain
// uses: terrain_buffer
function ent_terrain_place(ENTITY* ent,ENTITY* terrain,minheight,maxheight)

// create entities on terrain, guided from on color spots in a mask
var ent_seed(char* name,ENTITY* terrain,BMAP* mask,COLOR* color,var dist,var mode,EVENT act)

var ent_seed(char* name,ENTITY* terrain,BMAP* mask,COLOR* color,var dist,EVENT act)



are you using any of these functions, they are from "level.c"
see if you can find theire function names somewhere in your scripts..


Compulsive compiler
Re: Water block not beeping [Re: Wjbender] #452990
07/03/15 12:01
07/03/15 12:01
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
screw it , try this ..

assign this action to your water block

Code:
action water_block()
{
	while(!me)wait(1);
	
	//this will be the min/max of the water block
	VECTOR water_min;
	VECTOR water_max;
	
	//this should be your player's min/max you dont need this 
	//i did this for the camera as a demo
	VECTOR player_min;
	VECTOR player_max;
	
	while(me)
	{
		//water min/max values plus position
		vec_set(water_min,my.min_x);
		vec_set(water_max,my.max_x);
		
		vec_add(water_min,my.x);
		vec_add(water_max,my.x);
		
		//player min/max 
		//this should be your player sizes you wish to test intersection against
		vec_set(player_min,vector(camera.x-50,camera.y-50,camera.z-50));
		vec_set(player_max,vector(camera.x+50,camera.y+50,camera.z+50));
		
		//check if player min/max , intersects with , water min/max
		if(c_intersect(water_min,water_max,NULL,player_min,player_max,NULL)==-1)
		{
			DEBUG_VAR(1,100);
			draw_box3d(water_min,water_max,COLOR_GREEN,100);
		}
		else 
		{
			DEBUG_VAR(0,100);
			draw_box3d(water_min,water_max,COLOR_RED,100);
		}

		wait(1);

	}
}


or go with in_passable, I am done.


Compulsive compiler
Re: Water block not beeping [Re: Wjbender] #452997
07/03/15 16:41
07/03/15 16:41
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
Thank you Wjbender.

However, I think I figured out why I kept getting the terrain_get_z error. I had this code in my main() function:

Code:
function main()
{
   ...

   level_terrain = level_ent; // CAUSING terrain_get_z ERROR WHEN REGION IS  PRESENT.
   terrain_tile(level_terrain); // CAUSING terrain_get_z ERROR WHEN REGION IS PRESENT.

   ...
}



When I commented out this code, I no longer get the terrain_get_z error, even if I have a region in my WED file.

I will try to make the region method work. If it does not, I will try your water_block() action method. Thank you.

Last edited by Ruben; 07/03/15 16:42.
Re: Water block not beeping [Re: Ruben] #452998
07/03/15 16:47
07/03/15 16:47
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
okay

Last edited by Wjbender; 07/03/15 17:01.

Compulsive compiler
Page 3 of 3 1 2 3

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