Talking about regions... ¡Help! (solved)

Started by G, Sun 13/06/2004 21:09:26

Previous topic - Next topic

G

Hy there!

I have a problem about regions, and also I ask for your help to solve it.

In a room, the caharacter is only allowed to step a little part, once he steps out of a limit he hides to hide from another character. This will be so until the player character (Let0's call him EGO) gets the other character eliminated. I've done it making a region with a script in the option "player walks onto region", when EGO walks onto that region stops walking and goes back to hide himself

All is right, until now.

There are some objects that must be used by EGO once he has eliminated the other character. The problem is that, if the player interacts with anyone of the objects, EGO ignores the script I done in the region walking over the region without turning back

How can I make him return even interacting with those objects?

Thanks and sorry for mistakes in the language.

The Spanish AGSer: G

strazer

When you click the objects, the character moves there automatically, right?
I suppose region interactions don't get triggered when the game is blocked.

Can't think of a simple solution atm... :-\

Goot

When you interact with the objects is the player character automatically going over to take them? You can make a variable for the other character being defeated, and when you click on an object, put in the script:
int otherguydead;
of(otherguydead==0){
MoveCharacter(CHAR, coordinates of object)
{
else{
MoveCharacterBlocking(CHAR,coordinates of object)
}
If I understood your question, that should work.

G


strazer

#4
Yeah, I thought about that.

The problem being that the object interaction is executed the moment you click on it when you just use MoveCharacter.

Does
  MoveCharacter(EGO, x, y);
  while (character[EGO].walking) Wait(1); // blocking
trigger the region interaction?

You have to turn off the automatic movement first:
  game.auto_use_walkto_points = 0;

Edit: Could you please let me know how you solved it?

Scorpiorus

As far as I can remember, the player automatically walks only to hotspots - not to objects, so you can replace the hotspots with objects accordingly and put Goot's script on interacting with it.

Another possibility is to use Interaction Editor's commands instead of text script when reacting on player walks onto region:

walks on to region:
|__MoveCharacter(hide....., true);

That's because the blocking commands block the text script but not the interaction editor's actions.

QuoteDoes
  MoveCharacter(EGO, x, y);
  while (character[EGO].walking) Wait(1); // blocking
trigger the region interaction?
Yes, it triggers interaction but if its action is set to RunScript then the related script code will be executed after blocking has gone, i.e. on reaching object - not instantly.

strazer

Quote from: Scorpiorusblocking commands block the text script but not the interaction editor's actions

Thanks for stating it so quotable. ;)
Now if only I knew what happenend to the tidbits & snippets thread...

Scorpiorus

QuoteThanks for stating it so quotable. ;)
Hehe ;)

QuoteNow if only I knew what happenend to the tidbits & snippets thread...
Good question, I hope you have a copy of its content?

strazer


G

Don't smash your heads no more, my friends.

The Spanish AGSer known as G has found an aesier way to solve his own problem.

I thank you all the help you gave me, finally I don't used it now, but I'm sure it will be very usefull for my future scripts.

Now, maybe you'll want to know how I solved the problem of the regions. Well. I'll explain the situation again.

There's a room where the player character (our old friend EGO), has to get into for interacting with an object. The problem of the puzzle: a character that can see EGO for multiple reasons that we don't need to know. Then,at the moment EGO enters the room, he stays hidden behind a door, of course we can see him, but we supose the other character can't. At the moment the player orders EGO to leave the door to interact with the object, EGO wlks over a region and stops, turning back, and hidding again. My problem was that, when the player ordered EGO to interact with the object, he simply goes to the object and runs the script related to the object, ignoring the region's script.
How I solved it? Easy. EGO is hidding from the other character, so he has to eliminate him before he can walk freely throught the room. So I went to the InteractionEditor for editing the object's script, opened the script and wrote this:

if (character[CHARH].room !=28); {
(several actions that happens when player interacts with the object)
}
else {
Display ("I can't, he will see me");
}

And that's my way. While the other character stays in the room, EGO won't want to interact. Easy.

Thank you for all your help, your in my Special Thanks list yet. But now I have other problem...
But that will be in another topic.

The Spanish AGSer: G

SMF spam blocked by CleanTalk