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

#541
Hi guys,

I was able to use Calin's AGS Blend plugin to blend 2 alpha sprites together to make a "resume" cursor when my mouse hovers over the resume button in my inventory...it uses the item's cursor sprite and combines it with an arrow + resume text so the player knows he can resume with that item.

Everything is fine up until I try to restore the item's "normal" cursor sprite...so when the mouse cursor is no longer hovering over the resume button, I would like it to "revert" back to the item's normal cursor without the drawn "resume arrow" over it.

Im guessing I need to somehow store the item's cursor image somewhere? Does this mean I need to store copies of all my different item's cursors? (That would suck)...

Im using Calin's plugin so I dont have  to make new "resume" cursors for all the game's inventory items.

Im not too sure how to proceed  :-[
#542
wow, just tried that (say("...")...it works great :P

Is that in the manual? If so, Im really sorry I missed that...and quite embarassed  :-[
#543
Hey Calin!

Well if I put a space, (sSay == " "), for example, we will see the speech text box next to the player's speech portrait, but empty...so  in my case a square border with blue filled background...I was wondering how I could do it so that the text box doesnt appear at all. Can I (or do I need to) hack the "say" command so that if the text is a space or empty it wont display the textbox but still display the speech portrait animation?

#544
Ok, well Ill just put this on hold then until I can get a hold of Abstauber, unless of course, anyone has any ideas!
#545
Hi,

Ive got a custom script that shows character expressions (not finished, still debugging):

Code: ags

void showExpression(this Character*, Expressions eExpressionType, Expression_Length eLength, String sSay)
{
  int iView;
  int iBlink;
  int iLength;
  int iDefaultLength;
  bool bIsGamePaused;
  iDefaultLength = Game.MinimumTextDisplayTimeMs;
  
  bIsGamePaused = IsGamePaused();
  
  if (eLength == eShort) iLength = 750;
  else if (eLength == eMedium) iLength = 1500;
  else if (eLength == eLong) iLength = 2500;
  
  previousView = this.GetSpeechView();
  
  if (eExpressionType == eSmile)
  {
    if (this == player)
    {
      //getSpeechView to know which expressions to show depending on what version of Brian...
      iView = 17;
      iBlink = 40;
    }
  }
  else if (eExpressionType == eAhhhh)
  {
    iView = 39;
    iBlink = 40;    
  }
  
  this.SpeechView = iView;
  this.BlinkView = iBlink;
  Game.MinimumTextDisplayTimeMs = iLength;
  
  if (bIsGamePaused == true) UnPauseGame(); //if  the game is paused, unpause so the portrait can close itself...
  
  if (sSay == "") Display("Debug, just show the portrait");
  else player.GSay(String.Format("%s", sSay));
  
  if (bIsGamePaused == true) PauseGame();
  
  Game.MinimumTextDisplayTimeMs = iDefaultLength; //(should be 1000)
  this.restoreSpeechView(previousView);
  
  bIsGamePaused = false; //reset
}


At this line:  
Code: ags
if (sSay == "") Display("Debug, just show the portrait");
, Im not sure what to place so  that if the text to display is "nothing", I just want to show the portrait animation with no text...right now if the text is blank (sSay == ""), no portrait is displayed at all.

Im guessing its something to do with AGS's built-in "say" that wont show the portrait animation if there is no text?
#546
Can this be used where most of the game is a 2d-adventure, but some parts of the game the plugin is used for 3D driving in a 3d world?
#547
...I was going to propose the exact same thing*  ;D


*this line is a lie
#548
Poor guy, I think Ive asked him like a gazillion questions already...hehe   ;D

#549
Hey monkey!

You back? Ok, well, the thing is I dont want the sprite to show up when an option is selected, I want it to show up when no options are selected at all...so I dont think I can use "info."

Ill re-read it though to see if I can figure it out :P


**EDIT**

Ok, well I get an error "Null pointer referenced" for this (in customDialogGui):

Code: ags


function mouseInsideBounds2(int iMinX, int iMaxX, int iMinY, int iMaxY)
{
  return ((mouse.x >= iMinX && mouse.x <= iMaxX) && (mouse.y >= iMinY && mouse.y <= iMaxY));
}

function repeatedly_execute_always()
{
  if (CDG.scroll_btn_timer > 0) CDG.scroll_btn_timer--;
  if (CDG.scroll_btn_timer == 0 && CDG.scroll_btn_push == true) CDG.scroll_btn_push= false;
  if (CDG.gui_type == eTextCatMode) process_button_push();
  
  if (bTacticalDialogInProcess == true)
  {
    if (mouseInsideBounds2(295, 325, 595, 665) || mouseInsideBounds2(395, 425, 595, 665) || mouseInsideBounds2(495, 525, 595, 665) || 
    mouseInsideBounds2(595, 625, 595, 665) || mouseInsideBounds2(695, 725, 595, 665))
    {
      DialogOptionsRenderingInfo *info;
      if (info.ActiveOptionID == 0) info.Surface.DrawImage(0, 100, 1568, 0);
    }
  }   
   
}


So I want it to check if the mouse is inside any of those bounderies...if so (it means no options are selected), draw sprite 1568 over the surface (this is a sprite  that hides a fake-sprite "label" to simulate nothing in the label).
#550
Hi,

Ive never used the drawing functions yet, other then simple stuff when its on a room background.

Ive got a script setup so that when the mouse is over a certain part of the customDialogGui, I want to draw a sprite over it so thats its on top of everything else. This sprite stays on top of everything else until the mouse leaves that area, in which case I would just delete it.

The problem is I dont know how to draw onto this custom gui...I got this working (as a debugging to see if my script logic is ok)...it just doesnt draw on top of the custom gui, it does it on the room's background, behind the customDialogGUI (obviously cause Im not doing the right thing!)

Code: ags

        DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
        surface.DrawImage(0, 100, 1568, 0);
        surface.Release();


I checked the manual on drawing and I have to admit I dont understand it :P...


**EDIT**

OK I found this thread Ill see if it helps:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=41116.0
#551
AGS Games in Production / Re: Over the Edge
Tue 13/07/2010 21:56:27
Wow, this looks awesome...very very nice designs...
#552
Ok, good advice! I believe I can manage to chop the total page amount down significantly...Ill try to include both then, ingame and external.
#553
Its true, 110 pages is alot, although its a small booklet...If Im not mistaken its a booklet many officers keep in their cars:
http://www.copquest.com/20-1000.htm

Ill try to prune it down so its not so massive, like keep it to things that the player will really need. It will be used mostly for  those who arent in law enforcement and would like to look up things like "cop talk" slang, various penal/traffic codes, radio codes, etc...
#554
Hi,

I was wondering about something and wanted to get some feedback from you guys on what you think of this:

Ive got a "RediRef" booklet with lots of useful information for proper police procedure/penal + traffic + radio codes/alphabet, etc...and Im trying to decide wether to include this booklet as a PDF/word doc outside of the game, or to implement it as an inventory item that you can actually open up in-game. This booklet is around 110 pages long.

If I were to make it an inventory item in-game, it would  require me to either:
1) make 110 sprites pages on a GUI
2) have an external .txt file read and transfered into text within a gui that accepts text

The main reason why I would like to have the booklet in-game is so that I can add a "search" feature, so a player can do a search on codes/procedures related to "high-risk traffic stop", for example, and it will give you the appropriate page numbers, etc...

The main reason why I wouldnt want to do this booklet in-game is I realize how much work it will take...

In your opinion, is it worth it? Should I just release an external pdf/doc instead?
#555
Dont know if this helps but I just did what you did, pretty much, by using Random...then typing out all the possible responses...I did an unhandled script for inventory item clicks, and normal gameplay clicks (for hotspots, characters, objects)...this is what my inventory items unhandled script looks like

Code: ags

void unhandled_InventoryMenuResponses(InventoryItem *overItem) 
{ 
  unhandledResponse_Inv = Random(5);
  //EXAMINE INVENTORY ITEMS 1/4
  if (mouse.Mode == eModeExamine) 
  {
    if (unhandledResponse_Inv == 0) Display("Unhandled response...rand00 Examine item: %s", overItem.Name);
    else if (unhandledResponse_Inv == 1) Display("Unhandled response...rand01 Examine item: %s", overItem.Name);
    else if (unhandledResponse_Inv == 2) Display("Unhandled response...rand02 Examine item: %s", overItem.Name);
    else if (unhandledResponse_Inv == 3) Display("Unhandled response...rand03 Examine item: %s", overItem.Name);
    else if (unhandledResponse_Inv == 4) Display("Unhandled response...rand04 Examine item: %s", overItem.Name);
    else if (unhandledResponse_Inv == 5) Display("Unhandled response...rand05 Examine item: %s", overItem.Name);
  }
  //MANIPULATE INVENTORY ITEMS 2/4
  else if (mouse.Mode == eModeManipInv) 
  {
etc.....
}


Im almost 95.4% sure people here could write that better, but hey, it works!
#556
Sorry for the double-post, didnt want to create another topic:

Is a "void" faster or like more efficient than a function that doesnt return anything, but still named (wrongly), a function?

I heard somewhere that its better to rename your functions to "void" if it doesnt return anything because its "better"/faster...

If so, well Id like to pass through all my scripts and rename my returnless functions to voids...how do I know if those functions returns anything...is it safe to say that if I don't see "return blah;" somewhere in the function, I can rename the function to a void?
#557
Yeah that IS true though, shorter to debug later...Im going to have to think about this then a bit to make sure...but again, thanks for the help :)
#558
Hi,

I was wondering the main reason why you guys would NOT recommend having the hotspots + objects processed in a module rather than in the room scripts? If I dont personally mind using else if's and using
the hotpost/objects .ID or .Name, is it still "ok"?

I guess I personally rather having everything in one location instead of going through all the room scripts, etc...

Here is an example (at the debuggin stage anyways) of the unhandled script for objects (same template for hotspots)

Code: ags

function unhandled_GamePlayResponses_Obj(Object *oObj)
{
  unhandledResponse_Obj = Random(5);
  //LOOK AT OBJECT 1/5
  if (mouse.Mode == eModeLookat)
  {
    Display("Unhandled response...Object: %s", oObj.Name);
  }
  //INTERACT WITH OBJECT 2/5
  else if (mouse.Mode == eModeInteract)
  {
    Display("Unhandled response...Interact with %s", oObj.Name);
  }
  //QUESTION OBJECT 3/5
  else if (mouse.Mode == eModeQuestion)
  {
    Display("Unhandled response...Question %s", oObj.Name);
  }
  //COMMAND OBJECT 4/5
  else if (mouse.Mode == eModeCommand)
  {
    Display("Unhandled response...Command %s", oObj.Name);
  }  
  //USE INVENTORY ITEM/TACTICS ITEM ON OBJECT 5/5 
  else if (mouse.Mode == eModeUseinv)
  {
    Display("Active Inventory: %d", player.ActiveInventory.ID);
      //INVENTORY ITEM
      if (unhandledResponse_Obj == 0) Display("rand00 Inventory Item \"%s\" on object: %s", sActiveItem, oObj.Name);
      else if (unhandledResponse_Obj == 1) Display("Unhandled response...rand01 Inventory Item \"%s\" on object: %s", sActiveItem, oObj.Name);
      else if (unhandledResponse_Obj == 2) Display("Unhandled response...rand02 Inventory Item \"%s\" on object: %s", sActiveItem, oObj.Name);
      else if (unhandledResponse_Obj == 3) Display("Unhandled response...rand03 Inventory Item \"%s\" on object: %s", sActiveItem, oObj.Name);
      else if (unhandledResponse_Obj == 4) Display("Unhandled response...rand04 Inventory Item \"%s\" on object: %s", sActiveItem, oObj.Name);
      else if (unhandledResponse_Obj == 5) Display("Unhandled response...rand05 Inventory Item \"%s\" on object: %s", sActiveItem, oObj.Name);  
    }
  }  
}

#559
Nice, thanks for the extra info guys...Im going to use your tips to see what I can do so its as good as possible :)



**EDIT**
Ok I found the solution
#560
Ok so whenever something is clicked from the editor that creates a line in the Global Script...should stay there, right?

Is it safe to say pretty much any function with "_onclick" should stay in the GS?

Also, I was thinking of doing this and was wondering if its "a good idea":

Instead of having hundreds of cThisCharacter_Look,  cThisCharacter_Talk, etc...I was thinking of processing everything for hotposts, characters and objects in my "on_mouse_click", something like this:

Code: ags

function on_mouse_click(MouseButton button)
{
    LocationType loctype = GetLocationType(mouse.x, mouse.y); 
    if (loctype== eLocationCharacter) doGameResponses(eLocationCharacter);
    else if (loctype== eLocationHotspot) doGameResponses(eLocationHotspot);
    else if (loctype== eLocationObject) doGameResponses(eLocationObject);

}


Then, I would have this in a module:
Code: ags

function doGameResponses(LocationType *loctype)
{
   Character *overCharacter = Character.GetAtScreenXY(mouse.x, mouse.y);
  Object *overObject = Object.GetAtScreenXY(mouse.x, mouse.y);
  Hotspot* overHotspot = Hotspot.GetAtScreenXY(mouse.x, mouse.y); 
   if (loctype == eLocationCharacter)
  {
     if (mouse.Mode == emodeLook)
    { 
       if (cChar == cEgo) Display ("This is the main character"); 
       else doUnhandledInv_Character(overCharacter);
     }
     else if (mouse.Mode == emodeTalk)
    {
        //etc...
     }
  }
   else if (loctype == eLocationHotspot)
  {
     //etc...
  }
   else if (loctype == eLocationObject)
  {
     //etc...
  }
}


Then, another module would handle the unhandled "generic" responses like so:
Code: ags

function doUnhandledInv_Character(Character *cChar)
{
  unhandledResponse_Inv = Random(5);
  if (unhandledResponse_Inv == 0) cChar.GSay(String.Format("Hmmm, nope, that %s doesn't look familiar.", sActiveItem)); 
  else if (unhandledResponse_Inv == 0)
   //...etc....     
}



Is this a "good" way of handling all the possible responses to left clicks for hotspots, objects and characters? I feel I can manage it better in a module so I wont make my GS even bigger than it already is...
SMF spam blocked by CleanTalk