Jump to content

Home

[K1] Yet More Scripting Help!


ForeverNight

Recommended Posts

I've been working on an edited module, using the most overused module: the Lower Sewers of Taris. And, in the process, I've ran into another snag, this one with, you guessed it, scripts!

 

void
oDoor=mff
ActionOpenDoor(object oDoor)

 

This is the script I've been trying to work with, however, I keep on getting an error saying that I can't use a string constant.

 

So, I was wondering if anybody here who actually understands scripting could help me with a script that opens up a door that can fire from a dialog?

 

Thanks in advance!

Link to comment
Share on other sites

void

oDoor=mff

ActionOpenDoor(object oDoor)

 

This is the script I've been trying to work with, however, I keep on getting an error saying that I can't use a string constant.

 

If the tag of the door in question is mff, then something like this should work:

void main() {
   object oDoor = GetObjectByTag("mff");
   SetLocked(oDoor, FALSE);
   AssignCommand(oDoor, ActionOpenDoor(oDoor));
}

 

It retrieves a reference to the object with the tag mff (your door) in the area where the script is run. It then unlocks the door (if locked), and makes the door open itself.

Link to comment
Share on other sites

If the tag of the door in question is "mff", then something like this should work:

void main() {
   object oDoor = GetObjectByTag("mff");
   SetLocked(oDoor, FALSE);
   AssignCommand(oDoor, ActionOpenDoor(oDoor));
}

 

It retrieves a reference to the object with the tag mff (your door) in the area where the script is run. It then unlocks the door (if locked), and makes the door open itself.

 

Wow, that was fast you guys. I was about to do the same thing but as soon as I posted I saw I had been beaten twice :D

 

_EW_

 

And ForeverNight? You're right, it should be object oDoor.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...