Ok i've been through the NGC plugin and i must say there are 2 things to notice that are important , and i'll do a pdf about it .
- The first one , there is a code to copy paste in the source code called constants , this code allows users to write fonctions more easily.
"ellip2mesh" instead of the 1234 numbers that could be forgotten more easily.
- Second , for new users , don't make ellipsoids ... make spheres (that's silly but NGC3 seems bugged according to many old school users) , that is use a radius that is equal at all places , 303030 for instance.
HMMMM .... i think that is all ... i'm actually lazy to make a pdf but ... arrr
here is a code to show the way it work : it's very simple
` the normal settings + use the sync to make NGC work proper
` you can also use fast sync instead
sync on : sync rate 30
` Start the collision system + launch the dll
startcollisionPRO( your code here )
` start the collision debugger + use this to get responses and bugs prompts
startcollisiondebugPRO()
`set the exclusive to 0 + has to do with commands i personnaly use it
setcollisionexclusive( 0 )
` The constants + stuffs to get the more accurate meaning of what you do
#Constant NCULL_COUNTER_CLOCK 1
#Constant NCULL_CLOCK 2
#Constant NCULL_NONE 3
#Constant TYPE_NGC_ELLIP=1
#Constant TYPE_NGC_MESH=2
#Constant ELLIP_2_ELLIP=1
#Constant ELLIP_2_POLY=2
#Constant RESP_STICK=1
#Constant RESP_SLIDE=2
#Constant RESP_SLIDE_NO_SLOPES=3
#Constant RESP_SLIDE_NO_GRAV=4
#Constant RESP_SLIDE_NO_ACCEL=5
#Constant RESP_NONE=6
#Constant DYN_NO_RESP=1
#Constant DYN_RESP=2
#Constant DYN_RESP_NOTURN=3
` My own constants + used for this program to run , use you own in yours , declare all kinds of objects here like cubes ... oranges ... whatever you use
#constant type_player = 2
#constant type_wall = 1
rem set collision types + most important part , you "set" ngc here , telling it what to do , here is the user make a player collide a wall
SetCollisionsPRO(Type_Player, Type_Wall, ELLIP_2_POLY, RESP_SLIDE, DYN_NO_RESP,Auto_Priority )
rem ; this code goes with medias , if you have to load one , do this here
` load the ball run map
` load object "media/map/ball run map.x",1
` position object 1,0,0,0
` Make the player object
make object sphere 2,10
texture object 2,2
position object 2,0,60,20
collisiontypePRO( 1,type_wall )
collisiontypePRO( 2,type_player )
` Player variables
player_speed = 4
`loop the music
loop music 1
rem set radius for player , ***sphere .... since v3 bug***!!!!
SetObjRadiusPRO(2,80,80,80)
`set object gravity + makes the object gravit
SetObjGravityPRO( 2, 1 )
do
` The ball control input
move object 2,player_speed
if leftkey() = 1
move object left 2,player_speed
endif
if rightkey() = 1
move object right 2,player_speed
endif
` set the camera to follow the player object
set camera to follow object position x(2),object position y(2),object position z(2),0,10,10,10,0
` LAST COMMAND ... IT's LIKE A VSYNC FOR NGC .... DON'T FORGET !!!
runcollisionPRO()
sync
loop
this code came from the topic
http://forum.thegamecreators.com/?m=forum_view&t=47855&b=18and got corrected since it needed to , i think it could be used as a model to newcomers i tuned it to explain a bit more what do what it's a step by step first step code , i recommend you use it to understand the commands since it's minimalistic ....
I hope this helped , just listen to Lostinthoughts's advices you'd need them before next update
here !
A pixel is nothing , lots of can be all