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

#81
Thanks guys, I was wondering too if there was a way to call functions from a struct, and this was exactly what I needed. Got it working now :)
#82
Ah yes I understand now. All the null pointer errors I've gotten in the past have made me a little paranoid of using zeroes. ;) I actually used 0 just now for the dialogue with the player character itself (which is character ID 0) and it works just fine.

I'm not actually putting every game interaction on this GUI, perhaps that wording was poorly chosen. I meant the act of giving/showing/exchanging items WITH the characters you're talking to, and the emotes you perform during the conversation. The whole system is just for dialogues, nothing else. It's an experiment, trying to find a new way to present conversations. It might end up not being the greatest thing ever, but I'll have to see it through to find out.
#83
Ah it won't expect a second digit at the 'start' of the array even if you told it there might be one? That's good to know.
Well, that's what you get when you let designers mess with advanced programming features I suppose :) I cranked the array back down to [4440], and I guess people are just gonna have to adjust that number to suit their needs. I'm still wondering if there is a smarter way to manage it since it only encompasses character-related interactions now so I would still have to define item-based interactions and other miscellanious interactions seperately. But I'll get back to you on that once I play around with this some more.
#84
I actually realized why the multiplication was there right before you posted :) it makes a lot of sense once you get it.

But good news! I've started slowly hooking all this code up to the old system, and the first test indicates it works.
I realized I hadn't accounted for there being more topics than buttons when I defined the array at [444] earlier, which admittedly was pretty dumb. Then I started thinking the same thing about the characters, there might be more than 9 so I should make that one double digits too. But as an array cannot start with a 0, I reversed the action and character properties. So now it looks like this:

Code: ags
dialogue dlg[49999];  //4 categories, 99 characters and 99 possible topic slots


And GetIndex looks like this:

Code: ags
int GetIndex(int action, Character *cha, int topic) {
  return action*10000 + (cha.ID-1)*100 + topic;  
}


I just haven't figured out how to read the right topic from the button yet. I thought of looping through all the topics in the struct to check them against the button text, but with 99 options that would probably be kinda slow.

I think that's the only remaining issue to be worked out, because like I said, I gave it a testrun by defining the topics for ASK > GIRL in game_start, plus I tried disabling the option I clicked on, and it all seems to work, so the logic behind the system is sound.
#85
The name might be a little deceiving, charID is actually a Character*.

Thanks for the help so far Khris, I really feel like we're getting somewhere I could never have gotten by myself. I'm not the biggest programming whiz, really abstract concepts with a lot of numbers take a while before I can grasp them. That being said, I like where you were going with the rewritten GetIndex, but I'm not sure I fully follow how it would operate exactly. So far I adapted it to:

Code: ags
int GetIndex(charID, int action, int topic) {
  return charID.ID-1*100 + action*10 + topic;
}


My charID already stores the character pointer for whichever character I selected in Column B, so that takes care of that. I made an enum for the actions, that should be no problem. Where I start to get a little foggy is the topic variable. I know how to manually specify it, but how do I dynamically extract it from the button I just clicked? There are 4 buttons in Column C but there might be 23 options total in the struct for this NPC (of which 19 will currently be disabled obviously). Would you mind explaining a bit more how you would format the different conversations in the structs? And why is that -1*100 and *10 in the formula for GetIndex, what does that do? Also, am I correct in assuming this would actually eliminate the need for seperate dlg_npcname structs since the first digit now already specifies the NPC?
#86
Ahh excellent, thanks!
At first I wanted to see if I could name the structs the same as the NPC's since I already store the adressed NPC in the variable charID, and if I could use that like charID.Name[123].Text all the code would remain independant of the name, in case that would change later in development. But that's probably a whole other unnescessary can of worms, so dlg_girl would indeed seem like the best way to go.
#87
Hmm that is an interesting spin on it, I'll look into that. Not everything is purely character-based, but three of the four column A options do have a submenu that involves selecting characters, yes. The other one will eventually have responses/emotes that you can use in reference to something a character said (using the index number to identify the context).

A quick usecase might be:

ASK > GIRL > NAME : you're too shy to talk to her
TELL> YOURSELF > YOU CAN DO THIS : confidence++
ASK > GIRL > NAME : her name is anna, she asks for yours
TELL > ANNA > YOUR NAME : etc etc


I get the error on the line with import dialogue GIRL[444];
Any reference to a second struct throws it. And if I remove this definition, but not the checks in the rep_ex for example, it throws PE04 parse error at '1' or something similar, like symbol '1' undefined. Remove any mention of those additional structs and I get no more errors.
#88
Since the previous post I've been trying a few things, with relative success. I ran with the idea of storing the options in a struct, and came up with this:

Code: ags
//Dialog.ash:

struct dialogue {
  String Text;
  bool Enabled;
  String Response;
};

import dialogue dlg[444];


which works pretty well.
444 is not actually the number of maximum options, but rather a matrix of button combinations. The number represents the last option for each column (so 4 in column A, 4 in B and 4 in C). So dlg[130].Text would give me the text for the 3rd button in the submenu for option 1 from the main column. During the game I store this array number in the int index, so at any time I can use that to find out exactly where in the dialogue I am. Still with me?

I wasn't sure how to handle the buttons that are dynamically filled with the character names, since for instance in one room character GIRL could be on button 3 and in another she could be on button 4. So I thought I would make seperate structs that handle only the options relating to specific characters, but when defining multiple structs I got the error "Variable "1" already defined."

Code: ags
import dialogue dlg[444];  //main dialogue
import dialogue GIRL[444];
import dialogue JOHN[444];


Another way I thought could solve this issue would be to somehow make .Response pass the index number to a function that can decide for me which response should be played. But I don't know if it's possible to call a function from a struct, probably not. Right now I just check the index in the rep_ex and define the response there.

Code: ags
    if (index == 100) {  //option 1 column 1
      player.Say("Something.");
      dlg[index].Enabled = false;
    }

#89
mode, you can click on the pictures and it will take you to the source :) And yeah I agree with your points.

Scenery in the distance usually has less contrast and less saturation + a subtle blue hue. Also, as you go deeper underwater, more colors from the spectrum fade away until only blue remains. Red is the first one to go. That's why everything close to the surface stays colorful and way down it is almost desaturated until it becomes too dark to see. But that generally makes things not very interesting to look at, so it's a trade-off ;)

If you put bubbles and stuff into the image, you should either make them animated or leave them out. I think it would break the illusion very quickly if they're just stuck in place.
#90
Take a look at this one for reference. I usually find it easier to use other artwork as reference for these sort of things instead of a real photo, because if you have a little digital painting knowledge it makes it easier to figure out how to draw what you want.



Copper is also great reference for light and color for nature scenes:



And ofcourse there's always this.
#91
Critics' Lounge / Re: Animation Critique
Mon 27/06/2011 22:36:30
I'd say lower his shoulders a tad, it looks like he's got a bad case of neck cramp now. And bend the legs out the furthest at the pelvis and then fold the lower leg back in a little bit in again from the knees down. The lower leg never stretches out much further than the angle of the upper leg.
#92
Thanks for the suggestions so far guys. I'll have a go at it again tomorrow but I'll just offer some clarification here on how the system is supposed to work.

Basically there are four categories you can dive into, like ASK SOMETHING or GIVE ITEM, which then open a submenu to determine who you want to ask/give to - my system is not structured like the default dialogs where you initiate a conversation with a specific person, you can just access these categories at any time and then select who you want to adress, like GIRL, EVERYONE or even YOURSELF. So that is what is in the second column, which is built up by checking which characters are currently in the room with you. Then once you select a person, the 3rd submenu opens where the actual questions are, and these ofcourse differ slightly depending on which person you ask. And in that list I would also like to be able to add or remove options depending on the gamestate, and that's where the master catalog would come in.

So how it works right now is that I have a seperate script called Dialog.asc, which has the SetTxt function in it (aswell as some functions that control the GUI and whatnot), and in there are all the definitions for every possible set of options. So when the player opens the GUI it gets populated from there. Then there is another script called Conversations.asc, which has a rep_ex function in it that first checks if the player selected an option in all 3 columns, and then checks that combination against all the possible combinations to trigger the appropriate response.

So no, I don't use any part of the built-in dialog system at all :) I hope that clears things up a bit more. It's already a pretty complicated system even to me so let me know if you need any further explanation of a particular part.
#93
Hey guys, I wondered if you could help me hash out part of a custom dialog system I'm trying to build.

In the simplest terms, I'm trying to create a sort of dialog options catalog in my code. I have a dialog GUI with a limited number of buttons on it, of which the button text (and matching response) changes depending on different variables. To give you a better idea of the structure, this is how the GUI operates:



There are four main options -or categories-, that each expand into a sub-menu, where each sub-option again expands into a second sub-menu. So you can see the set of options nescessary for each NPC quickly becomes quite complex.

So say I choose to talk to NPC 1. The set of questions I associated with NPC 1 is loaded onto my dialog GUI. If I then move to NPC 2, the options are exchanged for the set of questions I defined for NPC 2.

The problem I have with it now is in the way I have defined those questions. Whenever I load the dialog GUI, it calls ActivateColumn, which in turn calls the function SetTxt, which uses a series of if-statements to see which set of questions to pass to ActivateColumn. For example:

Code: ags
    //SetTxt excerpt:
    if (column1word == "ASK") {
      if (column2word == cGirl.Name) {
        btn[9].txt = "FOR HER NAME.";
        btn[10].txt = "WHAT SHE IS DOING HERE.";
        btn[11].txt = "WHERE SHE IS FROM.";
        btn[12].txt = "FOR DIRECTIONS";
      }


The btn[] variables come from a struct array I created to store the option texts in. The function ActivateColumn then uses those variables after they have been filled by SetTxt to put the appropriate options onto the appropriate button.

But right now the options are more or less set in stone because they are defined within the SetTxt function. So if I disable an option during the conversation, it will be re-enabled the next time I load that particular options set.

So what I'm looking for is a way to create some sort of master list of options. Basically this would be similar to C++ case switching (as far as I understand it), where SetTxt or ActivateColumn would select the appropriate case for a certain situation and retrieve the set of questions from it to feed to the dialog GUI. But since AGS does not support that kind of structure, I'm drawing a blank on how to construct something similar - short of creating a list of Strings for every single option. :-\

Anyone have any suggestions?
#94
Sorry, but... why are you telling us this? To my knowledge you haven't yet displayed any tendency towards creating smut of any kind, so I'm having a little trouble understanding why you decided to tell us this out of the blue. That's like a man walking into a police station shouting "I am totally never going to murder anyone, guys. FYI." I mean.. yeah okay, I guess? Good on ya?

Look, just worry about getting better at AGS and making some actual games first, then worry about any controversy they might stir up ;) You couldn't possibly offend us any more than that wifebeater game did...
#95
Critics' Lounge / Re: Some help please
Mon 20/06/2011 21:09:08
Well I can certainly say it's doing your game good, those latest characters are a tremendous improvement!

I've fallen prey to redrawing things over and over again too, so I don't know how much help I can offer you, but I'd advise you to first complete the scenario for the whole game, and then just build it. Forget about finished graphics, use as much placeholders as it takes to get through the coding. This way you can easily test out if puzzles are fun or not, and maybe change plot beats without having to redraw any backgrounds. Once the game is playable from start to finish you can start filling it up with art.
#96
Somehow I knew I could count on you to have the answer to my problem, thanks Khris :)
#97
Hey guys, I'm stumped on this piece of code here, maybe you can help me troubleshoot.

What I'm trying to do is retrieve a list of all the characters in the current room, so I can stick their names on GUI buttons.
So far I have this:

Code: ags
      int i = Button9.ID;
      int charindex = 0;  //sets starting point for character ID list
      while (i < (Button9.ID + 4)) {
        if (charindex < Game.CharacterCount) {  //if the current index does not exceed the total number of characters
          Character* cha;   //create a dummy character to store the real character
          cha.ID = charindex;   //dummy character becomes real character when given an ID
          if (cha.Room == player.Room) {  //if the character is in the same room as the player
            gDialog.Controls[i].AsButton.Text = cha.Name;   //put character name on button
            i++;
            charindex++;
          }
          else charindex++; //check the next character for the SAME button
        }
        else {
          gDialog.Controls[i].AsButton.Text = "";  //otherwise leave button blank
          i++;
        }
      }


Which should work I think aside from the fact that I cannot manipulate a character's ID.

I used a similar construction to do the same thing with inventory items, except inv items are listed in an index that I can query. I don't think there is something similar for characters, aside from Game.CharacterCount, is there?

And ideas on how I could get this to work?
#98
Despite the grammar I might have an idea what you mean, since I think this might be what happens to me aswell sometimes. Let me get this straight, when you try to draw a curved line it just comes out straight, or you only see a dot at the point where you began drawing the line yes? I get that a lot too if I taskswitch from photoshop to another application. Minimizing and maximizing the photoshop window always fixes it for me, try that next time this happens and see if it helps.
#99
Really nice animation, and the voiceacting is top-notch, great stuff! As a fellow animator I know how painful animating seven whole minutes can be :)
#100
General Discussion / Re: Adult cartoons
Wed 15/06/2011 18:45:21
Yeah Archer is awesome. I love the whole mix of contemporary and 70's style elements. And the fact that Archer is voiced by the same guy that does Ben Katz makes it even better.

I also remember one from a while back called Metalocalypse, following the death metal band Dethklok which enjoys a popularity level unheard of in reality, ranking as the seventh largest economy on Earth. The fictional band members are Nathan Explosion, Skwisgaar Skwigelf, Pickles The Drummer, William Murderface, and Toki Wartooth. Nuff said.

And I hear Harvey Birdman is pretty wacky, retooling existing Hanna Barbera animations into court cases -- including Scooby and Shaggy arrested for possession, Fred Flintstone turned mafia don, Boo Boo accused of terrorism, and Super Friends's Apache Chief suing after spilled coffee on his lap prevents him from, ahem, "growing larger".

It's a darn shame they ever cancelled Kid Notorious, that show was really good.
SMF spam blocked by CleanTalk