Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (ozgur, EternallyCurious, howardR, 1 invisible), 623 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 18 of 31 1 2 16 17 18 19 20 30 31
Re: Unity 3 announced [Re: Pappenheimer] #315870
03/19/10 18:12
03/19/10 18:12
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Well, the often used alternative to gamestudios while loops with wait(1), which also Unity uses are event functions. in unity one is for example called Start. That is called in the moment the object is created. Then there is the update function, which is called each frame, directly before rendering And then there of course are some other events as well like mouseDown or what ever it is called, which is executed in the moment a mousebutton is pressed above the object and there of course are also other functions like that. It is actually very easy.
These function are always called in the same order of course. A bit more tricky in unity is in my opinion the way you can access other objects. But also that works fine if you once found out how to do it. What I like is that the code is in general very modular and quite clean, the disadvantage of the object oriented design are on the other hand the very long code lines which tend to be a bit messy. I for example have a script instance which has the pointer to another scripts instance which has the gameobject it handles as pointer, which has the transform member, which holds the position, which holds the x, y and z components. The result is something like this: scrobj1.scrobj2.gameObject.transform.position.x, but well this is an extreme case of course, just to demonstrate what I mean.

Re: Unity 3 announced [Re: Pappenheimer] #315872
03/19/10 18:30
03/19/10 18:30
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
It appears to use a similar approach to lite-C's EVENT_FRAME, if I'm not mistaken. Of course, lite-C's frame event could more easily get quite convoluted since the same event/function will be used with any other events that the entity detects (EVENT_IMPACT and so on).

Unity appears to separate these, and it looks quite nice.

Jibb

EDIT: Okay, thanks for the explanation, Slin. (I had the reply window open for too long).

Last edited by JulzMighty; 03/19/10 18:31.

Formerly known as JulzMighty.
I made KarBOOM!
Re: Unity 3 announced [Re: Pappenheimer] #315873
03/19/10 18:36
03/19/10 18:36
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
we are using while loops for repating same task in all frames(while(1) ... wait(1)) in Unity, there are functions that are automatically called every frame, so you are already writing the inside of the while.


3333333333
Re: Unity 3 announced [Re: Slin] #315874
03/19/10 18:39
03/19/10 18:39
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Ah, great, that explains the start() and update() in the examples from Captain Kiyaku's explanations.

Now, I'm getting shameless blush :
How does one entity create another? F.i. a dying entity leaves a health pack...

(Hope, you don't mind my questions, for I don't have the time to take a closer look at Unity now, but I'm veeery curious. laugh It is more a sort of entertainment, since there's not much happening at these forums at the moment and I enjoy your company... laugh So, please don't feel forced to answer!)

Re: Unity 3 announced [Re: Quad] #315875
03/19/10 18:41
03/19/10 18:41
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Quote:
we are using while loops for repating same task in all frames(while(1) ... wait(1)) in Unity, there are functions that are automatically called every frame, so you are already writing the inside of the while.
Well there's more to it than that. The special thing about wait(1) in A7 is that function execution continues from that spot the next frame, with all local variables preserved.

Assuming Unity lets you extend its entity objects by adding your own variables to the objects themselves (which I'm sure it does, but I just don't know), this wouldn't be an issue anyway, I guess.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: Unity 3 announced [Re: JibbSmart] #315876
03/19/10 18:44
03/19/10 18:44
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
there is a function smiliar to ent_create.

Instantiate(object/prefab, position, rotation);


edit: object/prefab can have several attached scripts to itself.

Last edited by Quadraxas; 03/19/10 18:45.

3333333333
Re: Unity 3 announced [Re: Pappenheimer] #315877
03/19/10 18:45
03/19/10 18:45
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
There is the function Instantiate(Load.Ressource("Prefabname"), Position, Rotation) which will create that prefab. A prefab is usually an object with script, collision hull and some other components, where in some way everything is a member of the script if it has one.

Re: Unity 3 announced [Re: Slin] #315886
03/19/10 19:13
03/19/10 19:13
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441

Re: Unity 3 announced [Re: ventilator] #315904
03/19/10 22:46
03/19/10 22:46
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Thanks for your answers so far! laugh
The explanations from the link look quite clear.
Can't wait to read through the manual and take the first steps of scripting when I have time.

Re: Unity 3 announced [Re: Pappenheimer] #315932
03/20/10 10:00
03/20/10 10:00
Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
Machinery_Frank Offline
Senior Expert
Machinery_Frank  Offline
Senior Expert

Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
I find this all very exciting. I plan to do some more testing soon to compare the power and indoor scene management of different game engines.

I currently finished a new sci-fi pack and started to work on a few models / indoors for the next pack. Here is a first test in the C4 engine:



more images here:
http://www.terathon.com/forums/viewtopic.php?f=30&p=81005#p81002

I am really interested to see how other technology performs, when I add lights, shadows and shaders in a similar way and how I can optimize culling (zones and portals).
Since I have a license of Torque3D, I will do a test there also. I own C4 and I probably will get Unity 3 soon to better support our Unity customers.
But for testing A7 I probably need some help.


Models, Textures and Games from Dexsoft
Page 18 of 31 1 2 16 17 18 19 20 30 31

Moderated by  aztec, Blink, HeelX 

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