dim3 Forum

Full Version: making objects
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

KingAlfonso

hey uh i was trying to put a object i made into a map and i made a script for it.
but when i enter the game it says syntax error.
what am i doing wrong?

heres the script

Code:
// ***********************************************************
//
// OBJECT: ventilationthingy
//
// ***********************************************************

{
    obj.model.on=true;
    obj.model.name="ventilationthingy";
    obj.model.shadow.on=false;
    obj.setting.suspend=false;
    
    obj.size.x=850;
    obj.size.z=850;
    obj.size.y=1900;

            obj.model.animation.start("fanmovement") ;
}

/ /
/ /  events
/ /

function event(obj,mainEvent,subEvent,id,tick)
{
    switch (mainEvent) {
    
        case DIM3_EVENT_CONSTRUCT:
            ventilationthingy(obj);
            return;
    
        case DIM3_EVENT_SPAWN:
            obj.model.animation.start("fanmovement");
            return;
    
    }
}
You forgot up top:

Code:
function ventalationthingy(obj) \\You missed this. :)
{
code
}
Dude, seriously just look at the error next time it says the line number and what's wrong.
Code:
/ /
/ / events
/ /

it should be
Code:
//
// events
//

also,
Code:
{
obj.model.on=true;
obj.model.name="ventilationthingy";
obj.model.shadow.on=false;
obj.setting.suspend=false;

obj.size.x=850;
obj.size.z=850;
obj.size.y=1900;

obj.model.animation.start("fanmovement") ;
}
should not start the anmation, you have to wait untill i spwans to do that, or it will say that there is not fanmovement animation.
also, if you could put that there, you wouldnt put
Code:
obj.model.animation.start("fanmovement") ;
you'd put
Code:
obj.model.animation.start("fanmovement");

and, just to show you where teh1ghool meant to put it, this
Code:
{
obj.model.on=true;
obj.model.name="ventilationthingy";
obj.model.shadow.on=false;
obj.setting.suspend=false;

obj.size.x=850;
obj.size.z=850;
obj.size.y=1900;

obj.model.animation.start("fanmovement") ;
}
should be
Code:
function ventalationthingy(obj)
{
obj.model.on=true;
obj.model.name="ventilationthingy";
obj.model.shadow.on=false;
obj.setting.suspend=false;

obj.size.x=850;
obj.size.z=850;
obj.size.y=1900;

obj.model.animation.start("fanmovement") ;
}

Wink.
ccccc, it was answered ages ago -- both on AIM and by me.

disruptiv, calm down, not everyone is fluent at scripting/programming.
1. im not dimwit
2. im not upset
3. it's not a matter of programming skill, if he had looked at what the engine said it would have told him the exact line and error and saved us all some time
he's talking about a post on another thread

I'm actually quite bad at programming, but some things are obvious. In fact, I didn't know what to do in the sitiuation mentioned on this thread.
but calm down disruptive, it hardley took any time to answer, and there were so many problems, that every time he fixed one, it would throw the next error and everyone would get frusterated.
teh1ghool Wrote:ccccc, it was answered ages ago -- both on AIM and by me.

dimwit, calm down, not everyone is fluent at scripting/programming.
how am i suposed to know that you answered it on aim?
anyway, it couldn't of been that long ago, i clicked the veiw unread posts button so i kinda geussed that it was new :P.

KingAlfonso

well teh1ghool helped me and after i added the stuff at the top and deleted the stuff subevent and tick stuff it worked fine.
Oopop,s sorry disruptiv, I was thinking dimwit because he always overdid it a bit, so I didn't check to make sure. My bad. Post edited.
Reference URL's