Gamestudio Links
Zorro Links
Newest Posts
M1 Oversampling
by 11honza11. 04/26/24 08:32
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Quad, EternallyCurious, 1 invisible), 852 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Need help with this code snippet #440896
05/05/14 15:34
05/05/14 15:34
Joined: Mar 2013
Posts: 18
USA - East Coast
D
DarkProgrammer Offline OP
Newbie
DarkProgrammer  Offline OP
Newbie
D

Joined: Mar 2013
Posts: 18
USA - East Coast
I need some help with this code. Just started playing around Lite-C. after running it the display is blank. I expected a rotating sphere to appear. I thought the line ENTITY* sphere = ent_create("sphere.mdl",vector(0,0,0),NULL); would create a sphere primitive shape that would get rotated. Any advice would be helpful, so, thanks in advance.

Code:
#include <acknex.h>
#include <atypes.h>
#include <default.c>

function  main()
{
   level_load(""); // open an empty level. you can use NULL instead of ""
   ENTITY* sphere = ent_create("sphere.mdl",vector(0,0,0),NULL); // create sphere model at position (0,0,0)
   while(1) 
   {
      sphere->pan += 1; // rotate the sphere with 1 degree per frame
      wait(1);  // wait one frame
   }
}


Re: Need help with this code snippet [Re: DarkProgrammer] #440897
05/05/14 15:41
05/05/14 15:41
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
works everthing perfect (and as excpected ;))
You don't see the sphere because you are IN the sphere. Create the sphere at
vector(100, 0, 0)
and try again


Visit my site: www.masterq32.de
Re: Need help with this code snippet [Re: MasterQ32] #440898
05/05/14 15:45
05/05/14 15:45
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
There's one small other thing to note and that is that you may see a different sphere in the engine than you have in your work folder (I'm not completely sure, though). Should it happen then the reason is that CUBE_MDL (probably "cube.mdl") and SPHERE_MDL are pre-defined objects and will/ could override your objects called cube and sphere. (The obvious solution is to change your model names.)


"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: Need help with this code snippet [Re: Superku] #440899
05/05/14 16:24
05/05/14 16:24
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
the internal models are _cube.mdl and _sphere.mdl so SHOULD not matter


Visit my site: www.masterq32.de
Re: Need help with this code snippet [Re: MasterQ32] #440900
05/05/14 16:31
05/05/14 16:31
Joined: Mar 2013
Posts: 18
USA - East Coast
D
DarkProgrammer Offline OP
Newbie
DarkProgrammer  Offline OP
Newbie
D

Joined: Mar 2013
Posts: 18
USA - East Coast
Thanks guys, the help is awesome.

Re: Need help with this code snippet [Re: DarkProgrammer] #440901
05/05/14 16:48
05/05/14 16:48
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
You are right, the defines/ file names have changed (German thread: http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=399489#Post399489).


"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

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