Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
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
1 registered members (Ayumi), 900 guests, and 4 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
Page 1 of 2 1 2
***COOL CAMERA PROJECT HERE!*** Help me build one! #53610
08/29/05 22:53
08/29/05 22:53
Joined: Aug 2005
Posts: 107
NMS Offline OP
Member
NMS  Offline OP
Member

Joined: Aug 2005
Posts: 107
Hi, i'm making a camera that dont run away from blocks, just decrease their alpha to 50%.

This is the code i'm using, but i dont think the trace is well doned.
any help is apreciated, then i may share the perfect code here for users to use it!

code:-------------

vec_set(temporario,camera.x); //copy camera xyz to temporario
distanciaaoplayer = vec_dist(camera.x,my.x); //see the distance between the camera and the player and stores it in distanciaaoplayer
trace_mode = ignore_passable + ignore_me; //traces a ray from the camera to the player and see if he hits on non passable block
while (trace(temporario,distanciaaoplayer) !=0) {you.alpha=50;} // if the ray hits a block, that block must turn transparent

------------------
-------------------------------

Last edited by NMS; 08/30/05 09:35.

http://www.coniserver.net/ubbthreads/showflat.php?Cat=0&Number=560847&an=0&page=0#560847 Cmon every one! Help me building this camera script! The first of its kind in 3dgs! Thnkx to everyone who helped me in my questions
Re: ***COOL CAMERA PROJECT HERE!*** Help me build one! [Re: NMS] #53611
08/30/05 10:10
08/30/05 10:10
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
if a trace hits a wall, it returns null, and you cant set a null object with flags...
only way i think to do this is by a dll, which makes blocks data readable from the .wmb file (for fun open up notepad and load your .wmp or .wmb file in there, you'll see each blocks data type) then set flags or something according to that.
i dont know any more about this though, i wish you good luck, and regards.

PS: you could render everything as "parts", and use it as map entity to make them transparent, that would work.


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: ***COOL CAMERA PROJECT HERE!*** Help me build [Re: Helghast] #53612
08/30/05 10:13
08/30/05 10:13
Joined: Aug 2005
Posts: 107
NMS Offline OP
Member
NMS  Offline OP
Member

Joined: Aug 2005
Posts: 107
thnkx for the hint
I'll try it. when i finishit i'll share it


http://www.coniserver.net/ubbthreads/showflat.php?Cat=0&Number=560847&an=0&page=0#560847 Cmon every one! Help me building this camera script! The first of its kind in 3dgs! Thnkx to everyone who helped me in my questions
Re: ***COOL CAMERA PROJECT HERE!*** Help me build [Re: NMS] #53613
08/30/05 10:20
08/30/05 10:20
Joined: Aug 2005
Posts: 107
NMS Offline OP
Member
NMS  Offline OP
Member

Joined: Aug 2005
Posts: 107
Know what i sawe there?

Look, this is a cube's defenition in wed:

{ // 1
vertices 8
faces 6
696 -440 128 696 440 128 -760 -440 128
-760 440 128 696 -440 72 696 440 72
-760 -440 72 -760 440 72
4 1 0 2 3 : #default ( 1 0 0 0 ) ( 0 -1 0 0 ) : 1001 0 50 ndef
4 0 1 5 4 : #default ( 0 1 0 0 ) ( 0 0 -1 0 ) : 1001 0 50 ndef
4 2 0 4 6 : #default ( 1 0 0 0 ) ( 0 0 -1 0 ) : 1001 0 50 ndef
4 3 2 6 7 : #default ( 0 1 0 0 ) ( 0 0 -1 0 ) : 1001 0 50 ndef
4 1 3 7 5 : #default ( 1 0 0 0 ) ( 0 0 -1 0 ) : 1001 0 50 ndef
4 4 5 7 6 : #default ( 1 0 0 0 ) ( 0 -1 0 0 ) : 1001 0 50 ndef
{
0000
ndef
1
}

What are those cool "ndef"? i tryed to trade the "ndef" by a script name, but nothing happened... (Cool, the player if a hollow cube...!) lol

I cant find any flags here, the other files are encripted.
This is the .$M file


http://www.coniserver.net/ubbthreads/showflat.php?Cat=0&Number=560847&an=0&page=0#560847 Cmon every one! Help me building this camera script! The first of its kind in 3dgs! Thnkx to everyone who helped me in my questions
Re: ***COOL CAMERA PROJECT HERE!*** Help me build [Re: NMS] #53614
08/30/05 10:36
08/30/05 10:36
Joined: Aug 2005
Posts: 107
NMS Offline OP
Member
NMS  Offline OP
Member

Joined: Aug 2005
Posts: 107
I made a change to the script:

vec_set(temporario,camera.x);
distanciaaoplayer = vec_dist(camera.x,my.x);
trace_mode = ignore_passable + ignore_me;
while (trace(temporario,distanciaaoplayer) !=0) {you.alpha=on;}


but it says now that "you.alpha=on;" has an empty pointer!
and the models dont get changed by alpha :S


http://www.coniserver.net/ubbthreads/showflat.php?Cat=0&Number=560847&an=0&page=0#560847 Cmon every one! Help me building this camera script! The first of its kind in 3dgs! Thnkx to everyone who helped me in my questions
Re: ***COOL CAMERA PROJECT HERE!*** Help me build [Re: NMS] #53615
08/30/05 10:37
08/30/05 10:37
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
yeah, that's the structural data i was talking about, maybe by dll you could access that

EDIT: that's what i said, the empty pointer is the null in the walls.. dont think it can be accessed by c-script, maybe anyone else knows.

good luck on it.

regards,

Last edited by dennis_fantasy; 08/30/05 10:39.

Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: ***COOL CAMERA PROJECT HERE!*** Help me build [Re: Helghast] #53616
08/30/05 16:23
08/30/05 16:23
Joined: Jun 2005
Posts: 128
M
memon Offline
Member
memon  Offline
Member
M

Joined: Jun 2005
Posts: 128
I think the only possible solution is to use map entity for each wall or divide each wall to several map entities and then you will be able to use "you" pointer to set the transparent flags and play with alpha .. which is bad idea to change your entire level design just to make that possible
I think the block once combild cant change their flags

how about to change your mind to make the camera come closser to the player insted of making walls transparent .. and the player turn to invesible when it stuck between the wall and the player (i think this already been done by other members) .. or to move the camera in front the player when there is no space .. or to move it above the player .. or combine the last two methods like what max payne camera do .. I know that is not what you want .. I previously want to do the same as what are you wishing to do .. but its obvious its not possible without map entities blocks

Regards

Re: ***COOL CAMERA PROJECT HERE!*** Help me build one! [Re: NMS] #53617
08/30/05 17:13
08/30/05 17:13
Joined: Oct 2003
Posts: 312
Lüneburg, Germany
Gnometech Offline
Senior Member
Gnometech  Offline
Senior Member

Joined: Oct 2003
Posts: 312
Lüneburg, Germany
Hi!

In my last project (Running Food, cf. Showcase II) I did just that for some entities. (Like the wooden palette lying in Level 1 or the cardboard box in Level 3).

That is the main problem: you can't make level blocks transparent. That would of course make the whole BSP-tree absurd. ;-) That's why you have to use Entities for this.

The code is really easy: normally you use a trace to the camera anyway to check if anything is in the way. If an entity like this is in the way, I set a special flag, which tells the entity to becoma transparent. The final touch is that the entity is not made transparent at once, but gradually (fast, but you can see it).

Good luck!

Gnometech


Download our playable Movement & Interaction Tutorial for 3DGS here:
http://www.puppenheim.org/MITutorial.zip
Re: ***COOL CAMERA PROJECT HERE!*** Help me build [Re: Gnometech] #53618
08/30/05 19:40
08/30/05 19:40
Joined: Aug 2005
Posts: 107
NMS Offline OP
Member
NMS  Offline OP
Member

Joined: Aug 2005
Posts: 107
but even if my level is made by entities, my script dont work too well


http://www.coniserver.net/ubbthreads/showflat.php?Cat=0&Number=560847&an=0&page=0#560847 Cmon every one! Help me building this camera script! The first of its kind in 3dgs! Thnkx to everyone who helped me in my questions
Re: ***COOL CAMERA PROJECT HERE!*** Help me build [Re: NMS] #53619
04/14/07 18:20
04/14/07 18:20
Joined: Apr 2007
Posts: 67
suriname0 Offline
Junior Member
suriname0  Offline
Junior Member

Joined: Apr 2007
Posts: 67
Couldn't you use c_Scan? I don't know much about it, but you could use it to detect the blocks from a distance. Then you could use the "you" parameter to change whatever you want, as long as they are entities or models.


If I am posting, it probably means I am asking a question. Or faking my knowledge by agreeing with somebody else.
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