getobjectgrafic. ARGH!

Started by He-Man, Sat 19/06/2004 15:15:12

Previous topic - Next topic

He-Man

This is my script:

function object1_a() {
Ã,  // script for object1: Ext.modes object
Ã,  Ã, if (UsedMode("open")){
if ((GetGlobalInt (1))==1){
DisplaySpeech (EGO,"I can't reach it!");}

if ((GetGlobalInt (1))==2){
Ã, 
Ã,  if (GetObjectGraphic (1)==140){
// if door is closed

SetObjectGraphic (1,141);
RestoreWalkableArea (3);}
Ã,  if (GetObjectGraphic (1)==141){
// if door is open

SetObjectGraphic (1,140);
RemoveWalkableArea(3);}
}Ã,  Ã, 
}
}

I want the the object's grafic to change between open and closed.
The player character just walks to the door and nothing more...

your pal
Niels

Goot

I'm not familiar with some of those scripting commands but I'm not too sure that   if (UsedMode("open")){ works. Have you been able to sucessfully use that command with mode open in other places? That's the only thing in the script that doesn't seem like I it will definately work. Also, when you're doing the global integers, you only need to do if(GetGlobalInt(int)==x){. You had some extra parenthesis in there somewhere. Also, make sure you have the right object number. The first object in the room is object 0, not 1.

Goot

Another point: I don't think you should be using function object 1a. You want to do it under any click on object, I assume you have made a special cursor for open.

Ashen

I guess UsedMode() is a custom function? But shouldn't it be:

if (UsedMode() == open) {

Maybe GetCursorMode() would work, if you've actually created a MODE_OPEN.
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk