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
1 registered members (AndrewAMD), 827 guests, and 6 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 1 of 2 1 2
Bullet doesen´t remove #281146
07/25/09 17:26
07/25/09 17:26
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline OP
Expert
Rei_Ayanami  Offline OP
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Hello!
I am programming my weapon at this time smile. My problem is that my bullet(plasma bullet) doesen´t remove. Here is my Code:
Code:
function blaster_shoot()
{
	wait(3);
	my.pan = player.pan;
	set(my, INVISIBLE | PASSABLE);
	reset(my, VISIBLE);
	my.emask |= (ENABLE_IMPACT | ENABLE_ENTITY | ENABLE_BLOCK); 
	my.event = remove_plasma_ball;
	plasma_effect();
	plasma_effect();
	plasma_effect();
	plasma_effect();
	plasma_effect();
	plasma_effect();
	plasma_effect();
	plasma_effect();
	plasma_effect();
	plasma_effect();
	plasma_effect();
	plasma_effect();
	plasma_effect();
	plasma_effect();
	plasma_effect();
	plasma_effect();
	plasma_effect();
	plasma_effect();
	plasma_effect();
	plasma_effect();
	c_setminmax(me);
	while(my != NULL)
	{
		you = player;
		c_move(me, vector(10*time_step,0,0), nullvector, 0);
		wait(1);
	}
}


I know that I call the function plasma_effect 8 times, but I need this for the plasma effect wink.

I don´t know why?

Thanks for looking!

Re: Bullet doesen´t remove [Re: Rei_Ayanami] #281148
07/25/09 17:31
07/25/09 17:31
Joined: Sep 2006
Posts: 99
BS, Germany
Storm_Mortis Offline
Junior Member
Storm_Mortis  Offline
Junior Member

Joined: Sep 2006
Posts: 99
BS, Germany
try this it schould remove now!
Click to reveal..

function remove_plasma_ball()
{
my.skil1 = 1;
return;
}

function blaster_shoot()
{
var counter = 0;
wait(3);
my.pan = player.pan;
set(my, INVISIBLE | PASSABLE);
reset(my, VISIBLE);
my.emask |= (ENABLE_IMPACT | ENABLE_ENTITY | ENABLE_BLOCK);
my.event = remove_plasma_ball;
while(counter < 10)
{
plasma_effect();
counter += 1;
}
c_setminmax(me);
while(my.skill1 == 0)
{
you = player;
c_move(me, vector(10*time_step,0,0), nullvector, 0);
wait(1);
}
ptr_remove(me);
}


basicle i would say, the error is in your event function, but you dount show it, so , i dont really know^^

Last edited by Storm_Mortis; 07/25/09 17:33.

it found a voice ... now it needs a body
Re: Bullet doesen´t remove [Re: Storm_Mortis] #281149
07/25/09 17:34
07/25/09 17:34
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline OP
Expert
Rei_Ayanami  Offline OP
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Here is my Remove code:

Code:
function remove_plasma_ball()
{
	if(you == player) return;
	printf("Yeha", NULL);
	if(event_type == EVENT_BLOCK)
	{
		effect(hit_block_effect, 0, target, normal);
	}
	ptr_remove(me);
}



Re: Bullet doesen´t remove [Re: Rei_Ayanami] #281151
07/25/09 17:42
07/25/09 17:42
Joined: Sep 2006
Posts: 99
BS, Germany
Storm_Mortis Offline
Junior Member
Storm_Mortis  Offline
Junior Member

Joined: Sep 2006
Posts: 99
BS, Germany
well,
your projectile was passable, so it cant hit anythig!

try this code:
Click to reveal..

function remove_plasma_ball()
{
if(you == player) {return; printf("Yeha", NULL);}

if(event_type == EVENT_BLOCK)
{
effect(hit_block_effect, 0, target, normal);
}
my.skill1 = 1;
}

function blaster_shoot()
{
var counter = 0;
wait(3);
my.pan = player.pan;
set(my, INVISIBLE);
reset(my, VISIBLE);
my.emask |= (ENABLE_IMPACT | ENABLE_ENTITY | ENABLE_BLOCK);
my.event = remove_plasma_ball;
while(counter < 10)
{
plasma_effect();
counter += 1;
}
c_setminmax(me);
while(my.skill1 == 0)
{
you = player;
c_move(me, vector(10*time_step,0,0), nullvector, IGNORE_ME|IGNORE_YOU|IGNORE_PASSABLE|IGNORE_PASSENTS);
wait(1);
}
ptr_remove(me);
}



it found a voice ... now it needs a body
Re: Bullet doesen´t remove [Re: Storm_Mortis] #281154
07/25/09 17:55
07/25/09 17:55
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline OP
Expert
Rei_Ayanami  Offline OP
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Well,I don´t like to take code from others, because of that and because you gave me the hint that my projectile is passable - so I removed that. But now it shows a Error in my blaster_shoot function...

Re: Bullet doesen´t remove [Re: Rei_Ayanami] #281158
07/25/09 18:07
07/25/09 18:07
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline OP
Expert
Rei_Ayanami  Offline OP
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Okay, managed that with a skill1, but my effect doesen´t work - I mean it isn´t shown:
Code:
function remove_plasma_ball()
{
	if(you == player) return;
	effect(hit_block_effect, 100, target, normal);
	my.skill1 = 1;
	ptr_remove(me);
}



Re: Bullet doesen´t remove [Re: Rei_Ayanami] #281162
07/25/09 18:14
07/25/09 18:14
Joined: Sep 2006
Posts: 99
BS, Germany
Storm_Mortis Offline
Junior Member
Storm_Mortis  Offline
Junior Member

Joined: Sep 2006
Posts: 99
BS, Germany
well maybe because you assume that an anime is getting hit.
if you hit a wall the folloing line will crash.
if(you == player)...

you need to check bevore if you hit an entity or a wall!
you need something like this:

if(event_type == event_entity && you == player){return;}
if(event_type == event_entity && you != player){you.health -= xx;return;}
ifevent_type == event_block && you == player){effect(hit_block_effect, 0, target, normal);return;}

i wrote small even things that schould be tall , so you dont need to take code from others, but i hope you get an idea reading thes^^


it found a voice ... now it needs a body
Re: Bullet doesen´t remove [Re: Storm_Mortis] #281168
07/25/09 18:31
07/25/09 18:31
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline OP
Expert
Rei_Ayanami  Offline OP
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Thanks, but hmm, doesne´t work, not even when i´m take the player == you from event_block - this will never happen ;):
Here is the Code - even with the particle effect:
Code:
function hit_block_effect(PARTICLE *p)
{
	if(random(10) < 5) p.bmap = plasma_blue;
	else p.bmap = plasma_red;
	p.flags |= (BRIGHT | MOVE | TRANSLUCENT);
	p.vel_z = random(2)-1;
	p.vel_x = random(2)-1;
	p.vel_y = random(2)-1;
	p.lifespan = 5;
	p.size = 3;
	p.alpha = 50;
	p.event = plasma_fade;
}
function remove_plasma_ball()
{
	if(event_type == EVENT_ENTITY && you == player) { return; }
	if(event_type == EVENT_BLOCK) { effect(hit_block_effect, 1, target, normal); }
	my.skill1 = 1;
	ptr_remove(me);
}



Last edited by Rei_Ayanami; 07/25/09 18:31.
Re: Bullet doesen´t remove [Re: Rei_Ayanami] #281171
07/25/09 18:37
07/25/09 18:37
Joined: Sep 2006
Posts: 99
BS, Germany
Storm_Mortis Offline
Junior Member
Storm_Mortis  Offline
Junior Member

Joined: Sep 2006
Posts: 99
BS, Germany
i will look at this lather more intensive, but at the moment ive no time for this...

but your problem is, that you dont see any effect now, right?

look at your code - you are creating one particle of a size of 3 and a lifespan of 5 ... ich would say, first for testing increase the size and number.
tham check if the are to slow in movement (1 to -1 is slow) and play with the lifespan/fade off.

this could solve your problem^^


it found a voice ... now it needs a body
Re: Bullet doesen´t remove [Re: Storm_Mortis] #281172
07/25/09 18:46
07/25/09 18:46
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline OP
Expert
Rei_Ayanami  Offline OP
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
thanks! I´ll look later !

Aber ich seh ja du sprichst deutsch, das is einfacher, naja ich guck später...

Page 1 of 2 1 2

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