Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (RealSerious3D, rvl), 1,187 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
squik, AemStones, LucasJoshua, Baklazhan, Hanky27
19060 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Mirror effect problem #425154
06/28/13 02:02
06/28/13 02:02
Joined: Jan 2013
Posts: 106
Only in your imagination!
The_KING Offline OP
Member
The_KING  Offline OP
Member

Joined: Jan 2013
Posts: 106
Only in your imagination!
I wanted to make a mirror effect and that's what I did:

1) I made a fully white image using a paint programme ,then saved it as .pcx
2) I put the sprite in the level using WED ,then attached it to an action
3) In the code, before the sprite action, I defined a view with with pos_x ,pos_y = 0 and size_x ,size_y equal the same size of the sprite that is smaller than that of the screen resolution and with SHOW and CULL_CW flag set
4) In the action attached to the sprite, I set its pan angle to 360 to be oriented, then set x, y, z, pan, tilt and roll of the view equal to those of the sprite (my). After that, I added that line


mirror_view.bmap = bmap_for_entity(my,0);


The problem is that the view is rendered over the screen instead of the sprite texture bitmap

Thank you for reading and any help will be appreciated

Last edited by The_KING; 06/28/13 02:05.
Re: Mirror effect problem [Re: The_KING] #425155
06/28/13 02:26
06/28/13 02:26

M
Malice
Unregistered
Malice
Unregistered
M



Have you compared your work to the unanswered question in AUM 94? bmap_for_entity() might be returning NULL;

Last edited by Malice; 06/28/13 02:28.
Re: Mirror effect problem [Re: The_KING] #425176
06/28/13 13:29
06/28/13 13:29
Joined: Jan 2013
Posts: 106
Only in your imagination!
The_KING Offline OP
Member
The_KING  Offline OP
Member

Joined: Jan 2013
Posts: 106
Only in your imagination!
I don't want to disappoint you ,but the problem still exists. The view is rendered over the screen instead of being rendered over the sprite

Here's my code:

Code:
VIEW* mirror_view;
ENTITY* mirror_sprite;

function startup_mirror()
{
	mirror_view = view_create(10);
	wait(2);
	mirror_view.size_x = 192;
	mirror_view.size_y = 230;
	set(mirror_view,SHOW);
	mirror_view.bmap = bmap_for_entity(my,0);
	mirror_view.x = my.x;
	mirror_view.y = my.y;
	mirror_view.z = my.z;
	mirror_view.pan = my.pan;
	mirror_view.tilt = my.tilt;
	mirror_view.roll = my.roll;
}
	

action mirror_act()
{
	mirror_sprite = my;
	set(my,PASSABLE | DECAL);
   startup_mirror();
}



Peace!

Re: Mirror effect problem [EDITED] [Re: The_KING] #425195
06/28/13 17:47
06/28/13 17:47

M
Malice
Unregistered
Malice
Unregistered
M



Works just like it should... Um your code doesn't but the AUM 94 code does... Look up _startup in functions.

Code:
VIEW* mirror_view;
ENTITY* mirror_sprite;

function mirror_startup()
{
	while(!mirror_sprite)
	wait(1);
	
	
	mirror_view = view_create(10);
	wait(2);
	set(mirror_view,SHOW);
	mirror_view.size_x = 192;
	mirror_view.size_y = 230;
	mirror_view.bmap = bmap_for_entity(mirror_sprite,0);
	mirror_view.x =mirror_sprite.x;
	mirror_view.y = mirror_sprite.y;
	mirror_view.z = mirror_sprite.z;
	mirror_view.pan = mirror_sprite.pan;
	mirror_view.tilt = mirror_sprite.tilt;
	mirror_view.roll = mirror_sprite.roll;
}
	

action mirror_act()
{
	mirror_sprite = my;
	set(my,PASSABLE | DECAL);
   
}



It is clear by your problem and the AUM code that passing the my-pointer is getting you a NULL return by bmap_for_entity. It is also possible that the my-pointer is being set to the newly created view, but I'm not going to test to find out as the code above is working.

Last edited by Malice; 06/28/13 18:02.
Re: Mirror effect problem [Re: The_KING] #425202
06/28/13 21:47
06/28/13 21:47
Joined: Jan 2013
Posts: 106
Only in your imagination!
The_KING Offline OP
Member
The_KING  Offline OP
Member

Joined: Jan 2013
Posts: 106
Only in your imagination!
Again, the same problem happens. The view is rendered on the screen even after I replaced the "my" pointer with "mirror_sprite" frown

Re: Mirror effect problem [Re: The_KING] #425207
06/29/13 00:54
06/29/13 00:54

M
Malice
Unregistered
Malice
Unregistered
M



If you used the exact code from above and had a problem. Then check the file format of the sprite. Possibly try changing it to a windows bitmap .bmp in 24-bit mode.. It is not possible that this code runs on my system and not yours, if there was an error in the code. The code is fine, so your error could be machine or file format. Also make sure you have the latest version of the engine but this is most likely not the problem.

Last edited by Malice; 06/29/13 00:58.
Re: Mirror effect problem [Re: ] #425221
06/29/13 11:32
06/29/13 11:32
Joined: Jan 2013
Posts: 106
Only in your imagination!
The_KING Offline OP
Member
The_KING  Offline OP
Member

Joined: Jan 2013
Posts: 106
Only in your imagination!
I changed the file into .bmp with type 24-bit ,but the view is still rendered over the screen

BTW, I am using 3DGS v 8.40.3 THE FREE VERSION. Could this be the problem?

Re: Mirror effect problem [Re: The_KING] #425231
06/29/13 17:26
06/29/13 17:26

M
Malice
Unregistered
Malice
Unregistered
M



Sorry but the code I post above is working perfectly. And it is not a file format issue. I can tell to do this....

Code:
/// the mirror code ends here
while(1)
{
   DEBUG_VAR(mirror_view.bmap,10);
   DEBUG_VAR(bmap_for_entity(mirror_sprite),20);
   wait(1);
}

If the first debug is 0 or not matching the second debug or both are 0. Then bmap_for_entity() is failing. This can happen if you leave out -
Code:
while(!mirror_sprite){wait(1);}

-

I don't know the free versions limits, so can't give you any more help with this.

Sorry
Mal

Last edited by Malice; 06/29/13 17:26.
Re: Mirror effect problem [Re: ] #425235
06/29/13 18:05
06/29/13 18:05
Joined: Jan 2013
Posts: 106
Only in your imagination!
The_KING Offline OP
Member
The_KING  Offline OP
Member

Joined: Jan 2013
Posts: 106
Only in your imagination!
None of them return zero...

And obviously, they return the same value ,though the view is rendered over the screen

Sorry for wasting your time ,but I really need this mirror for my humbled game

Re: Mirror effect problem [Re: The_KING] #425236
06/29/13 19:06
06/29/13 19:06

M
Malice
Unregistered
Malice
Unregistered
M



You not wasting my time. I simple don't know what more to tell you. It could be your graphics card or it could be the engine version. If no one else can answer in 24 hours you might try asking in the "Ask the developers" section, but before you do see if you can find a list of the feature for the Free version to rule that out. Also 'if you can' download the trail version of the full engine and test the code. If the problem still exist with the full engine then you can rule-out engine version as the source. The code is fine George doesn't publish broken code and I wouldn't lie about my test results. So maybe it's a bug or graphics card problem.

I wish you luck and I sorry I didn't have a solution for your problem.

Mal

Page 1 of 2 1 2

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