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

Topics - Knox

#81
Ok, Ive asked many questions lately so this should be my last one for a while, dont want to piss anyone off :P

Im sure its pretty simple but how can I break up a very long "display" text so that I dont have to scroll all the time in the window? Im not talking about using the "]" character to break lines in the game... For example, from this:
Code: ags

Display ("Hi, Im a super long text that makes me have to scroll all the way in AGS editor.");

To something like this?
Code: ags

Display ("Hi, Im a super long text that makes 
me have to scroll all the way in AGS editor.");


Hope its not a stupid question :P
#82
Hi, its me again  ;D

Im sure this is going to be another "1question 1 answer" type thread...

I just want to know how to place a (I think its called a "pointer"?) inside a function parameter "thing" ---> ( ) (sorry, I dont know how to call this!) when its a cursor mode (like eModeLookAt, for example):


Code: ags

function cursorAnimOnOff(this CursorMode*, int iXcursor, int iAnimView, int iNoAnim )
{
    if (mouse.GetModeGraphic(this) == iXcursor) //"x" cursored-out
    {
      if (cursorAnim == true)
      {      
        mouse.ChangeModeView(this, iAnimView); //change to normal animated view
      }
      mouse.ChangeModeGraphic(this, iNoAnim); //normal cursor, no animation
    }  
}


When I previously tried "this GUI*" or "this Button*"....it worked...now I try "this CursorMode*" and it gives me an error:

GlobalScript.asc(913): Error (line 913): 'this' cannot be used with primitive types

Whats a primitive type? Im guessing Button* or GUI* arent "primitive types" since those worked and "CursorMode*" didnt?

Are those "pointers"...and most importantly, in the manual they explain what pointers are but is there a list of all "pointers" in AGS somewhere? I couldnt find it.
#83
Hi,

Im guessing this is pretty simple to answer but I cant debug this on my own. I first did the script in the manual for saving a screenshot:
Code: ags

  String input = Game.InputBox("Type the filename of your screenshot:");
  input = input.Append(".bmp");
  SaveScreenShot(input);


This works fine, it saves the bmp with the right filename the user inputs.
Next, I tried to accomplish the same but with my own gui:
Code: ags

function openScreenShotGUI()
{
  mouse.Mode = eModePointer;
  gScreenshotGUI.Visible = true;
  input = txtScreenshotInput.Text;
  input = input.Append(".bmp");
}

The button that takes the screenshot:
Code: ags

function btnScreenshot_OK_OnClick(GUIControl *control, MouseButton button)
{
  SaveScreenShot(input);
  gScreenshotGUI.Visible = false;
  mouse.Visible = false;
}

At the top of my global script, I declare the string "input":
Code: ags

String input;


However, with my custom GUI, the screenshot gets saved but there is no name...its just .bmp. Im guessing for some reason the input string gets reset to "null" when I call the function to take the screenshot?

What did I do wrong?
#84
Lets say I have 3 gui's, and each gui can close each other with keyboard shortcuts if one of  them is opened...as in, say guiA is open and I press "b" to open guiB, guiA will close and guiB will open...same thing for any other combination of gui's + their shortcuts. Also, if none are open, pressing the shortcut button wont close anything, it will just open the gui assigned to that shortcut.

Ill try to explain what Im after, let me know if it isnt clear:

Id like to add the names of these gui's into an a global string array so that I can use it later in a function, and be able to exclude the function parameter's gui name from the array and do stuff to each remaining element in that array...something like this:

Code: ags

String guiList[3] = {gA, gB, gC}

function hideGui(this GUI*)
{
  if (this.Visible) return;
  else
  {
    //exclude "this" from array guiList[]; (not sure how to write this line)-->
    guiList[] -= this //(something like this?)
    for $each in guiList[] //for each element now remaining in the array after removing "this"
    {
      $each.Visible = false; //set the visibility to false
    }
  }
}


I looked up Arrays in the Manual but Im still not too sure how to do this...Im thinking I might have to convert the gui names into ints and then use their index? Im confused!

#85
Ive recently learnt how to make my first function with parameters and it looks like this:
Code: ags

function off_SoTurnOn(this Button*)
{
  if (this.NormalGraphic == 1175)
  {
    this.NormalGraphic = 1176;
    this.PushedGraphic = 1175; 
    this.MouseOverGraphic = 1184;
  } 
}


I was wondering how can I add a global variable as  the parameter...something like this;

Code: ags

function myFunction(this GlobalVariable*)
{
   //do something
}


Basically I just want to be able then to type in the name of my global variable in another function, (myVariable.myFunction) and it will execute more script.

Since I couldnt figure it out, I tried to do this instead as a work-around but I get an error I cant convert 'Button*' to 'const string';

Code: ags

function panelSettingsRestore(this Button*)
{ 
//the name of my variable is the same as the button name, plus "Restore" (btnMyVariableRestore)

 String globalVarName = (this + "Restore");  
 if (globalVarName == true)
  {
    this.off_SoTurnOn();
  }
  else
  {
    this.on_SoTurnOff();
  }

}

So how do I "get" the String "contents" from a Button* name and be able to add other pieces of "string" to make a new string? ...and even better, how do I just add global variables I have declared at the top of my global script into a parameter for a function?

Hope this makes sense :P
#86
Ive got a game setting that turns swearing on or off. If the mode is on, you see swearing in the text and dialog. I saved this setting in a bool and by default its true:
Code: ags
bool matureLanguage = true;


I wrote this String, if matureLanguage is false, instead of the inputted swear word string, display a "censor" of characters:
Code: ags

String swear(String sSwearWord)
{
  if (matureLanguage == true)
  {
     return sSwearWord;
  }
  else
  {
    sSwearWord = "$%#@";
    return sSwearWord;
  }
}


However, I dont know exactly how to display this (with Display, Say or in a dialog). This was my best attempt:

Code: ags
    Display("Go %d yourself.", String swear(Fuck)); 


How would I display this in dialog, say command or with display?

#87
I found a way to fake a "container" and I was wondering if you guys thought its an "ok" way to do it...or if you knew of an even better way?

Lets say you have a fridge in a room. I make the fridge an object. When you click on it, it opens another room with a closeup view of the fridge. This fridge is also an object. On top of the fridge are my sprites of other objects (milk, bread, etc). When you click the hand icon, it makes the objects disappear and adds it to your inventory. If you want to put it back, when you click on the fridge object with the item's cursor, it will just make the object re-appear and its then removed from your inventory.

Im guessing that's what everyone else is doing, right?
#88
I have my right-click mouse button set to cycle through my cursors in "on_mouse_click":
Code: ags
  
    if (button == eMouseRight)
    {
        mouse.SelectNextMode();
    }


Right now, when I right-click to cycle, this is how the cursor order is cycled (# on the left is the mouse ID):

Current sequence:

0-Walk
1-Look
2-Interact
3-Question
4-Use Inv
5-Command
6-Run

However, I would rather have the run cursor come right after the "walk" cursor and the "use inventory" cursor as the last option as I cycle with the right-click.

Ive searched the manual and it seems IIANM the mouse ID cannot be changed...so how would I "reorder" the sequence so that I get the new result when I cycle through cursors with the right-mouse button?

New sequence:
0-Walk
6-Run
1-Look
2-Interact
3-Question
5-Command
4-Use Inv


#89
For learning purposes, I was wondering what the main difference is between adding an inventory item in game_start within the global script vs. setting the option "player starts with item" to "true" in the item's property box.

Code: ags
function game_start()
{
  //Add Default Inventory items
  player.AddInventory(iWatch);
}


Is one way "better" or "faster"  than the other or are  they equally the same in terms of memory/computation (which I doubt would be very much anyways since its pretty simple).

Im guessing its the same thing?
#90
Hi,

Im working on a 1024x768 game, and I believe I will need more frames for various character animations than if I were working on a smaller game (640x480, for example).

Is this assumption right? I would think so...

For a walk cycle, in your opinion, what is the "ideal" frame count? I have a K9 dog and Im currently using 30 frames for his walk loop...is this overkill?

Im thinking of keeping this 30 frames per second for most of my character animations, its just since I dont have much experience perhaps more knowledgeable people here could offer some good advice.

If not, I guess I always have the good old "trial and error" and see what the best results I can get with the less frames possible...:P
#91
Hi!

Ive got a program that enables me to create an installer, but do you guys know of a software that will perform tests on the system to see if the minimum requirements are met? If they arent met, it will display a "failed" test...and wont let you install the game.

I was looking around for something like this without luck :P
#92
Hi,

Im able to play .ogv files on my computer in D3D 9 or DirectDraw 5 from within AGS (playVideo)...those movie clips are 1024x768 .ogg renamed to .ogv...no problems.

However, Ive tried to play those videos from my game on other computer and they dont play at all (both modes)...just black screen. I was wondering:

What can I do to make sure my videos (ogv) will work on "most computers"...and hidden? Ive converted the ogg files to MWV no probs...and placed those vids in the compile folder...however, I dont like having the video files unhidden. Whats cool about the ogv is its inside the exe so people cant watch them when they want. Ive got "bonus videos" as a reward for completing certain puzzles so having the vids unhidden isnt something I want!

Are there any other options available to me so I can make sure most users will be able to play the vids + have them hidden? I considered using animated views but at 400+ frames per view for each video (1024 x 768)sprites, its kind of crazy....

Ill try some tips from here: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=25522.0

But in the meantime...Any other ideas/tricks anyone has found other than the ones posted in that thread?
#93
Again, just fiddling for learning purposes, I placed this line into "function repeatedly_execute_always()":

Code: ags

  else if ((gAGSIntro_Txt.Visible) && (IsKeyPressed(eKeyEscape) == true)) 
  {
    player.ChangeRoom(7); 
  } 


Ive got logo intros when the game starts (Ags logo intro, studio logo intro, etc...) and some of them Ive placed as tween blocking...Now Im just adding a line in rep_exec_always that checks if the person pressed "esc" while those intro Gui's are visible...it will skip the intro's and just go to the main Title Menu Screen (which is Room 7).

Im getting this error though:
Code: ags

This command cannot be used within non-blocking events such as repeatedly_execute_always.


I tried putting it in rep_exec, no error this time when I press "esc" key, but nothing happens...the room doesnt change.

Anyone know what Im doing wrong here?

thnx

****EDIT: Ok I just used "startcutscene/endcutscene" and that works...still though, Im curious to know WHY the other line above doesnt work! :P
#94
Hi,

Im just fiddling around and learning new things with scripting, and Ive come up with a (surely) simple problem. The following code "works", but there is an exception...what Im testing is with the music volume slider in the game options...basically what I want to do is as long as the left mouse button has the slider selected and the user is moving it, it changes a sprite graphic (makes "Music Volume" sprite glow)...as soon as the left mouse is released  (and the slider), that sprite gets reset back to its non-glowing sprite.

I tried this:

Code: ags

function sldMusic_OnChange(GUIControl *control)
{

  if (mouse.IsButtonDown(eMouseLeft))
  {
    if (btnMusicVol.NormalGraphic != 60)
    btnMusicVol.NormalGraphic = 60;
  }
  else if (!mouse.IsButtonDown(eMouseLeft))
  {
    if (btnMusicVol.NormalGraphic != 84)
    btnMusicVol.NormalGraphic = 84;
  }
  SetMusicMasterVolume(sldMusic.Value);
}


It works partly, only if I select/deselect the slider quickly...if I keep the left mouse clicked down for a while and slide it up and down, and then slowly release, the graphic stays in the "glow" state, even though I no longer have the slider selected.

(normal, default sprite)


(glowing sprite while slider is being moved)

What did I do wrong?
#95
Hi,

It seems I can no longer "view" a sprite from the sprite viewer while double-clicking on it. I used to be able to do this, but now I get this error:

Quote
Unable to launch your image editor. Make sure you have an application installed to handle PNG and BMP files, and that it is not already running. If it is running, close it and then try again.

Error: Object reference not set to an instance of an object.

Im using the final version of 3.2, and Windows 7 64 bits.
#96
Hi!

Ive been working on my little police-game project for a while now, mostly getting the gui's/menus done, some placeholders, etc...Monkey's is also helping majorly in the script area to setup the "base" mechanic/gameplay of the game...Im now starting to slowly put the game story together, and I was wondering what kind of events/subjects/characters you would like to see in a police game (like police quest).

It would be great to get your input on this, I would love to include as much as I can of your suggestions!

Example:

-Play as a swat member, a homicide detective, pulling over a drunk driver, arresting a vandalist/arsonist, drug raids, the subject of police brutality, Internal Affairs, planting evidence, etc...

Any idea is appreciated, as crazy or simple as you can think!

:)
#97
Hi,

Ive run into a problem that I only recently noticed with the borders in my custom text gui. It seems that depending on the length of text to be displayed, the top right or bottom left corner sprite gets switched with the center sprite, so it looks something like this (look at top right corner):



That spot should be transparent, like the bottom left corner...

The 8 border sprites of  this text gui are png's with transparency (a pink color). The game is 1024x768, 32bits.

It "sometimes" does this, and if I modify the text where it bugs (like removing or adding a character), the bugged corner returns to the normal transparent display.
#98
Hi,

Ive noticed while in fullscreen mode 1024x768 with the borders activated (RC3) that the gui for custom dialogs (Austauber's module) gets placed off-center...and to the right.

I can provide a screenshot if needed.
#99
Hi,

Ive been fiddling with the PlayVideo command and with .ogv video files. Ive been able to get the video to play when I press a button that has the proper script attached to it, and also I can successfully get the vid to  automatically play when a player enters a room (before or after fade-in).

What Im wondering however is what could be done if I wanted a video .ogv to be playing (looped) constantly in the background, with gameplay still working "over" the video? Ive check-out the theora plugin + forum, but I have to admit Im not too sure how to get it done (sorry, I really did try). I tried Scotch's demo, and its pretty much what I would need to have...except instead of putting code in the room script, I would need to have it in the global script (Im guessing) since its for GUI background animation (when the inventory or Settings menu is opened, there is a background animation). Right now Im using animated views, but its pretty heavy since there are a lot of full-screen sprites looping.

Perhaps someone could walk me through it? It would be appreciated, Ive been stuck on this for a good week :(

#100
Hi,

I was curious as to the preferences of people here on a certain aspect of adventure games:

When the player clicks on an object to look at it, or perform a certain action, do you prefer that a display text pops up giving you a certain message (like an invisible narrator in Sierra games, 3rd person), or do you prefer that its the main character that says the messages...for example:

Version A--> Imagine you click on a door to open it, but you cant...a text box appears and says "You cant open this door, its locked".

Version B--> The main character's dialog portrait pops up and he says "I cant open this door...its locked!"

Just curious, Id like to get a percentage of the majority I guess to help me decide what version to use :)
SMF spam blocked by CleanTalk