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 - actaria

#41
Quote from: Khris on Wed 02/11/2022 10:14:22A Textbox has an OnActivate event that runs when the Enter key is typed. You'll want to also have this function run when the enter button is clicked, so what you need is this (assuming your textbox's script name is txtCode):

Code: ags
// this is the standard handler for the textbox
function txtCode_OnActivate(GUIControl* control) {
  String code = txtCode.Text;
  // do something with code here
}

// use this to handle the enter button (needs to be somewhere below the first function!)
function btnEnter_OnClick(GUIControl* control, MouseButton button) {
  if (button != eMouseLeft) return; // ignore right / middle button
  txtCode_OnActivate(txtCode); // call textbox handler
}

This should work I guess; if not you can also try txtCode_OnActivate(gKeyboard.Controls[txtCode.ID]);


Hello Khris yes this part on Textbox OnActivate with the code is vorking well

Now i need to make the delete and  and enter keys on the GUI to work when i click on them  :)  so the player don't have to use his physical keyboard and can do eveything with the mouse



Thanks again for you help
#42
Hello Snarky and thank you for you help

I found an easy solution for the space key

Code: ags
champ_mdp.Text = String.Format("%s ", champ_mdp.Text); 

Sorry i made a mistake on my previous post keys are
Space
Delete
Return

for a virtual keyboard on a GUI



So now i have all letters and space working.
I need the Delete and Enter keys to work so the player can validate or edit the code he will enter without using his physical keyboard only playing using the mouse.

Thank you

#43
Hello,

It's me again, everything is working well except the fact that i can't manage to make work keys:

Delete
Enter
space

I tried using control.ID + code with a lot of differents codes but none seems related to these keys ?
I tried from 0 to 300 i think :)

I could also tried this method

Code: ags
myTextBox.Text = String.Format("%sa", myTextBox.Text); // append a lowercase "a"

but i don't know what the syntax will be for: Delete, Enter and Space

Thanks a lot for your help
#44
Thank you very much for taking the time to explain eevything so well each time.

Now i can even chosse between  3 differents syntax   :)
#45
Hello Khris,

Once again you give me a true masterclass of how it works.

I Was still trying to find a solution and  beginning to think that I was  not going the right way and this was the case.

You explain it very"instead of calling a function provided by AGS, you are providing the function which is then called by the engine." well with this sentence:

 I had to read it like 3 times  :)  to understand but now  I get it.

For the second part it's pure genius time saving and it works like a charm.

Thank you so much Krhris and i have just one more question please what is:


control.ID + 97  ?
   8-)



#46
Hello,

I made a GUI that looks like a keyboard  where you have to enter a code.

Each letter of the keyboard is a button

And there is also a TextBox

So the player can enter the code using the GUI keyboard

I found the Key code table here:

https://adventuregamestudio.github.io/ags-manual/Keycodes.html?highlight=press%20key&case_sensitive=0

But i can"t find the correct syntax i have to put for each button

For letter A i tried

Code: ags
function letter_A_OnClick(GUIControl *control, MouseButton button)
{
(keycode == eKeyA);
}

and a few other but this is not the correct syntax

Anyone can help ?  ;-D

Thanks a lot


#47
Quote from: eri0o on Sat 29/10/2022 15:35:07You have to use only the video id, it's the code between v= and the next & in the URL

O yes thank you eri0o it's working now  :)
#48
It took me a lot of time to make the GUI and understand a  little bit how it works but i would  never have been able to find the solution on that one i think.

You save me once again  Khris, thank you so much plus you take time to explain how it works and the mistake i made this is really kind.

So thanks again  :-D  and regarding to the youtube video i checked and i have no space in the first tag but when i click on the video it says an error as occurred.

I already posted a video on the forum and it was working.
#49
Hello,

I just did customs GUI for
gSaveGame
and
gRestoreGame

It was not that easy to make evrything work well but now it does except the fact that when i open gResoreGame i can only choose the last game saved and not the older one see the video below

Here is the code i have in:

lstRestoreGamesList_OnSelectionChanged

Code: ags
function lstRestoreGamesList_OnSelectionChanged(GUIControl *control)
{
show_restore_game_dialog();
}

I tried a few things but didn't managed to fix it.
Any help would be appreciated, thank you.

#50
Update:

Genius move it was the solution

return + ID number of the dialog it works very well  :)

Thanks you so much you saved me  once again i really wanted to try most of the dialog possibilities
#51
Hello,
Yes maybe its a bug because everything works fine except when i put the goto-dialog in the else block.

I will try your solution and let you know what happens  :)

Thanks again for your kindness.
#52
looks like i can't post here anymore no idea why:

An error has occurred
CleanTalk:
Access has been denied. Please contact the site administrator at cleantalkadventuregamestudio.co.uk with your account's email address to have it whitelisted. If registration is blocked, try temporarily disabling your VPN first to register.

I will try agaon later maybe it will works

EDIT here comes the full dialog code:

dialog_char1 += 1;  is  dialogue_nairo
Purificateur_Nairo:  is the PNJ

Code: ags
// Dialog script file
@S  // Dialog startup entry point
  dialogCounter = 0;
return
@1
Purificateur_Nairo: test
  dialogue_nairo += 1;
option-off 1
 if(dialogue_nairo == 5)
  {
    cpurificateur_nairo.Say("Il faut que je retourne");
    cpurificateur_nairo.Say("Prier pour Shaena");
   

  
     cpurificateur_nairo.LockView(58);
     cpurificateur_nairo.Animate(1, 3, 0, eBlock, eForwards);
  }
return
@2
Purificateur_Nairo: Je suis le purificateur de ce temple
Purificateur_Nairo: Je soigne les malades 
Purificateur_Nairo: Et les personnes blessées 
Purificateur_Nairo: Grâce à la puissance de nos statues
 dialogue_nairo += 1;
option-off 2
 if(dialogue_nairo == 5)
  {
    cpurificateur_nairo.Say("Il faut que je retourne");
    cpurificateur_nairo.Say("Prier pour Shaena");
    cpurificateur_nairo.LockView(58);
    cpurificateur_nairo.Animate(1, 3, 0, eBlock, eForwards);
  }
return
@3
Purificateur_Nairo: Il s'agit des divinitées de EREONEO
Purificateur_Nairo: Elles nous protègent de la magie noire 
Purificateur_Nairo: Malheureusement elles ne sont pas 
Purificateur_Nairo: Efficaces contre ces envahisseurs 
Purificateur_Nairo: J'ai essayé de les invoquer 
Purificateur_Nairo: Mais ça n'a pas fonctionné
 dialogue_nairo += 1;
option-off 3
 if(dialogue_nairo == 5)
  {
    cpurificateur_nairo.Say("Il faut que je retourne");
    cpurificateur_nairo.Say("Prier pour Shaena");
    cpurificateur_nairo.LockView(58);
    cpurificateur_nairo.Animate(1, 3, 0, eBlock, eForwards);
  }
return
@4
Purificateur_Nairo: Je suis en train de prier 
Purificateur_Nairo: Pour que rien ne lui arrive
Purificateur_Nairo: Et qu'elle nous revienne au plus vite
 dialogue_nairo += 1;
option-off 4
 if(dialogue_nairo == 5)
  {
    cpurificateur_nairo.Say("Il faut que je retourne");
    cpurificateur_nairo.Say("Prier pour Shaena");
    cpurificateur_nairo.LockView(58);
    cpurificateur_nairo.Animate(1, 3, 0, eBlock, eForwards);
  }
return
@5
  if (dialogCounter <=1) {
     cpurificateur_nairo.Say("C'est impossible");
     dialogCounter++;
  }
 else {
option-off 5
      dialogue_nairo += 1;
goto-dialog 3
  }
return
@6
stop


Thanks again i am still trying to go from 5 to another dialog


#53
O yes i understand better now since dialog_char1 +=1 is a regular command it needs to be indented

option off and dialog_char1 +=1 are working but when i put the goto-dialog 3 i have the following errors:

Dialog 2(84): Script commands can only be used in the area between a @ entry point and the closing return/stop statement
Dialog 2(85): The command 'return' will be ignored since the script for this option has already finished
Dialog 2(87): Error (line 87): PE04: parse error at 'else'


thanks again for you precious help
#54
Quote from: Snarky on Wed 19/10/2022 12:24:01In part because you are not indenting your code properly (though unfortunately the dialog script hack for mixing dialog commands and regular script commands means that it is not always possible to do so).
100% true  :)
#55
Hello and thank you Crimson Wizard,

Code: ags
// @1
  else {
option-off 5
  }

The indentation rule (special dialog commands with no indent) is working with:
option-off

But I also need to use
goto-dialog and to increment a variable "dialog_char1"

So i tried:
Code: ags
// @1
  else {
option-off 5
goto-dialog 3
dialog_char1 += 1;
  }

Unfortunately it return errors

Any idea ? thank you
#56
I am sorry it's me again

How do i use these values:
option-off
and
goto-dialog
inside the else bracket ?

I found:

RUN_DIALOG_GOTO_PREVIOUS;
RUN_DIALOG_RETURN
RUN_DIALOG_STOP_DIALOG

but nothing that can do option-off and goto-dialog

Is it possible ?

Thanks again  :)
#57
Once again thank you so much and i am so sorry for such a stupid mistake  how can i not see that after looking at my code for so long...

Thanks again eri0o
#58
Hello,

I hopoe everyone is doing well.

I am have problem trying to use a dialog counter

I'd like to have aother sentence said when i asked 2 times the same question to a PNJ.

Unfortunately it gives me an error and i don't manage to fix it so i need a little help here please.

I use a global variable
dialogCounter  int  0

At the beginning of the dialog i have set the dialog couter to 0

Code: ags
// Dialog script file
@S  // Dialog startup entry point
  dialogCounter = 0;
return

then in the dialog i have this code

Code: ags
@5
  if (dialogCounter <=2) {
     cChar1.Say("I said no");
     dialogCounter++;
           }
  else {
     cChar1.Say("well ok if you insist");
	      }
  return


That returns me the following error:

Dialog 2(79): Error (line 79): PE04: parse error at 'else'

Line 79 is:
 else {

What i've i done wrong here ?

Thanks a lot in advance for your precious help.






#59
Hello Pax Animo thank you for the reply.

I am using Bass template, this is a good idea i will have a look on options to handle click maybe i will find a way to do it there.

Thanks also for the hotspot on/off command it will be useful later.

If i can”t make it with the template options maybe i will just make the object a bit smaller so the character can easily walk around.

Have a good sunday
#60
Hello,

There is one new thing i don't manage to do the way i want it to be.

The player has a mouse trap that has to be put on the floor at a specific area.

The area (floor) is an object, it is working well (use inventory on object) then the mouse trap appear on the floor.



The problem i have is that the object (floor) is set on "clickable" and when i click on the object area it display the generic message "i can"t do nothin with that" (it's just an exemple of course).

I don't want any message to be displayed so i set the object on clikacble=false and of course "use inventory on object isn't working anymore because of that.

I also tried with hotspot but it also display a message when you click on the area and i didn"t find a way to make a hotspot not clicbable and i think i should stick with the object solution.

Can you tell me what is the best way to do that and get no message when you click on the object so ou can freely walk around  but still be able to interact with it (use inventory on object).

Thanks a lot once again for your precious help.
SMF spam blocked by CleanTalk