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

#1
Ah yes! I think that does the trick.
Thank you for your help, and for a great template.
#2
Hello, I've been using verbcoin template on my ags project. I have basic experience of using ags but I'm quite unfamiliar with the template.

My problem is that when I interact with an object on screen (for example an axe in my game) the ags throws me an error.
"Error running function 'repeatedly_execute':
Error: Null pointer referenced"

And ags has already spotlighted a part of template script:
  //===================================================================
// PROCESS VERBCOIN BUTTON CLICKS - INVENTORY
//-------------------------------------------------------------------
// 
// Note: for each action the inventory item that is below the verbcoin should be used
// since the x- and y-coördinates are no longer valid, we use the saved mousex and mousey coördinates
// We can only avoid nullpointer errors by doing this check for each button.

         else{
            if (guixy == gui[verbc_id]) {
          if (control == look_button){
            gui[verbc_id].Visible = false;
                  Wait(1); 
                  item2 = InventoryItem.GetAtScreenXY(mousex, mousey);
                  item2.RunInteraction(eModeLookat); //look at item
               }
               if (control == talk_button){
                  gui[verbc_id].Visible = false;
                  Wait(1); 
                  item2 = InventoryItem.GetAtScreenXY(mousex, mousey);
                  item2.RunInteraction(eModeTalkto); //talk to item
               }
               if (control == interact_button){
                  gui[verbc_id].Visible = false;
                  Wait(1);
                  item2 = InventoryItem.GetAtScreenXY(mousex, mousey);
                  item2.RunInteraction(eModeInteract); //interact with item
       


"item2.RunInteraction(eModeInteract); //interact with item" Was on yellow highlight.
Has anyone else ran into this problem? Help appreciated.

Additional info, there error doesnt always appear, aproximately every other time. Also my project is on 800x600 resolution.

EDIT: To addition I noticed this whole problem is relevant to the fact whether the inventory is open when you interact with the object in game world ( I've changed the basic inventory type that fills the whole screen to an bar that is on the up of the screen.)

I'm open for suggestions how to fix this problem, allowing to interact with the objects in the world while inv window open without receiving this particular error message.
#3
This is a great project you are working on.

I just recently got acquainted with AGS and I'm constantly trying to find new tutorials concerning different aspects of AGS. Thanks to your tutorial videos (I still constantly refer to them for guidance) and great ags community, I've really got into the basics of the program. I can't wait for more material on the book!
#4
Alright this works great, thanks to both of you for clearifying this one up :). I will name my children after you two.
#5
I've been trying to make a game title screen. In the title screen i want one of the objects (the one that says new game)
to animate once players mouse cursor is on it and stop when player removes cursor from the object.
I also wanted it to be possible for the player to interact with the object by left clicking it but in my understanding
eBlock prevents actions during its execute?

My question is this; why my animation wont commence if I DONT have that eblock on ( instead using eNoBlock).
So if I change that script to eNoBlock, animation wont start.

function room_Load()
{
   onewmotley.SetView(7, 0, 0);
}

function room_RepExec()
 {
    if (Object.GetAtScreenXY(mouse.x,mouse.y) == onewmotley){
    onewmotley.Animate(0, 5, eOnce, eBlock);}
    else {  if (onewmotley.Animating) {
    onewmotley.StopAnimating();}}
      
}

#6
Excellent, this works great. Thank you for your assistance. Thanks to you I now understand scripting little bit better!
#7
Hello all, I'm new to this forum and still learnin the tricks with ags (though densmings tutorial videos were a great help!)

I had problems concerning certain scripts; My goal was to create a dialog that was similiar to the type that leisure suite larry's had. In this type of dialog player types the topics he wants to discuss with an npc into the text gui box and depending on what was typed into the box the npc answered differently etc.


Here's piece of my script (I have to repeat my self that I'm very unexperienced with scripting and I apologise for the confusing names of variables such as playerName while it has nothing to do with playername):
 
function bOk_OnClick(GUIControl *control, MouseButton button)
{
     playerName = tbName.Text; 
     gName.Visible = false;

  {   if (playerName == "merchandise") { {
       cVasta.Say("SHHHSSH! Not so loud! You dont know who is listening");
       cVasta.Say("Thats right the merchandise, so what you into? Vanilla or chocolate ice cream?");
     gName.Visible = true;}
          
          // my goal is to make this word chocolate to not mean anything to the npc until he has asked       about the "merchandise"
           if (playerName == "chocolate")   { 
           cVasta.Say("Oh we got a gentleman with a great taste here");
           cVasta.Say("There you go my good fellow"); 
           }
           }
         
  if (playerName == "yes") {
      cVasta.Say("Yup, thats some heavy stuff I got here for you");
      cVasta.Say("so.. The big question is, which do you like better; chocolate or vanilla ice cream?");
      cVasta.Say("'Couse I got plenty of both");
     }

  else cVasta.Say("Hey man, I'm here only to sell my merchandise");
  }
}

My main problem is this, when the npc (cVasta) has said that sentence "thats right the merchandise, so what you into vanilla or chocolate" and the text box appears (gName) for the player to type his next word to, our npc suddenly executes this command:   "else cVasta.Say("Hey man, I'm here only to sell my merchandise");"

My intention was to have that sentence said only when player typing some word that has no meanin to the npc, so to say. Sorry about long post and I hope someone understood atleast something from my very confusing post and can advice me whats wrong with the current script! Thank you in advance,

SMF spam blocked by CleanTalk