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

#1
Quote from: Snarky on Tue 07/04/2015 15:40:23
Do you follow? Test it out!

More than likely, there are some bugs somewhere in this code, which I haven't tested myself. Let me know if anything breaks.

Woah. This is a lot of text. O_O *takes a few days to catch up on college work before trying to implement everything*

Okay. I followed all the steps. I almost got tripped up by the instruction to change the speech font property to cloisterblack (before I realized you were just asking me to change the number "1" to "3"), and then I got pretty tripped up by the end when you used lowercase "s" in the "speechview" thing.

But at long last we have a beautiful set of codes and whatnot that do exactly as you have envisioned. I just have one problem with this.

The default font is white with a black outline. That's ingenious because if you change the white to another color, the black stays, so its always legible. But all other fonts I import don't do that. (I'm honestly surprised I can import fonts intended for word documents into a gamemaker at all).

The logical thing to do is add back the SierraWithBackground but white looks kinda awful on these backgrounds. If I could change the color of the default background with a line of code that would basically fix this, but I don't seem to see a way for that to happen.

I could write a Gui, and that changes the background color... but it also overwrites the text color, and I can't find any lines to code to change that so that it varies from character to character. I have tried numerous things to change that, including trying to straight up change it midroom with lines like
Code: ags
BlockyGui.TextColor =1024;
, to lines trying to get it to remember character text is different from normal text like
Code: ags
cLuigi.SpeechColor =1024;
to breaking open the huge script we just wrote and trying to get it to add in a variable for speechcolor. (before remembering that even if I succeeded there, it would just be setting Luigi's color again, not the Gui's).

And now its 2:33am and I'm basically out of ideas.
#2
Quote from: Snarky on Mon 06/04/2015 09:39:46
I'm starting to feel you need to read the manual more thoroughly, and maybe take a step back and think a bit before you post questions. This forum isn't intended to give you step-by-step instructions on every problem you have, but to help you gain understanding to solve things on your own, and help you out when you're really stuck.

So when you're having an issue with the character's speech colors, for example, you should go look in the manual under "Scripting | Character functions and properties". The list is short enough that you can look through it to see if there's anything relevant there. If you do, you'll find an entry for "SpeechColor property." If you read that entry, you'll see that it says "Gets/sets the character's speech text color.

Okay I can't reply to this whole thing right now because this isn't my computer. I will probably give it a better read/reply later tonight but for this part right here.

I did do that though! I had cLuigi's text color set for most of this topic. It was working fine. Then the moment I changed it to sierra style aka portrait that messed it up and that's what I was confused on. I don't understand why changing that would break it.

Reading the manual works fine for me when it comes to basic things but when it comes to scripting I have no idea what I am reading. I tried starting at the basics in manual but it does not seem to start you with the basic of "this is how scripting works." It seems to jump right in and that is really confusing.

Edits start here:

Now that I have my game again, I double checked that Luigi's text color is indeed set to green, which it is, and that it didn't revert to default or something when I switched to sierra style. Then I fiddled with speech style trying to figure out why it overwrites Luigi's text options and realized that I'm using sierra with backgrounds. When I first saw that I thought it defined something about the portraits but apparently that means it overwrites pretty much everything to do with the text boxes. (At the very least it changes the font as well as the background? That is probably clear to everyone but me...)

So I guess the problem of Sierra portraits eating the text settings is now solved. Meaning all my original questions are now solved. Yay.

If for some insane reason you still want to help me with the font I did this in the global script:
Code: ags
void SayFont(this Character*, String message)
{
  int fontNum = this.GetProperty("SpeechFont");
  Game.SpeechFont = fontNum;
  this.Say(message);
} 


And that works now. (Well, it doesn't freeze the game). But I'm still not really clear on how/why it works or how to actually call it in the game. (yes I tried re-reading the help section on that).

You're right, I do need more information on the mechanics of basic scripting. I didn't really realize that when I downloaded this program and the first time I opened the tutorial it didn't seem to cover any of my questions. I guess part of my mistake at this point has been in presuming that the tutorial would be written in a way that would allow me to skip to the parts that are relevant to my current goals, but its more like a novel that needs to be followed from the beginning.

We could call it a day since its just font, and really my characters don't need their own super special font and its probably not worth the headache at this point. It might be better for us to just shelf the remaining problem for now and I can work on those things I do understand for a bit until I encounter another thing that is absolutely necessary, or until I've leveled up my understanding of basic scripting.

I'm really sorry for the headache. Thank you so much for all the help.
#3
3b1) I.... what text windows gui? I don't see any. My GUIs are: 0 gstatusline, 1 giconbar, 2 ginventory, 3 gpanel, 4 grestartyn, 5 gsave, 6 restoregame, 7 potrait, and 8 the one I created by right clicking the guis and saying text window gui.

Oh wait... *goes to general options* Ohh its calling upon gui 0 here. I see. I'm an idiot. *sets it to 8* :shocked: Oh. that overwrites the text options. (example, if Luigi speaks in green, this overwrites it so that now he speaks in white or something). That.. solves a pretty small problem while creating a much bigger one. Maybe I'll just deal with white text windows...? Unless I can find a way to set it to the speak character's text color... *fiddles* I can't change the textcolor value to something like "cLuigi(textcolor)"... or at least, I don't seem to be able to.

This... is a weird problem to have... maybe if I could figure out how to write a script that sets the current text gui to the speaking characters.. but then I'm right back where I started, wishing for a line of code to change the value of a pre-existing gui. And if I do that I might as well just use the default textbox gui hidden in #0, and then use that code to change the background instead....? *frustrated noises go here*

3b0 Oh you're right. *moves the script a bit* Now it doesn't give me errors. Yay! Of course it still doesn't work but, progress?

I have looked up extender functions. I am more lost than I was previously. I know this explanation in the guide looks simple but I think I need it even more simple if that's possible... reading this is like if I read an instructional guide on the rules of Japanese grammar written in Japanese.

Do... do I put the header in front of the rest of the text like

Code: ags
import function SayFont(this Character*);
functionSayFont(this Character*)
{
void SayFont(this Character*,  String message);
}

Cause if I do that I just get an error saying I already defined the function.
And if I remove the second line and leave it with just the header and the void I get a different error about how it doesn't expect me to use { or } in the places I am. I feel like I'm shooting darts into a pitch black room while blind folded.

As for the indentation... does... it actually affect things? ??? If.. you have a specific tutorial for this (extender functions). Like... aside from the one in the manual that I'm seriously trying to understand as hard as I can.

The logical thing to do is say "eh, different text colors for each character are good enough. Who needs different fonts?" but if the color scheme thing goes awry.... arg I don't know.
#4
Quote from: Cassiebsg on Sun 05/04/2015 09:24:24
Quote
2) Ohhh! Thank you so much! Threw a "mouse.DisableMode(eModePickup);" in my starting room and all is well. I don't know if it will carry over to other rooms but if it doesn't, I could just add it again to each new room, so I consider this done.


Ahhmmm.... just add it to Global Scripts and it will carry on to every room you code. Better than adding the code to every single room. ;)

Ah, I was considering that but afraid to mess with the global code too much since the first time I tried that it ended badly. But you're right. It works pretty nicely there. Thanks for the suggestion though. This works much better.
#5
Quote from: Snarky on Sun 05/04/2015 23:48:48
3a. You have basically the right idea, but the thing is that SpeechView is a property, not a method. Therefore, to change it you need to write it as "cCharacter.SpeechView = 1;" (assuming your character is named cCharacter - and if it is, I'd recommend using something more descriptive, like cGuybrush or cRoger - and the view you want is 1). And yes, this is inconsistent with how the WalkView (aka NormalView) is set; again, that's for legacy reasons, but it is definitely annoying and confusing. (The risk of confusion between properties and methods is also why I always try to include the parenthesis when talking about a method, e.g. ChangeView() and not just ChangeView.)

3b. I haven't looked into this myself, but I think the text background box is an automatic part of Sierra speech mode (since that's how it looked in Sierra games). To customize how it appears, you have to create a Text Window GUI formatted to look the way you want, and change the game setting "Text windows use GUI" to the ID of that GUI. This is explained in the manual under "Other Features | Editing the GUIs | Customized Text Windows".

When you say "change the font for individuals characters", do you mean text characters (letters, numbers, etc.) or game characters (Roger, Guybrush, etc.)? The first case might be quite difficult: AGS is in no way designed to change font in the middle of a text, and doesn't really support it. A starting point would be SSH's Hypertext module, but you might have to replace the whole dialog system.

If you mean having different fonts for different game characters, that's much easier. Basically, you just have to change the Game.SpeechFont property right before the character speaks. You can store the font as a custom character property (see "Custom Properties"), e.g. "SpeechFont" - you have to match the number to the font list yourself, though. The easiest way to be sure you always remember to set it is to create an extender function (see "Extender Functions"):

Code: ags
void SayFont(this Character*, String message)
{
  int fontNum = this.GetProperty("SpeechFont");
  Game.SpeechFont = fontNum;
  this.Say(message);
}


And now whenever you would call Character.Say("blah blah"), you just call Character.SayFont("blah blah") instead, and it will use that character's speech font.

3a Ohhhh. Thank you again! Well that fixed those problems. Must remember that rewriting a value requires an =

3b1 Opened the help thing and it told me to right click GUIs and say "new text window gui." I changed the background color on that aaaand nothing happened. It... sounds like it should work and yet.

3b0 Ah yes, I mean individual characters as in... Roger or Guybrush. In this case I'm using a character called Luigi as a placeholder until I'm ready to make the real character. I imported a font (cloisterblack in this case, again just to test it). and then added this to the global script
Code: ags
void SayFont(this Character*,  String message)
  {
    int fontNum = this.GetProperty("SpeechFont");
    Game.SpeechFont = eFontCloisterBlack;
    this.Say(message);
  }

I wasn't sure how this would work since this code doesn't seem to specify my character, and when I tried to substitute "cLuigiSay" for "cLuigi.SayFont" the game kind shrugged at me. Then I deleted that and found that the quoted code above wasn't compiling correctly.

It says "error Nested Functions not supported. (You may have forgotten a closing brace)
#6
Quote from: Snarky on Sun 05/04/2015 08:32:42
If you just want portraits, like in A Date in the Park or King's Quest 3, it shouldn't be difficult at all, and you don't need to write any code. You only need to do this:

1. In your game settings (the tab with lots of configuration options that opens by default when you launch the editor), set the speech mode to Sierra-style (IIRC there are a couple of variations depending on exactly how you want it to behave; I'll leave that up to you).
2. Import your portrait image as a sprite.
3. Create a new view. Create a loop within the view, with one frame. Assign your portrait image to that frame. Remember the number of this view.
4. In your character's properties, set the speech view to the view you just created.
5. That's it! Speech should now look essentially identical to the first example ("It's dead, I guess you have to insert some coins") from A Date in the Park.

*does that* Omg yay! Thank you X2! Just two questions about this.
3A. How do I change the speech view mid-game? (for example, what if I want the first speech bubble to have a calm portrait but then an event occurs that scares the character and the next speech bubble has a frightened portrait?) I tried cCharacter.SpeechView(1); but keep getting a parsing error for some reason? (I get the same thing when I try to change the gPortrait's background graphic midgame. :-[)
3B. For some reason this generated a box around the text. Which is perfectly fine by me, but the background for the box is white and I can't seem to find where to change this? From what I see its not in game settings, colors, text parser, character settings, or global settings. (Now that I look, I don't see any place to change the font for individuals characters either, although I suppose that's not strictly necessary and maybe not worth the headache).
#7
Quote from: Snarky on Fri 03/04/2015 09:44:33
The manual actually does answer a lot of your questions, if you know where to look (which, admittedly, is often non-obvious).

1. Sorry, I may have misled you about changing the "next mode" property. Since there is a "go to next mode" function, I thought for sure there had to be a way to define what the next mode is. But it turns out there isn't. (Like I said, the built-in mouse modes are a fundamentally bad idea.)

However, what you do have is a property called "Standard Mode". As the manual says: "Standard Mode tells AGS that this is a normal user-selectable cursor. It is used when cycling through mouse cursors, to determine whether to use the cursor or skip over it. For example, if during the game you disable the current cursor, AGS will change to the next available Standard Mode."

This suggests the first possible solution: Set "Standard Mode" to false for the cursors you don't want to use.

You see that the text also mentions disabling a cursor. That refers to this function: Mouse.DisableMode(CursorMode).

This suggests the second possible solution: At the start of the game, call Mouse.DisableMode() for each of the cursors you don't want to use.

The third possible solution comes from the key point that mouse modes can only change in a couple of different ways (as described in the manual):
-An event (typically clicking on a button) that has as its action "Set Mode X"
-A script that uses the commands "mouse.Mode = X" or "Mouse.SelectNextMode()"

There are also the following special cases:
-If your current mouse mode is disabled, the game automatically goes to the next available mode that has standard mode set to true
-If the game blocks (when you call Wait() or a blocking function), the mouse mode is set to the wait cursor
-If you're over a popup GUI (e.g. the quit menu), the mouse mode is is set to the pointer cursor

Assuming you're OK with the wait and pointer cursor, and aren't going to disable any of the modes you're using, you don't need to worry about these. Then the solution is simply to make sure that 1) there's no button that sets the mode to one you don't want to use, and 2) the script that changes the mouse mode (e.g. when you right-click) does what you want (in the default game, this is in the on_mouse_click() function of the global script, so have a look at that).

That's three pretty simple ways to achieve what you want.

3. Like I told you before, this is built-in behavior in AGS, and you don't need a module for (a simple version of) it. Start by getting the basic scenario to work: just adding a portrait to the text box. You can then add different facial expressions by using "Character.SpeechView = X". The relevant manual entries are "Text display / Speech functions: SetSpeechStyle()" (which only implicitly lets you know that this is one of the game settings in the editor) and "Character.SpeechView".

BTW, what you describe doesn't sound like Phoenix Wright at all. This is what you seem to be describing:



And this is how speech works in Phoenix Wright (i.e. Visual Novel-style):



Quite different! To get something like Phoenix Wright is a bit more complicated, but definitely doable.

2) Ohhh! Thank you so much! Threw a "mouse.DisableMode(eModePickup);" in my starting room and all is well. I don't know if it will carry over to other rooms but if it doesn't, I could just add it again to each new room, so I consider this done.

3) I suspected this might be hard. I tried "cCharacterName.SpeechView = 2;" but that was a tad... horrifying. And not what I want.
I think you are right. I just want portraits. But I have absolutely no idea what I'm doing. D: I tried the manual but it said: "This topic involves some advanced scripting. If you're just starting out with AGS, please just use one of the built-in dialog option styles for now, and come back to this later when you're comfortable with scripting." And then it proceeded to prove itself horribly right by giving paragraphs of instructions beyond the comprehension of my pathetic mind.

And I would take its advice except, A. I know for a fact I'm not going to learn what I need to understand this by ignoring it and B. this is literally the only other challenging scripting project I foresee. After that I'm content to make my character do basic things, walk around rooms, interact with things. Maybe the dialogue will give me trouble but there's video tutorials on that.

So I fiddled in the code, and pasted things like "SetSpeechStyle(eSpeechSierraWithBackground);" in various places, and my game told me it had no idea what I was trying to do or why I was putting that there. And then I clicked around on the wiki looking for help and found none.

How, specifically, do I make portraits appear next to the dialogue box? What are the codes? Do I paste saids code to do that in the global script or the first room script? Or in both places?
#8
Quote from: Monsieur OUXX on Thu 02/04/2015 09:17:15
You're getting there! Slowly but surely! Congrats for your efforts in understanding how scripting works. Once you master basic things, you'll feel so empowered ;) Then you can't get enough!

About the wiki and stuff: yes, it would be useful to replace all "adventuregamestudio.co.uk" with "adventuregamestudio.co.uk". The sad thing is that it has to be done manually. Feel free to do it whenever you spot a broken link.
One thing, though: you seem to rely a lot on online help. But never forget that when you press F1 in AGS you have the built-in help, which is very VERY useful when you learn how to search properly. Sometimes it's better to search in the index, and sometimes it's better to do a full-text search.

Reading the built-in help was the first thing I did. But I find it to be a tad confusing, and also very limited. Which is to say, it doesn't answer the questions I have when they're this specific.

1) It seems like disabling certain mouse options should be trivially easy and covered in the help section but for some reason I am completely stumped.
3) I got an updated download for one of the guis. There's just one problem. The gui has no readme or any kind of guide that I can find. (on the wiki, in the folders, in the forums... do I really just suck this much at searching)?

Edit: I'm not even sure it does what I think it does. I can get it to make a portrait appear at the top of the screen, but what I really want, is for a portrait to appear next to text every time a text box/dialogue option appears. (Again, Phoenix Wright style)

Its hard to become a game maker because first there's all this really hard learning curb stuff to get past while everyone else acts like its easy I guess? I suppose rather or not I succeed will show rather or not the victory simply goes to the most stubborn.
#9
1) I searched and searched but cannot figure out how to remove cursor options from the loop as you suggested. Could you spell it out for me a bit more? (I'm very new to scripting and sometimes this looks like Japanese to me.) edit: I'm having trouble finding the StandardMode for mouse cursors though. ??? Where exactly should I look?
2)Hm...
*opens up script* *cntrl f "tapping"*
*finds the read me* Oh. *reads* *changing "tapping" to "pressing"*
Awesome. Now if I could just figure out how to assign keys to the movement options I would have total control over the movement. Edit: Figure that out. I go to Scripts, then Keyboard movement, then under "get new direction" I add some keys to it.The code:
Code: ags
else if (IsKeyPressed(KeyboardMovement_KeyDown)) newdirection = eKeyboardMovement_Down; // down arrow" ]
is already there. So I just copied it and added a letter instead. Making it
Code: ags
else if (IsKeyPressed(eKeyS)) newdirection = eKeyboardMovement_Down; // down arrow S ]

3) Ohhh. We should change that in the wiki so newbs don't get confused. I'll let you know how that goes. Edit: The forums work now but none of the downloads do...
#10
Quote from: Monsieur OUXX on Wed 01/04/2015 10:50:39
HEllo,

I'll answer all your questions:

1) How to remove a mouse mode :
     - (the most important step) Simply go to the "cursors" section in the pane on the right-hand side of the AGS editor, and delete the ones you don't need.
     - (follow-up step #1) make sure the deleted modes cannot be accessed anymore : 1) Remove the buttons for them in the in-game icons GUI at the top of the screen. To do so, edit that GU int he AGS editor 2) Make sure they cannot be selected using in-game shortcuts. To do so, go to your global script in function on_key_press and make sure no key selects "look at" and such.
     - (follow-up step #2) Make sure to never use the deleted modes in your custom scripts. Always just use eMouseUse, for example, if that's the mode you kept.

2) Use the arrow keys to walk: yes, it's perfectly possible, once again you would edit the on_key_press function to intercept the arrows being pressed down, and then you would move and animate your character accordingly (Character.WalkTo, Character.ChangeView, etc...). But it will be easier to use a module that already does it. The default game already contains such module! Create a test game base don the default game, and test the module to see if it suits you. If yes, then import it into your own game.

3) Custom close-up dialog boxes. Yes. You're talking about the "Sierra" speech style, that you can enable in the general options of your game. I'm not a specialist of that dialogs style, so I'll let others explain how to use it. But rest assured that there are modules enhancing the base one offered by AGS, making it possible to create any kind of fancy portrait speech style that uou could ever dream of.

4) List of keys. If you open the help, you can look up "key codes" to find the corresponding help section. Here's the wiki version of that list : http://www.adventuregamestudio.co.uk/wiki/ASCII_code_table
Oh, and when you wrote that pressing the "2" key of your keypad acts as pressing "down", it's simply because the NumLock key of your keyboard is not activated. Otherwise it would indeed act as "2". And I can see no reason why the "regular" arrows of your keyboard wouldn't work.

Ah. Thanks for the reply but I still seem to be stuck.

1) I see the mouse options (and this was one of the first things I tried) but when I right click it and try to delete it, the "delete this cursor" option is grayed out and won't let me do so. :(
2) I know the default mode lets me walk with the arrow keys, but the way it does so is counter intuitive. If you hold down the left key, for example, you don't walk left. Your character sorta stutters around until you let go of the button. I was wondering if its possible to change that to more of a Super Mario Bros style and if so, how. (minus the running and jumping of course).
3) Hm... okay its called Sierra-style. More specific help would still be awesome but maybe I can find something on the wiki with this new found knowledge. Edit: Just found this topic, which would be amazingly useful if any of those links worked for me. :-\
#11
I'm very new with AGS and have lots of questions that aren't being answered by the wiki or the manual. I've been searching the bfaq and wiki in general for hours but either I'm terrible at it, or its just not there. I apologize in advance if I'm doing something wrong, but everything is kind of new and confusing. My questions are:

1. Is it possible to remove some of the mouse modes? I'd like to try my hand at a game that doesn't have so many mice to cycle through. (Why have a "talk to" button and a "look at" button when one simple "interact" button can work for all of them?) Edit: This one is now solved.
2. Is it possible to change it so you walk with the arrow keys or wasd keys by holding down said keys? (Instead of the default setting where you tap a direction and it starts the walk cycle in that direction until you stop it)? Edit: This one is now solved as well. Just one left.
3. Is it possible to change the dialogue boxes?(I'd like to add character sprites so I can show expression when characters talk to each other, if I can figure it out). Edit: This is solved.

0. Also this is a tad miscellaneous but I'm having general trouble finding a list of basic functions, or keys on this particular programing language. For example, I can't figure out how to assign keys if I start scripting. It seems the "KeyDown" refers to the num 2 on the far right of my keyboard for example, so how would I assign something to the arrow keys under my shift key? Edit: This is solved.
SMF spam blocked by CleanTalk