Can you have only one character actviating a hotspot

Started by shaungaryevans, Tue 19/05/2009 21:10:08

Previous topic - Next topic

shaungaryevans


I now have two characters on the same time, one following the other one. I have also got a two hospots and when you go over thing happens and when you go over the other one it does the oppusite (on/off). Can you put a code in so that if char A walks on the hopstot, something happens for him and nobody else please?

Vince Twelve

Just use

Code: ags

if(player==cCharsName){
  //do stuff
}


in the code for the region's walk onto event.

Trent R

1) Use regions, not hotspots. If something happens when you walk onto it, then use a region.

2) Use the static Region.GetAtRoomXY to check which character is there. The manual includes a script that will work for you.


~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

Khris

Doesn't only the current player character trigger region events?

Vince Twelve

#4
Good point Khris, I didn't notice that he said one char was following the other.  I assumed we were talking about multiple playable characters.  If so, it shouldn't trigger unless the current player walks on it.

That is, if he's using regions and not hotspots as he said.

Trent R

Ah, I forgot about that. Considering it says under the events pane "Player..." for each, I'd say that you are right.

So if it's the player, you should be covered. Otherwise, use GetAtRoomXY in the rep_exec.


~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

SMF spam blocked by CleanTalk