Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - johto760

#1
Thanks for pointing that one out...

I think I'm gonna do the manual thing... thanks again...
#2
Just like what the title says,

So far whenever I call the ChangeRoom function in the interact function of something like so:

Code: AGS

function hGoLivingRoom_Interact()
{
  player.ChangeRoom(2, 615, 640);
}


The engine goes to the position where I clicked, that's good and all, since I opted to have the character "Automatically move in walk mode" in my general settings.... so here's my question:

Is there a way to not have the player WALK to the position before going to the other room? To rephrase: "Make the character go to some room when a user clicks somewhere around a hotspot, WITHOUT the walking scene"....


I tried something like this:
Code: AGS

function hGoLivingRoom_Interact()
{
  StartCutscene(eSkipMouseClick);
    player.Move(hGoLivingRoom.WalkToX, hGoLivingRoom.WalkToY, eNoBlock);
  EndCutscene();
  player.ChangeRoom(2, 615, 640);
}


'coz I've noticed that during look/interact mode in other hotspots, I am able do something like talk FIRST before going to that hotspot like so:
Code: AGS


function hUnderBed_Look()
{
  player.Say("Let me look under mah bed there");
  player.Walk(hUnderBed.WalkToX, hUnderBed.WalkToY, eBlock);
}


and I could totally override the walking stage of my character by changing the coordinates or something,

But during the ChangeRoom function, I seem to not have that control anymore, if I do something like:

Code: AGS


function hGoLivingRoom_Interact()
{
  player.Say("yeah");
  player.ChangeRoom(2, 615, 640);
}


the walking stage would always go first before the say function, I wanna be able to make a double click on that hotspot and the character will be INSTANTLY teleported to another room WITHOUT having the character WALK first, just INSTANT, no scene, no walking, just an instant fadeInAndOut, WITHOUT walking..

I hope I'm making myself clear by restating my problem again and again and again..

I'm using version:  (Build 3.2.1.111)
#3
nice.. thanks for pointing that out...
#4
 :confused:

Don't know why, but there are times when I can't access this forum, the wiki, or anything that bears the adventuregamestudio.co.uk address...



Am I the only one?

Am in the Philippines, if that will help..
#5
Hello everyone,

Like what the title says,


I'm trying to make a dynamic text box, where I can control hopefully "dynamically" what is written in the label, or what the confirm and cancel button does.
In order for me to do this, I think I should pass a String to some function and use that as the label, and pass a function and put it in a global variable where my btnConfirmTextBox_Click() and btnCancelTextBox_Click() functions can access them.

I have something like:

Code: AGS

function createTextBox(function confirmCallback, function cancelCallback)
{
    // When I do something like this:
    confirmCallback();
    // I get an error: GlobalScript.asc(561): Error (line 561): PE04: parse error at 'confirmCallback'
    // When I do it like this:
    confirmCallback;
    // I still get the error: GlobalScript.asc(561): Error (line 561): PE04: parse error at 'confirmCallback'
}


How does passing a function as parameter work anyways? does it even work?

I put the code above in my GlobalScript.asc, then I call it from one of the rooms after it fades in,
I create a function in some room like this:

Code: AGS

// This should be the function that will be called in the GlobalScript.asc
function generic()
{
    Display("Yeah");
}

/* I just realized while writing this post that GlobalScripts.asc could not call scripts from local scripts hehe, does this fact affect my question? I hope not ^_^,*/

/*If GlobalScripts cannot access/call functions from local scripts, then passing a function from a local script to the globalscript is impossible? does that make sense at all?"*/


function room_AfterFadeIn()
{
    // I tried doing something like this:
    createTextBox(generic(), generic());


    // and something like this
    createTextBox(generic, generic);
 
}



ADDITIONAL INFO:

I'm using (Build 3.2.1.111) by the way, I think it's the latest version

I just saw that I cannot use a function as a global variable... *sigh*.... how would I go about this?


The goal is still the same:

create a textbox where I can change "on the fly" what my btnConfirmTextBox_Click() and btnCancelTextBox_Click() does.



I think I've solved it... *SIGH*


Since the value of a textbox would always be a String, Instead of finding a way to store a function in a global variable, I'm just gonna have to store whatever value the text of the textbox is on a global String variable..

something like:
Code: AGS


function btnConfirmTxtBox_OnClick(GUIControl *control, MouseButton button)
{
  valueOfContent = txtContent.Text;

    // Where String valueOfContent as Global Variable
}



Sorry for the trouble guys...
SMF spam blocked by CleanTalk