Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
1 registered members (AndrewAMD), 599 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
enable_block issue #237938
11/23/08 18:38
11/23/08 18:38
Joined: Oct 2008
Posts: 218
Nashua NH
heinekenbottle Offline OP
Member
heinekenbottle  Offline OP
Member

Joined: Oct 2008
Posts: 218
Nashua NH
I've been staring at this code and wondering why it doesn't work for too long. It is a bullet and when it hits an object, it should remove itself. But the collision event isn't been triggered, even though it is the same emask as my missile function, which does work.

Code:
function bEvent()
{
	if(event_type == EVENT_BLOCK)
	{
		beep();
		my.event = NULL;
		my.health -= 1000;
	}
}

action bullet()
{
	my.health = 1;
	set(my,FLAG2);
	my.emask |= (ENABLE_BLOCK | ENABLE_ENTITY);
	my.event = bEvent;
	my.pan = turret.pan;
	my.tilt = 0;
	my.roll = 0;
	my.z = turret.z;
	while((vec_dist(my.x,player.x) < 2000) && (my.health > 0))
	{
		c_move(my,vector(125 * time_step,0,0),nullvector,IGNORE_FLAG2 | IGNORE_PASSABLE | IGNORE_SPRITES | ACTIVATE_SHOOT);
		wait(1);
	}
	ent_remove(me);
}


The issue is, when it hits a block, it does not beep. (and no, my sound isn't muted.)


I was once Anonymous_Alcoholic.

Code Breakpoint;
Re: enable_block issue [Re: heinekenbottle] #238055
11/24/08 15:55
11/24/08 15:55
Joined: Oct 2008
Posts: 218
Nashua NH
heinekenbottle Offline OP
Member
heinekenbottle  Offline OP
Member

Joined: Oct 2008
Posts: 218
Nashua NH
hmm, I guess I didn't read the section on c_move very well. So nevermind >.>

Last edited by heinekenbottle; 11/24/08 17:50.

I was once Anonymous_Alcoholic.

Code Breakpoint;

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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