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

#561
Hi,

In the manual, I found an entry "Multiple Scripts" which explains that you can break up your Global script into pieces if it starts to get large. Right now mine is about 6000 lines, but this includes many "custom scripts" to manage inventory items, various gameplay elements, etc...

Here is all I could find in that entry that explains what to keep in the GS:
Quote
The main global script still has to contain all the event functions (Look At Character scripts, Interact With Inventory scripts and so forth) and all the GUI handlers (btnSave_Click, etc).

The thing is, Im still not too sure what needs to be in the GS, it just says "and so forth"...for those who have done this already, is it a "trial and error" kind of deal?

"All the event" functions Im not to sure what it means, exactly...GUI handlers, its ok though, I understand that...
#562
I guess I could say its still something I struggle with but Im sure eventually it will sink in. Im surprised though that...if this is weird to say, scripting is actually "fun"...its satisfying being able to solve scripting "puzzles" and then seeing the results on screen!
#563
Ahh, thats it...I checked it out, it is for the blink view!

So, is this another "caveat" or can something be done to add delays on frames for blink views?

:)
#564
Sorry for the double post but if I just edited my last post perhaps it wouldnt get noticed.

So far the caveats are:

Lip-synch not supported
Thinking views not supported

Again, I might be wrong, but it seems to me that delays that are set for each frame within the speech views seem to be ignored...is that possible? I mean, I can see it animate fine with all  the proper delays in the preview, and if I use .Say...but if I use GSay, those delays seem to be set to 0, or just bypassed/not taken into account (?).

Try making a view where one of the frames has a delay set to something noticebly long (like 120, for example)...its *seems* to me, anyway, that the delay will be ignored.

Anyways, perhaps if you have time you can check this out? Maybe Im doing something wrong :P
#565
Ok nice, this works perfect!

Is it "safe to say" pointers are one of the most difficult concepts in C++/scripting?
#566
Code: ags

if (!File.Exists(String.Format("$SAVEGAMEDIR$/%s.bmp", input)))


Crap, that works...freakin parenthesis..sesses...

:P
#567
Hi,

Im sure this is another simple one, I tried to get the right syntax for this but I cant seem to get it to work. I just want to make the file name in the following line to be a variable. I tried String.Format in conjunction with File.Exists + savegame dir without luck.

This works if I name the actual file name (which I dont want, but to debug, it worked)

Code: ags

if (!File.Exists("$SAVEGAMEDIR$/input.bmp"))


This doesnt work, but what I want (make the filename a variable):
Code: ags

if (!File.Exists(String.Format("$SAVEGAMEDIR$/%s.bmp", input))
{
   stuff....
}


Im guessing Im missing a parenthesis somewhere, or I cant use string.format with file.exists?
#568
Hey Khris,

You're right, I wasnt sure if it was the same thing but it is...since I learnt mel script a while ago I have a hard time "unlearning" a few things from that way of scripting thats different with ags...doh!

Well thanks again, Ill try this out now :)
#569
You can perhaps try using Abstauber's Custom Dialog GUI, that way you dont have to write one yourself and its pretty cool:

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=36313.0

#570
This probably wont help you at all but I think the only way right now is to add "transparent space" on the top of your portrait sprites to "fake" it being lower...unless, of course, someone knows another way :P
#571
Hey RickJ,

Well what Im doing is each bool in the gleamList is for activating a certain loop animation within a view. If a certain type of GUI is opened (say, type A, for example), it sets the bool bIsGuiOpenA to true and all the others to false...meaning it will run loop 0 in viewX. If it were a type B Gui opened, I would have bIsGuiOpenB set to true and the others to false...now run loop 1 of viewX instead.

I integrated what you suggested, but the only problem is when I get to the function "showGleamType_HideOthers(int iType)"

Since the array is bool, when I enter
Code: ags
showGleamType_HideOthers(0)
(to hide the 1st element in the array), it returns an int... I think theres a problem with the array? As in, I dont want to use the "value" of those bools in the array, I want to use their "names" so I set them true or false later in the function, one by one.

For example, in this case:
Code: ags
gleamList[iType] = true; 
doesnt set bIsGuiOpenA to true, it sets gleamList[0] to true...which is like saying set "false to true" (because I initialize all those bools to false at the beginning).

How do I actually get to set the name of the bool variable to true or false? (Hope this makes sense!)
#572
Hi guys,

Recently with the help of people here, I was able to get something to work with arrays + pointers. This is what it was:

Code: ags

#define guiAmount         32
GUI* guiList[guiAmount];

(in game start)
  guiList[0] = gPanel; guiList[1] = gHelp; guiList[2] = gSave; guiList[3] = gLoad; guiList[4] = gRestart...etc



I used the same concept with buttons, and it also worked (Button* borderListTct[borderAmount])

How can I use this with a list of bools? This is my list of bools I declared at the top of my global script:

Code: ags

bool bIsGuiOpenA = false;
bool bIsGuiOpenB = false;
bool bIsGuiOpenC = false;
bool bIsGuiOpenD = false;
bool bIsGuiOpenE = false;


I tried this and I get an error:

Code: ags

#define gleamAmount       5 
Bool* gleamList[gleamAmount]; 
(in game start):
gleamList[0] = bIsGuiOpenA; gleamList[1] = bIsGuiOpenB; gleamList[2] = bIsGuiOpenC; gleamList[3] = bIsGuiOpenD; gleamList[4] = bIsGuiOpenE;


The function Im trying to use all that with:
Code: ags

function showGleamType_HideOthers(bool bType)
{
  // first make the type "true"
  if (bType == false) bType = true;

  // second, make all the others false
  int i;
  while (i < gleamAmount) //5 types of gleams (A,B,C,D,E)
  {
    if (bType != gleamList[i])
    {
      if (gleamList[i] == true) gleamList[i] = false;
    }
    i++;
  }
}


Note that "(bool bType)" isnt exactly what I want, Im not sure how to write so that its "one of the elements in the array of gleamList"...which are all bools.

What I want this function to do is set the selected bool to true and all the other ones that are in the list to false... so when I use it, it would look someting like this:

Code: ags

showGleamType_HideOthers(bIsGuiOpenA); //show typeA, hide all other types


Im sure Im almost there...
#573
aaaaawww yeah, thats what Im talkin' 'bout! Nice, Ill look that up right away and get cracking.

Thanks Khris, always helpful :)
#574
Hi,

This probably is something very simple once again but I dont understand the "why" of this little "problem":

Currently Im debugging something and I placed these lines in my on_mouse_click in -->  if (mouse.IsButtonDown(eMouseLeft))
Code: ags

    //Display("Mouse Mode:%d", mouse.Mode);
    Display("Click");


It works most of the time except when I get to my menus GUI's (that pause the game when opened). When Im in eModePointer, usually, when I click on the left mouse button I never see the "click" message, nor the other debug message (which gives me the current mouse mode)...I just get no display at all, although if I use the pointer mode in the normal gameplay screen, Ill ge those display messages no prob...

So obviously something in my menus are not letting me see those debug displays when I click on the left mouse button. I really dont know what though, I dont think I did anything different to those menus that would make AGS not able to tell me when the left mouse is being clicked. I noticed if I set the GUI menu flag "Clickable" to "0", it will display those debug messages...so I guess the menu GUI absorbs the click, but how come it wont display my messages?

PS: its not a eMouseLeftInv issue though, its really a leftmouse click issue.

How do I get those display debug messages for left-mouse clicks working like I want to when the mouse is over a clickable menu?
#575
haha! ;D

Nah, unless other peeps want to...Ill just do it to my copy :P

Thanks!!

#576
Oh nice!

Thanks guys...solves it quite beautifully  :)
#577
Hmm, I thought I "had" to use the move function...ok, much better to do it this way! You're right, using the move function I had to make sure the player is on a walkable area.

#578
Hi SSH,

Just wanted to know if I can replace the following line #89 (Portrait_AnimSpeed=this.AnimationSpeed) to (Portrait_AnimSpeed=this.SpeechAnimationDelay) within my copy of your script:

Code: ags

function GSay(this Character *,  String what,  int view,  int loop) 
{
    if (view<1) view=this.SpeechView;
    Portrait_Frame=0;
    Portrait_Loop=loop;
    Portrait_View=view;
    //Portrait_AnimSpeed=this.AnimationSpeed;
    Portrait_AnimSpeed=this.SpeechAnimationDelay;


Id rather modify the speed of the speech with the speech animation delay rather than the character's movement speed.
#579
Hi guys,

Ive got a character that is never visible on screen but visible for dialogs (a 911 dispatcher). When the player uses the radio, I placed this at the top of the "send" button's script:

Code: ags
 
  int iPlayerX = player.x;
  if (iPlayerX >= 512) //player is to the right
  {
    cDispatcherA.Move(0, -100); //move DispatcherA to the left
  }
  else if (iPlayerX < 512) //player is to the left
  {
    cDispatcherA.Move(1000, -100); //move DispatcherA to the right    
  }


I figured that by moving the dispatcher character the opposite side of the main player, when they engage in a conversation the portraits speech views would be also opposite each other...however, surprisingly regardless of my above code, the dispatcher's speech portrait is always on  the left, no matter what.

I placed the dispatcher's starting room to "none" and have this code in "on_event" to automatically place the dispatcher character into the room that is being loaded:

Code: ags

void on_event (EventType event, int data)
{
  if ((event == eEventEnterRoomBeforeFadein) && ((data != 0) || (data != 7))) 
  {
    cDispatcherA.ChangeRoom(data, -100, -100);
  } 
}


Sierra-Style portrait location is set to "BasedOnCharacterPosition" in General Settings.

Any ideas why I cant seem to make the dispatcher's speech portrait to display opposite of the player's speech portrait?
#580
Either that or the panoramic module could work too.
SMF spam blocked by CleanTalk