Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Akow, TipmyPip, tomaslolo), 788 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
draw_obj & Entities #415389
01/18/13 00:06
01/18/13 00:06
Joined: Jul 2002
Posts: 3,208
Germany
Error014 Offline OP
Expert
Error014  Offline OP
Expert

Joined: Jul 2002
Posts: 3,208
Germany
Originally discussed in this thread

The manual states that draw_obj is able to render view-entities. However, I'm unable to get that to work!

Here's the example code from the above thread. You'll need to provide your own "dummy.bmp":

Code:
PANEL* atestpanel = {
	flags=LIGHT;
	size_x = 50;
	size_y = 50;
	red = 200;
	green = 100;
	blue = 20;
}

ENTITY* atestent = {
	type="dummy.bmp";
	pan = 180;
	x = 200;
}

function main() {
	video_set(800,600,0,2);
	set(atestpanel,SHOW);
	atestent.flags2|=SHOW;
	while(!key_space) { 
		draw_text("Showing Originals",1,570,vector(255,255,255));
		wait(1);
	}
	while(key_space) wait(1);
	reset(atestpanel,SHOW);
	atestent.flags2&=~SHOW;
	while(1) {

		if(key_space) {
			atestpanel.pos_x = 30; //So we should have two panels shown
			draw_obj(atestpanel);
			atestpanel.pos_x = 100;
			draw_obj(atestpanel);

			atestent.z = 50;	//So we should have two entities shown
			draw_obj(atestent);
			atestent.z = 0;
			draw_obj(atestent);
		}
		
		draw_text("Using draw_obj when you press [SPACE].",1,570,vector(255,255,255));
		wait(1);
	}	
}



I'll quote myself from the other thread:

Quote:


This little test project displays a testpanel (orange) and a testentity ("dummy.bmp"). Sweet. This should convince you that the settings of the entity are not at fault.
Now, if you hit space, we get to the interesting part.

Here, draw_obj is used (as long as the spacebar is pressed) to draw two panels and two entities, in theory. The manual explicitly states:
Quote:

The SHOW flag of the object needs not be set.




So I reset the SHOW-flag.
As you can see, two panels are correctly rendered. Neat!
However, as you can also see, the entity is not shown.
For the curious, setting the entities' SHOW-flag won't help with draw_obj - it still won't be rendered (though you will see the entity at the last set position, obviously, but that's not due to draw_obj).


It seems then that draw_obj does not work for view entities, contrary to what the manual states. This, however, seems like a really useful function - it'd be great if we could use it like this!

If I misunderstood something or this is a fault in my code, my apologies.

Thanks in advance!


Perhaps this post will get me points for originality at least.

Check out Dungeon Deities! It's amazing and will make you happy, successful and almost certainly more attractive! It might be true!
Re: draw_obj & Entities [Re: Error014] #415618
01/21/13 10:47
01/21/13 10:47
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Thanks - we'll look into this. draw_obj should work, or otherwise should be made to work with view entities.

Re: draw_obj & Entities [Re: jcl] #420884
04/05/13 14:53
04/05/13 14:53
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Hm has this been fixed? The "bugs" page says the following:

Quote:
draw_obj could not draw view entities (all A7 and A8 versions; fixed in 8.41.4).

However, using 8.42.0 I still don't see any view entity (which is an MDL) being drawn.


"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: draw_obj & Entities [Re: Superku] #420940
04/07/13 09:01
04/07/13 09:01
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
OK as I've just realized that the bug report is from 2013 and 8.42.0 is from 2012, I see that the bugs page has been updated as well. wink

Quote:
draw_obj could not draw view entities (all A7 and A8 versions; fixed in 8.43).


"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: draw_obj & Entities [Re: Superku] #421002
04/08/13 13:37
04/08/13 13:37
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
The bug was fixed, but for the next, not for the previous update. The beta version number in the bug list was wrong.


Moderated by  jcl, Nems, Spirit, 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