Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
what's a dangerous instruction?? #308925
02/05/10 20:24
02/05/10 20:24
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
hi there,

i am getting a malfuntion 1511 : Dangerous instruction in event soundso

whats that??

this is the code its refering to
Code:
void stern_spray()
{
	set(me,PASSABLE|TRANSLUCENT|ZNEAR|BRIGHT);
//	if (random(10)>7) set(me,BRIGHT);
	my.alpha = random(50)+50;
	my.x += random(64)-32;
	my.y += random(64)-32;
	my.z += random(64)-32;
	vec_scale(my.scale_x,0.01 + random(10)/33);
	my.roll=random(360);
	var xspeed = random(23) - 11.5, yspeed = random(23) - 11.5, zspeed = random(23) - 11.5, rollspeed = random(14)-7;
	while(my.alpha>0)
	{
		my.alpha -= 5*time_step;
		my.roll += rollspeed;
		c_move(me,nullvector,vector(xspeed,yspeed,zspeed),IGNORE_PASSABLE|IGNORE_SPRITES);
		zspeed -= time_step;
		wait(1);
	}
	ent_remove(me);
}



Re: what's a dangerous instruction?? [Re: ello] #308942
02/05/10 22:41
02/05/10 22:41
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
[EDIT] [...] Is stern_spray an event function?

Manual:

Warning W1511 - dangerous instruction in event
Die angegebene Event-Funktion enthält eine verbotene Anweisung (siehe "Event-Fallen"). Anweisungen, die etwas im Level ändern oder selbst Events auslösen können, wie c_move, ptr_remove, ent_create, c_trace, c_scan, video_switch etc. dürfen nicht im ersten Zyklus eines Events ausgeführt werden. Fügen Sie vor dem Ausführen solcher Anweisungen in einer Event-Funktion ein wait(1) ein. Diese Meldung wird bei einem warn_level von 2 oder höher ausgegeben.

Last edited by Superku; 02/06/10 01:52.

"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: what's a dangerous instruction?? [Re: Superku] #308957
02/06/10 00:34
02/06/10 00:34
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
not directly.. its the function of an entity created within an event

Re: what's a dangerous instruction?? [Re: ello] #308961
02/06/10 02:57
02/06/10 02:57
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
And if you remove the wait it doesn't throw an error?


Click and join the 3dgs irc community!
Room: #3dgs
Re: what's a dangerous instruction?? [Re: Joozey] #308972
02/06/10 07:31
02/06/10 07:31
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Did you use a wait(1) instruction before creating the entity in the event function?

Re: what's a dangerous instruction?? [Re: Xarthor] #308979
02/06/10 10:17
02/06/10 10:17
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
You need a wait(1) before doing c_move. Put it before the while loop starts.

Otherwise the event creates an entity with a function which calls an engine function which can trigger an event right away which *COULD* in theory trigger the first event again and thus end up in an endless loop.


Moderated by  old_bill, Tobias 

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