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

#641
I need help again ;)

Each location in my game can have four exits... north east south and west.

Code: ags

loc[1].nor = 2;
loc[2].sou = 1;
loc[3].eas = 4;
loc[4].wes = 3;


In this fashion they are all interlinked.

Now, say I want to generate a physical map of the location network. I need some kind of formula to position components on a drawing surface. The result would look something like this:



As an aside, the generated map doesn't need long line connectors, only short ones like between the green star and tavern. Here's what I've come up with so far, but it's not ideal:

Code: ags

//Map Components
   //Squares
         //'you are here' square - 12x12, slot 10
         //plain square - 12x12, slot 7
         //tavern square...
         //stable square... 
   //Connectors
         //1 vertical line - 4x6, slot 8
         //1 horizontal line - 6x4, slot 9



DynamicSprite *sprite;
DrawingSurface *surface;

function GenerateMap()
{
      sprite = DynamicSprite.CreateFromExistingSprite(Map.Graphic);    //Map.Graphic is 162x112, and invisible
      surface = sprite.GetDrawingSurface(); surface.Clear();

      int x = (Map.Width/2)-6,    //find the centre point and -6, because 1 square is 12x12 so it must span the centre
          y = (Map.Height/2)-6;

      surface.DrawImage(x, y, 10);  //mob[0] is the player. draw their location.

            if (loc[mob[0].loc].nor != 0) {    //ie, there is an exit to the north
                  surface.DrawImage(x, y-18, 7); //draw a plain square
                  surface.DrawImage(x+4, y-6, 9); //draw a line connecting the two
            }

            if (loc[mob[0].loc].eas != 0) {   
                  surface.DrawImage(x+18, y, 7);
                  surface.DrawImage(x+12, y+4, 8);
            }

            if (loc[mob[0].loc].sou != 0) {  
                  surface.DrawImage(x, y+18, 7);
                  surface.DrawImage(x+4, y+12, 9);
            }

            if (loc[mob[0].loc].wes != 0) {  
                  surface.DrawImage(x-18, y, 7);
                  surface.DrawImage(x-6, y+4, 8);
            }

   surface.Release();
   Map.NormalGraphic = sprite.Graphic;
}


As I say, it's pretty useless because it only draws the direct satellite locations of the current location. What I need to do is get the satellite locations of the satellite locations of the satellite locations... etc. In this way I create a map of the network, with the current location in the centre.

I would need some kind of concatanating sequence:

Code: ags

if (loc[mob[0].loc].nor != 0) //draw
if (loc[loc[mob[0].loc].nor].nor != 0) //draw
if (loc[loc[loc[mob[0].loc].nor].nor].nor != 0) //draw


But this would be ridiculous, especially as there are 100s of locations. Any ideas for alternatives? :/
#642
Ah ok, I'll try those. Thanks :)
#643
Hi, I'm rewriting the way my text game works, so all the data is catalogued in scripts rather than defined in individual rooms. I already know something like the following is possible:

Code: ags

quest[1].log[4] = "You spoke to Lord Woodfoot, who made it clear the gnomes will come to feast at Meyrnost if their vegan lifestyle is catered for.";


Each location can have items in it, so I would like to take the above a step further by doing something like the following:

Code: ags

loc[2].name = "Meyrnost Athenium";

loc[2].item[1].name = "Borromdock";
loc[2].item[1].desc = "A sweet smelling plant.";
loc[2].item[1].pickup = true;


Is this possible? I want to have the room items in a sub-class of the location (loc) class.
#644
The Rumpus Room / Re: The MSPaint game
Tue 18/10/2011 22:40:03
Lol ProgZ :D Incidentally 1000th post apparently, am I an oldie now?
#645
Armageddon, will you save us?!
#646
Half way! My future self told me that this month will not be a disaster.
#647
Yep, I noticed my mistake last night but my internet went down just before I went to post >:( (thanks Tabata for pointing it out) I'm really sorry Anian!

A vote shall be held!
#648
Ponch is the winner by default :) I'm upset there wasn't more interest :-[

Here's a trophy I made for the Chain Story a while ago.



New round! Go!
#649
I don't understand what's happening.
#650
FFFFFFFFFFUUUUUUUUUU-
#651
Quote from: Ponch on Sun 09/10/2011 02:02:37
(And I'm sure that any members of this Secret Society will NOT give away any details regarding their incredibly exciting and sexy plans either in forum posts or PMs to anyone not in the inner circle, such is their dedication to the AGS Secret Society, if it even exists (which I'm certain it does not)).

Here we go Ponch. You forgot to close the first parenthesis and it made my skin crawl. I'll probably become an insomniac and need counseling for the rest of my life. No worries though.
#652
General Discussion / Re: Merlin!
Sun 09/10/2011 16:05:33
It also puzzles me why the second from left is wearing a pauldron. They were not worn or even invented until the Late Middle Ages. Hundreds of years after the [supposed] lifetime of King Arthur.
#653
General Discussion / Re: Merlin!
Sun 09/10/2011 12:35:32
I never knew they had hair gel and renaissance castles in the 6th century.
#654
Quote from: Ponch on Fri 30/09/2011 21:37:06
Was it the Illuminati?

You sure you want me to answer that? ;) I could go on for hours, it's always the Illuminati! Is CJ a Freemason? If so it will tie in nicely with my conspiracy theory.
#655
The Rumpus Room / Re: Happy Birthday Thread!
Fri 07/10/2011 15:56:12
Happy Birthday Peder
#656
General Discussion / Re: Steve Jobs
Fri 07/10/2011 15:48:45
Quote from: Zoot on Fri 07/10/2011 13:47:45
this thread isn't the right place to air views on the shortcomings on the recently deceased

I think it's the perfect place. I didn't really intend it to be a mourn thread because I don't feel sad at all. I didn't even know him. Other people can post their commiserations if they wish and that's fine. But I did know the positive things he did which improved (?) many people's lives in the world. If he wasn't influential, for good or worse, this thread wouldn't be here in the first place; it speaks for itself.

About China, here's a photo of the Apple Store in Beijing.



Obviously not representative of the sweat shops, and the rest of the 1 billion population which probably made your keyboard, mouse, the chair you might be sitting on, your clothes, and so on and so on and so on. It just illustrates he didn't exclusively have influence on the Western world. In any case the people employed by Apple were probably a damn sight better off than making plastic dog poop for some novelty toy company. I couldn't find a suitable graph to demonstrate the inequality of wealth distribution in China... let's just say that some have extreme wealth and won't share it with people on their own doorstep. Regrettably Jobs wasn't as philanthropic as competitor Gates.
#657
General Discussion / Steve Jobs
Thu 06/10/2011 18:06:49
No thread about him? If anybody influenced the 21st century the most, Steve Jobs is among them. Things would be very different without the products he helped to design and create.
#658
Woop. Any more entries?

I'll attempt number 2 or 4 if I find the time ::)
#659
Enthusiasm is good but quite bluntly you do not and have no way of acquiring in the average lifespan of a giant sequoia tree the expertise needed.

I remember acquiring the source code a while ago and taking a look myself but then it was unavailable again. Was that a dream or did it actually happen? I thought the source code was now only available to a panel or something who are collaboratively improving the engine under CJ's guidance.

Changing the nature of AGS into some form of hybrid (Role Playing and Adventure Game Studio) would be cataclysmic, for the community and program; I think it would be nice to modify AGS for your own personal use, but from the gist of your post I think you intend to make such aspirant modifications into some kind version you would distribute? In which case you would have to ask questions to the people on the source code panel.
#660
Competitions & Activities / Re: Delete me!
Sat 01/10/2011 20:32:43
It's ok :) And incidentally this is a good opportunity. Is everybody ok with an OSD theme for November? Speak now or forever hold your peace. (I want it to be accessible for everybody, OSD is quite.. esoteric at times).
SMF spam blocked by CleanTalk