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

#1
I declarated the String outside a Function at the top of the mainscript and String mystring = ""; doesn't work for me it says 'cannot assign initial value to global pointer'
#2
Two suggestions:

If i have a String 'mystring' i can call every String Function with this String except of String.Format.
mystring.Append, mystring.LowerCase, mystring.Length and so on work just fine but to Format the String i can't type mystring.Format("any String in here") even if the editor Popup have this option in the Dropdown menu i have to use mystring = String.Format("any String in here"). When i use mystring.Format the Game compiles but it doesn't work like it should ;)

The second suggestion is that when declarating a String it should be initialized with the value "".
For Example:
String mystring;
int length = mystring.Length;

doesn't work
but

String mystring;
mystring = "";
int length = mystring.Length;

works fine.
And

String mystring = "";

doesn't work, tooÃ,  :-[

Not really a problem but it would be much more comfortable.

Great work so far,
thanks Felix
#3
thank you  :)

i don't want to call the function manually but i didn't know which two integers were passed to the function when clicking the gui.
#4
Hello,

i'm wondering how the On Click Function for GUIs works. I didn't find a documentation in the Help file for this Option.
I figured out that there are two Integers which will be passed to the Function but I don't know what they do. One is possible for the Mouse Button clicked on the GUI but the second??

Maybe you can help meÃ,  ;)

Thanks
Felix

P.S.

To make it more understandable:

function gGUIName_Click(int Integer1, int Integer2) {
Ã,  //some code here
}

This function works fine but I have to give the Function the 2 Integers (Integer1 and Integer2 in this example) otherwise AGS will throw an Error when clicking the GUI
#5
hmm maybe you can solve the speed problem with scripting. I didn't test it myself but i thought of this in repeadely_execute:

Code: ags
SetCharacterSpeed(6/(GetPlayerCharacter(), GetScalingAt(character.[GetPlayerCharacter()].x, character.[GetPlayerCharacter()].y))*100);


Maybe there's something wrong with the syntax but maybe it helps you :)
Code: ags
#6
sorry i should have used the search fuction  :-[ but maybe the function will now be implanted
#7
I can set walk to points for hotspots but i can't set this for objects (and for characters). I really need this because my character moves to the GetHotspotpointX and Y and GetObjectX and Y but for the Object i can't set the point :(
#8
oh that's the problem. if i use other keys like "q" and "a" it works fine. When will this get fixed?
#9
it just don't work.

Here's my code in repeatedly_execute_always:

Code: ags
function repeatedly_execute_always() {
  if (IsKeyPressed(47)==1) set_textspeed(0);
  else if (IsKeyPressed(93)==1) set_textspeed(1);
  if (IsGUIOn(9)==1) {
    if (timer==40) {GUIOff(9); timer=0; SetLabelText(4, 0, "Walk to");}
    else timer++;
    }
  
}


Here's my set_textspeed function:

Code: ags
function set_textspeed(int id) {
  if (id == 0) {
    SetSliderValue(9, 0, GetSliderValue(9, 0)-1);
    }
  else if (id == 1) {
    SetSliderValue(9, 0, GetSliderValue(9, 0)+1);
    }
  timer = 0;
  if (IsGUIOn(9)==0) GUIOn(9);
  game.text_speed = GetSliderValue(9,0)*6;
  StrFormat(buffer, "Textspeed - %d", GetSliderValue(9, 0));
  SetLabelText(4, 0, buffer);
  }


Until now i handled the "+" and "-" key in the on_key_press function.
Since I handled it in the repeatedly_execute_always function nothing happens if i press the keys
#10
I'm using the latest version of 2.61 and in the console it shows that every time I click when my character is moving a StopMoving is executed and then a new MoveTo is called. So I think the stuttering referrs to the StopMoving.
#11
Thank you very much that is exactly what i need :)

Thank you again ;)
#12
In my game, the player can set the Textspeed with "+" and "-" keys like in Lucas Arts Games. My Problem is that the player can't set the textspeed while a message is displayed with DisplaySpeech. I tried a solution with IsKeyPressed in repeatedly_execute_always but it didn't work :(

Does anyone know a solution for my problem?
#13
so is it quite impossible to move the character to new coordinates while moving without stopmoving him?  :(

If so, i would suggest this for the next AGS version, CJ :)
#14
Everytime a player do a left click my game calls the MoveCharacter command and my character begins to move. While my Character is moving and I click to a new (or the same position) the game calls a StopMoving command before he begins to Move to the new coordinates. The result is that the character "stutters" when repeadly clicking on the left mouse button to move the character and when I play a Adventure i do often click my left mouse button  ;D

Is there a way to Move the character to new coordinates while he is moving WITHOUT StopMoving him?
#15
my specific speech key is "." (keycode 46) like in Lucas Arts Games. I want that if i press "." the actual displayed speech removes and if there'sÃ,  next speech the next speech should be displayed.

I hope you understand what i mean.

In my room code:

qDisplaySpeech(JAN, "Now look at that. Blue sky and stuff");
Ã,  qDisplaySpeech(JAN, "Man, I'd give everything to be out of here and free, even the stuff I hide in my mattress.");
Ã,  FaceDirection(JAN, "down");
Ã,  qDisplaySpeech(JAN, "What? Didn't you know?");

and i want that if i press "." the next text will be displayed.

Edit: forgot to say that i use this script because i want that the player has nearly everytime total control over the PlayerCharacter, that's the reason why i use DisplaySpeechBackground instead of DisplaySpeech
#16
thank you very much, very useful script!!

I think it's ok using this script in my game if i metion ur name in the credits?

And another question:
In the newest version of AGS it is possible to set "game.skip_speech_specific_key" command but this key won't work in ur script :( where do i have to set the proper command?
#17
ok, this is really an unimportant bug:

if you use the empty game template and go to the predifined view number 2 and press the preview view button the editor crashes.
#18
I solved my problem. It was a problem in my script. The problem causing that the interaction was executet for my door script when i clicked on the gui was that i have a repeatedly_esxecuted command asking for GetHotspotAt(mouse.x, mouse.y). This command even gives the Hotspot number if the mouse is over a gui which is over the hotspot.
#19
function on_event(int event, int data) {
 if (event == GUI_MDOWN && data == 0 && GetInvAt(mouse.x, mouse.y) > -1) {
   if (IsButtonDown(RIGHT) == 1) {
     itemclick=GetInvAt(mouse.x, mouse.y);
     GetInvName(GetInvAt(mouse.x, mouse.y), displayhotspotname);
     set_actionmenu();
     }
   else if (IsButtonDown(LEFT) == 1) {
     SetGlobalInt(1, GetInvAt(mouse.x, mouse.y));
     GetInvName(GetInvAt(mouse.x, mouse.y), displayhotspotname);
     StrFormat(displayitem, "Use %s on", displayhotspotname);
     SetLabelText(4, 0, displayitem);
     itemon=1;
     }
 }
}

if you like to, i can send you my whole game. If you'd like to, send me a pm.
#20
Yes, my on_event function handles mouseclicks but only for GUI 0 and the problem appears with other guis.
My Label still says its a GUI or nothing (0) before i clicked :(

edit: it even hang up if the game is not in the while loop. it just show a speech and hang up (alt-x still works)
SMF spam blocked by CleanTalk