3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1]

Author Topic: Tutarial On Script Object Reference  (Read 970 times)

« on: November 26, 2009, 02:15:43 PM »
As I promised here http://www.3drad.com/forum/index.php?topic=3154.0 when i start learning scripting I'll do some small tutorials on Script Object Reference Functions examples.  I'll try to get trough all the Script Object Reference Functions examples post by post.  Some of these scripts are already out there but I'll go trough them anyways not to skip out on any.  And please give loop a thanks for making me understand easier on how to script I hope loop and others continue helping me understand how to script.
           
                   Please Do Not Reply To This Post Except If U Would Like To Join Making Examples
                                            on Script Object Reference Functions

void iObjectStart(OBJ_X)
Start the specified object. Note that the target object must provide some 'startable' action.
Please see target object's help file for details on the action it performs when started.
OBJ_X = object handle.
And
void iObjectStop(OBJ_X)
Stop the specified object. Note that the target object must support some 'stoppable' action.
Please see target object's help file for details on the action it performs.
OBJ_X = object handle.

Example: To see this script in action  u need to load G-Force, 2 EventOnInputs, Terrain, RigidBody(Sphere), Character,  and Script.   Connect  G-Force and 2 EventOnInput to Script


void Main()
{
  if (IN_22==1)  // starts EventOnInput to stop G-force
{
  iObjectStop(OBJ_66);  // stops G-force
}
  if (IN_44==1)  // starts EventOnInput to start G-force
{
  iObjectStart(OBJ_66);  // starts G-force
}
}

OK, IN_ is your EventOnInput(TIP: Study EventOnInput's Options) and 22 and 44 are your EventOnInput's Numbers(TIP: study scripts window).
iObjectSpot is your first commend on what is script to do.
iObjectStart is your second commend on what is script to do.
OBJ_ is your G-Force and 66 is your G-Force's number(TIP: study scripts window).

Please Do Not Reply To This Post Except If U Would Like To Join Making Examples
on Script Object Reference Functions and If You Decide To Join Please Don't Do Random Examples on Script Object Reference Functions We Don't Want To Skip On Any Of Them

I'll do more as soon as I learn more Thank You.
« Last Edit: November 26, 2009, 10:00:35 PM by Siwler »
Hmmm...
Give me a moment can't you see, I'm thinking.
Hmmm...
« Reply #1 on: November 26, 2009, 05:42:03 PM »
void Main()
{
   if (IN_22==1)  // starts EventOnInput to stop SkinMesh animation
{
   iObjectStop(OUT_2);  // your Animation Set (SkinMesh)
}
}

you got it wrong.  ::) check this out:

void iObjectStart(OBJ_X)
Start the specified object. Note that the target object must provide some 'startable' action.
Please see target object's help file for details on the action it performs when started.
OBJ_X = object handle.

those script functions, like iObjectStart, like the reference says, work with OBJ_X not OUT_X.
OBJ_X and OUT_X are totally different things.

OBJ_X makes reference at the object, while OUT_X works to change certain things of that object.
you dont "work on" OUT_Xs, you assign values to OUT_Xs.
OBJ_Xs as the reference says are "object handles", like the script says "hey you, object!! I gonna call you OBJ_X and you gonna know Im talking to you." and the object says "You talkin' to me? You talkin' to me? You talkin' to me? Then who the hell else are you talking... you talking to me? Well I'm the only one here. Who the f*** do you think you're talking to? Oh yeah? OK."  :P
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!
Pages: [1]