Changeing rooms w/ hotspots(SOLVED)

Started by Saemtyh1, Mon 07/04/2008 21:28:33

Previous topic - Next topic

Saemtyh1

I have a little problem.   I cant find anything related to using hotspots to change rooms.  Ive looked through the guide, and hotspots.ect and charicter.ect .  I have taken some visual basic and c++ training, but this is just frustrating.  All I want is for the player to walk over onto a hot spot and have it change rooms.  Here is what I sludged out.

//set bool
bool Hot;

// I make it false
Hot = false;


// If the bool is true change rooms.
if (Hot = true) {
  character.ChangeRoom(3, 366, 225)
 
  //if player is on hot spot....
 
  //this is my problem I need a var telling me hes on the spot or is there an easyer way.
  if hotspot.Enabled (Hot = true)
  // and yes i how what hotspot.Enabled does.  I just need something else there.
???

All i want is to know how to detect if player is on top of a hotspot.  Not changing rooms via a click (the easy way).  Maybe I'm just stupid, please help.  I was thinking i could do it from my char's position,

If char.pos > whatever char.changeroom. 

But I want it specifically related to all the borders of a hotspot.  Thanks in advance. :=

Snake

#1
You should be able to click on the "interactions" button for that particular hotspot, double click on "player stands on hotspot" (then select RunScript), type in all your code (checking whatever you need to check to see if certain conditions are true), then send them to the new room - all in the "player stands on hotspot" interaction.

I hope that helps,


--Snake
Grim: "You're making me want to quit smoking... stop it!;)"
miguel: "I second Grim, stop this nonsense! I love my cigarettes!"

Khris

Or use a region and its "player walks onto region" interaction. (Doing it via hotspots is possible but obsolete since 2.62 or 2.7 I think.)

Saemtyh1

This probably will sound silly but how do you open it up?  The region/hotspot interaction page that is.

Saemtyh1

#4
Sorry for the double post!  But I'm still having trouble building the function :'(

Here is what it looks like...

//Kick ass function was made for me

function region1_WalksOnto(){

//Now i want to change rooms...

character.ChangeRoom(3,366,225);
}

Do I really need to set a bool value and check if its true inside of this function?  It gives me this error...
Failed to save room room2.crm; details below
room2.asc(11): Error (line 11): '[' expected

Like I'm in an IF ELSE statement or something I put one of those things everywhere and it just tells me to parse it out...  GAAAHHH  :-\
Im going to try and build an IF statement inside with some bool logic.  Any Ideas?  Im very, very rusty with programming languages so its ok if you think I'm dumb.




Gilbert

That's because character is an array.

You need to either specify which character you're referring to via number, say:

character[2].ChangeRoom(3,366,225);

Or, use the OO-name of that character set in the editor, say:

cEgo.ChangeRoom(3,366,225);

or

player.ChangeRoom(3,366,225);

Saemtyh1


SMF spam blocked by CleanTalk