disable region

Started by , Thu 27/05/2004 20:56:24

Previous topic - Next topic

Michael

hello. my question is probably quite simple, but i've searched the manual and tutorials and FAQs and well.. everywhere and i can't find an answerÃ,  ???

so what i really want to do is disable a region. i couldn't find it in the interactions editor, so i searched the forms a bit and i found this command DisableRegion(X); which i used... but it didn't work. i don't have any experience scripting though, so i wasn't too surprised. anyway i'll show you what i've got so far.

player walks onto region(1)
character - stop character walking
game - display message
character - move charcater
character - face location
game - run dialog
conditional - if the player has inventory item
run script ( DisableRegion(1); )

what i want is for the character to need an inventory item to leave the room.

Skio

I suppose the region's purpose is to stop the character from leaving the room without the item.

You can substitute it with a hotspot (ignore the "obsolete, use regions instead" advice) and then use the DisableHotspot(x) command.

As for the DisableRegion command, it should work. Perhaps you put it in the wrong part of the script or gave a wrong parameter. Check it again (or post the exact code).

Good Luck!
Î'νδρων Επιφανων Πασα Î"η ΤαφοÏ,

Ashen

I think your problem is that you're trying to use the region to disable itself, but I'm not totally sure. Assuming you'd rather use the interaction editor than scripting:

Player walks onto region:
Ã,  Conditional - If player has an inventory item (item)
Ã,  Ã,  - Stop running more commands
Ã,  character - stop character walking
Ã,  game - display message
Ã,  character - move charcater
Ã,  character - face location
Ã,  game - run dialog

Used in this order, the conditonal will stop all the other commands, if you have the item, but run them if you do, without having to fiddle with enabling / disabling the region.

If you don't mind scripting, this should do the same thing:

if (character[EGO].inv[1] = 0){
Ã,  // Don't have item, so run script.
Ã,  StopMoving(EGO);
Ã,  Display ("Not Yet.");
Ã,  MoveCharacter (EGO, x, y);
Ã,  FaceLocation (EGO, x, y);
Ã,  RunDialog (topic);
}

else {
// Have item, so do nothing.
}

Alternatively, if the item is picked up in the same room, just run the DisableRegion(1); command when you pick it up.

Hope this helps.
I know what you're thinking ... Don't think that.

Michael

ooh. thanks very much :) i finally got it sorted.

SMF spam blocked by CleanTalk