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

#21
Advanced Technical Forum / Unresolved Script?
Tue 01/06/2010 20:21:30
 I have a function in GlobalScript.asc which goes:
 
Code: ags
 function unitUPG(String Type, bool UPGable){ 


Then I have a function in GlobalScript.ash which goes:
 
Code: ags
 import function UnitUPG(String, bool); 


But when I try to run the game, a message box (!) comes up and tells me:
  "Unable to create local script: Runtime error: unresolved import 'Unit UPG' "

  I am calling UnitUPG from other rooms,  but I doubt that makes a difference
   How can I fix this?
   Thanks
#22
 Hey all!
  Just wondering whether it is possible to find a label from a GUI by it's ID. I know that all labels have an ID relative to the GUI, but that all GUI's  hav a unique ID. So I'm looking for something along the lines of:
Code: ags

  gui[number1].Label[number2] = stringValue;
  

  obviously, it's not that easy, but is there a way of doing this sort of thing?
   Thanks
#23
 Hey All!
  Just wondering whether it is possible to alter/get rid of a DrawingSurface variable after it has been released, otherwise I will have a load of GUI's to make...
  Thanks
#24
 Hey all!
  sorry if this is a stupid question, but It's the only explanation I could think of...
  I have an object exactly where a hotspot is, but it isn't visible. The hotspot works fine. Then, after a certain event, the object becomes visible, and the hotspot stops responding to my clicks. I'm 95% sure this isn't a coding problem
  Is the object blocking out the hotspot? if so, how can I prevent it?
  Thanks
#25
 Hey all!
  Just a question, how can I access functions in the GlobalScript.asc which themselves are in the GlobalScript.asc (in other words, both calling and responding functions are in the GlobalScript.asc). For easy purpose, suppose the function I am currently in is Function 1, and the one I am trying to call is function 2. When I try to run the script, AGS complains that function 2 is an 'unidentified token'. No problemo, I thought, I'll just import it into GlobalScript.ash. Unfortunately, AGS now complains that: 'Already referenced name as import'.
   So now I'm a bit stuck., how can I call that function 2?
     Thanks in advance for your help.
       Geork
#26
Beginners' Technical Questions / ALL IS BUGGY!
Sat 17/10/2009 22:36:06
 Hello!
  Somehow, I don't know how, my game has become...well...buggy. Hotspots sometimes don't respond, walkable areas sometimes don't let me walk more than 30 pixels. I'm a little confused...my FPS never goes above 42, and usually stays on 40. I am working with 16 bit on a 640X480 screen (I'm using a netbook with 800X600 screen). The more content I add to the game, the more things start to respond less. I have not added much, apart from my first room which has 8 hotspots, the rest just have edges for getting between the rooms. I hope the cause isn't the 55 or so dialogs I already have (Which I plan to increase drammatically).
     Do I have to set anything? What am I doing wrong?
         Thanks
#27
 Sorry if this is a little noobie...
Somehow, when a dialog is going (even when no-one is speaking), the key functions cease to work untill the dialog finishes with a stop command. Is there anyway to be able to switch on key usage in dialogs? (after someone has spoken would probabely be easiest)
   Thanks
#28
 Hey all!
  I had just finished 12 different dialogs (all linked together), and tried to run my game, but I got an "Unhandled error" box, containing these words:

Error: Index was outside the bounds of the array.
Version: AGS 3.1.2.82

System.IndexOutOfRangeException: Index was outside the bounds of the array. ---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
  at AGS.Editor.DialogScriptConverter.ProcessEntryPointTag(String dlgScriptCommand)
  at AGS.Editor.DialogScriptConverter.ConvertDialogScriptCommandToScript(String dlgScriptCommand, StringWriter sw, CompileMessages errors)
  at AGS.Editor.DialogScriptConverter.ConvertDialogScriptLine(String thisLine, StringWriter sw, CompileMessages errors)
  at AGS.Editor.DialogScriptConverter.ConvertDialogScriptToRealScript(Dialog dialog, Game game, CompileMessages errors)
  at AGS.Editor.DialogScriptConverter.ConvertGameDialogScripts(Game game, CompileMessages errors, Boolean rebuildAll)
  at AGS.Editor.AGSEditor.CompileDialogs(CompileMessages errors, Boolean rebuildAll)
  at AGS.Editor.AGSEditor.CompileScripts(Object parameter)
  at AGS.Editor.BusyDialog.RunHandlerOnThread()
  --- End of inner exception stack trace ---
  at AGS.Editor.BusyDialog.Show(String message, ProcessingHandler handler, Object parameter)
  at AGS.Editor.AGSEditor.CompileGame(Boolean forceRebuild, Boolean createMiniExeForDebug)
  at AGS.Editor.Components.BuildCommandsComponent.TestGame(Boolean withDebugger)
  at AGS.Editor.Components.BuildCommandsComponent.CommandClick(String controlID)
  at AGS.Editor.GUIController._mainForm_OnMenuClick(String menuItemID)
  at AGS.Editor.MainMenuManager.MenuEventHandler(Object sender, EventArgs e)
  at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
  at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
  at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
  at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
  at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
  at System.Windows.Forms.ToolStripMenuItem.ProcessCmdKey(Message& m, Keys keyData)
  at System.Windows.Forms.ToolStripManager.ProcessShortcut(Message& m, Keys shortcut)
  at System.Windows.Forms.ToolStripManager.ProcessCmdKey(Message& m, Keys keyData)
  at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
  at System.Windows.Forms.Form.ProcessCmdKey(Message& msg, Keys keyData)
  at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
  at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
  at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
  at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
  at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
  at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
  at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
  at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
  at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
  at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
  at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
  at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
  at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)

 I sent error report, but it suggested going on the forums to ask about it, so I am. It was fine with 3 dialogs.
  Thanks
#29
 Hey all!
  Is there a way of calling up save game GUI, load game GUI and Inventory GUI without the buttons not working from GlobalScript.ash? I have the following code:
Code: ags

   else if(upcount == 5){
   gInventory.Visible = true;
  // switch to the Use cursor (to select items with)
  mouse.Mode = eModeInteract;
  // But, override the appearance to look like the arrow
  mouse.UseModeGraphic(eModePointer);
   }
   else if(upcount == 6){
    gSaveGame.Visible = true;
  // Get the list of save games
  lstSaveGamesList.FillSaveGameList();
  if (lstSaveGamesList.ItemCount > 0)
  {
    // If there is at least one, set the default text
    // to be the first game's name
    txtNewSaveName.Text = lstSaveGamesList.Items[0];
  }
  else
  {
    // No save games yet, default empty text.
    txtNewSaveName.Text = "";
  }
  mouse.UseModeGraphic(eModePointer);
  gIconbar.Visible = false;
   }
   else if(upcount == 7){
    gRestoreGame.Visible = true;
  lstRestoreGamesList.FillSaveGameList();
  mouse.UseModeGraphic(eModePointer);
  gIconbar.Visible = false;
   }

all the code inside these upcount ifs is copied from show_save_game_dialog, show_restore_game_dialog and show_inventory_window. the problem is I cannot call any of these functions (so I had to copy script) and don't know how to call the closing functions. Is there any way I can call the GUI and have the custome buttons work?
       Thanks.
#30
 Hello all!
  I was wondering whether it is possible to implement an object into many rooms (instead of implementing the object in each room, and updating it to the last rooms status). For example, maybe a healthbar which has 5 different HP stages, and if the player gets damaged, another object is displayed for a different HP stage, I wouldn't want to add 5 objects to many, many rooms i will be using. (This is an example).
   Thanks
#31
 hey all!
   I have come across a problem to do with calling a function inside dialog i have a function inside the global scripts GoBack(int gg). I tabbed in dialog, then coded:
 
Code: ags

    GoBack(beforetalk1);
  

  when that wouldn't work, I searched the index, and tried
 
Code: ags

  import function GoBack(beforetalk1);
  

   all this at the end of a dialog.
   first time it complained "Undefined token 'GoBack' " fair enough
   Second time however, it said "import not allowed inside function body"
    Is there a way around this?
    thanks
#32
 Hey all!
  I've been trying to execute this code:
   
Code: ags

    cChar1.SayBackground("try %d", tries);
   

   yet the engine will not allow it, something along the lines of:
     wrong number of parameters in call to 'Character::SayBackground'
   Is there a way of displaying an integer in a say background text?
       Thanks
#33
 Hey All!!
  I have a question concerning character relocation. I have a region (1) where a character will follow you in, but if the varial zomhp4 is equal to 0, then he should move back to another position.
Code: ags

 if(zomhp4 <= 0){
    cZom4.UnlockView();
    region[1].Enabled = false;
    cZom4.StopMoving();
    zomhp4 = 10;
   cZom4.x = 575;
   cZom4.y = 200;
  }

  the only problem is that the character remains in the same position as he stopped in (which he does if the zomhp4 = 0), he doesn't go to the coordinates given
  am i doing something wrong? (answer: yes), and how can I correct it?
   Thanks
#34
 Hey All!
  I've searched the manual and index, but I can't find something on this:
      How does one get 2 characters to move at the same time according to each others movements? I'm trying to achieve a sort of minigame where the NPC is walking in the opposite direction. The eNoBlock doesn't work because my character is constantely moving. Is there a solution?
     Thanks
#35
Beginners' Technical Questions / eKey question
Thu 28/05/2009 14:26:00
 Hey all
   I am trying to make something happen when the user presses a key, and only for that room. I got the code and the claim event, but apparentely I need to include a function or something (the index wasn't clear): on_key_press. how do I create a code that only works for that room? I tried:
Code: ags
 if(keycode == eKeyRightArrow){
    cEgo.Walk(cEgo.x - 40, cEgo, eBlock, eWalkableAreas);
    ClaimEvent();
  }
 
, but it didn't recognize 'keycode'
        thanks
#36
 Hey All!
   I'm trying to trigger an event when one character gets close to the other (say about, 5x and 5y away). I tried the "IsCollidingWithChar" method:
                 
Code: ags

                if(cChar1.IsCollidingWithChar(cEgo) == 1)//tried to also put in numbers like 50 etc
                

                 but one character just walks round the other. I also tried the "AreThingsOverlapping", but that seems to only work with objects.
                Is there a way to solve this?
                   Thanks ;)
#37
Hey all!
  I'm trying to give the player time for 3 seconds to move the mouse before the narrator starts to talk again, as part of a tutorial. But my code is simply not using the if statement for the timer, here's the code:
 
Code: ags

    function room_AfterFadeIn()
{
 Mouse.Visible = false;
 gIconbar.Visible = false;
 gStatusline.Visible = false;
 cEgo.Say("&19 hello world!");
 Wait(40);
 cNarr.Say("&1");
             //continues with Narr talking
 Mouse.Visible = true;
  gIconbar.Visible = true;
  gStatusline.Visible = true;
 SetTimer(2, 120);  //heres the timer
 if(IsTimerExpired(1)){  //here is where it is meant to go onto the
                                     //next bit
   Mouse.Visible = false;
    gIconbar.Visible = false;
    gStatusline.Visible = false;
   cNarr.Say("&7");
   Wait(40);
   Mouse.Visible = true;
   gIconbar.Visible = true;
   gStatusline.Visible = true;
   SetTimer(3, 280);
   if(IsTimerExpired(3)){
     Mouse.Visible = false;
      gIconbar.Visible = false;
      gStatusline.Visible = false;
     cNarr.Say("&8");
     Wait(40);
                   //more Narr talking
     Mouse.Visible = true;
     gStatusline.Visible = true;
     gIconbar.Visible = true;
   }
 }
}

  thankyou
#38
Beginners' Technical Questions / Dialog tree
Sat 21/03/2009 15:33:05
  Hey all
   I was wondering about dialog tree options, and what one could do with them. so far, I can only make dialog, but I was wondering if it is possible to:
   a) change a variable if a certain option is chosen.
   b) be able to make an inventory item dissapear, appear after an option (e.g. a transaction).
   c) be able to add voice in the dialog
thanks
#39
Hey all!
  I've looked everywhere, tutorial, wiki, youtube, the local library, but I havent found any reference to the UseInv() function, and I'm not quite sure how it works. what I am hoping to achieve, is that one object is needed the get the other e.g. a hooked stick to get a key, which is in my case. I tried this code, but it doesn't want to work:
Code: ags

   function okeyy_UseInv(iKey) //iKey is the object required to use on okeyy, the object
{
 if (brim ==1){    //brim = 1 when the player is in the right position
   okeyy.Visible = false;  //get rid of object (so to speak)
   player.AddInventory(iInvItem1); //add key
   GiveScore(5);
 }
}

  but it doesn't like that, I can guess that maybe I need to reference some kind of ID for the iKey, but I really don't know how to do that, either.
    thanks for the help!
#40
Beginners' Technical Questions / 2 room errors
Wed 11/03/2009 17:08:27
 hey Ags!
    I've just tried to run my room (it worked fine earlier), but then I tried some coding in my first room file and BANG! I get these two error messages, I must have done something silly...I cleared up any additions I had made but still had these errors when I tried to compile:
    Error1:
 Failed to save room room1; details below
                         

    Error2: my code looks normal, but when I try and compile this;
       
Code: ags
 // room script file

function hHotspot1_AnyClick()
{
  Display("ahh, my prized chicken tickka masala collection");
} //etc etc etc
     

   but the error complains that:
 Runtime error: Functon still open, missing }
                                                       

    This error is related to line 1 (the //room script file), and I can't understand why. I tried putting a } there but naturally, that didn't work
      Thanks
         Geork
SMF spam blocked by CleanTalk