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

Topics - Matti

#41
I know how to save text to an extern .txt file and I know how to save ints but is it possible to save ints as a written text? I want to know how the NPCs in my RPG develop throughout the game and it would be very handy if I could just look at a saved textfile after playing to see the character values written down.

WriteRawLine(string text) doesn't let you include variables and WriteInt can't be used with a textfile, so is there any other way?
#42
I'm working on a game with a map and 4 players on it. This is my scipt for the AI movement. There are creatures and two cities on the map (like in "Moonstone" if you know that cool Amiga game).

Each turn the AIs decide between aiming at a nearby creature or knight(player) or going to one of the cities. If they don't have enough gold and there's no nearby creature to attack they're supposed to aim at random coordinates on the map. Well and everything worked fine until I introduced the "sillywalk"-bool variable. The variable should tell the AI to look out for anything interesting while senselessly walking to those random coordinates.

But since I use that variable the AIs just stop and go and bustle around when nothing interesting is nearby instead of walking straight to their aim. I can't figure out what's wrong.

For clarification: "zielx" and "ziely" are the coordinates the AIs are supposed to walk to. "spieler" is the actual player/AI.

Code: ags

  if (movement>0){  
  
    int a=Random(100);
    // AI aims at a nearby creature with 50% possibility
    i=0;
    while (i<6){
      if ((object[i].Visible)&&(a<50)&&(sillywalk[spieler])){  
        if((object[i].X>character[spieler].x-180)&&(object[i].X<character[spieler].x+180)&&(object[i].Y>character[spieler].y-180)&&(object[i].Y<character[spieler].y+180)){
          sillywalk[spieler]=false;
          zielx[spieler]=object[i].X+3;
          ziely[spieler]=object[i].Y-3;
        }
      }
    i++;
    }
    // AI aims at a nearby knight with 30% possibility
    i=0;
    while(i<4){
      if ((a>49)&&(a<80)&&(sillywalk[spieler])){  
        if((character[i].x>character[spieler].x-100)&&(character[i].x<character[spieler].x+100)&&(character[i].y>character[spieler].y-100)&&(character[i].y<character[spieler].y+100)){
          sillywalk[spieler]=false;
          zielx[spieler]=character[i].x+2;
          ziely[spieler]=character[i].y-2;
       }
      }
    i++;
    }
    // AI aims at one of the cities with 20% possibility and some gold
    if ((a>79)&&(Gold[spieler]>=(40+Stufe[spieler]*3))&&(sillywalk[spieler])){
        if(character[spieler].y<300){
          sillywalk[spieler]=false;
          zielx[spieler]=object[6].X+15;
          ziely[spieler]=object[6].Y-15;
        }
        if(character[spieler].y>=300){
          sillywalk[spieler]=false;
          zielx[spieler]=object[7].X+15;
          ziely[spieler]=object[7].Y-15;
        }
    } 
  
    // AI aims at random coodinates on the map
    // but a new aim is possible
    
    if((zielx[spieler]==character[spieler].x)&&(ziely[spieler]==character[spieler].y)) {
      if (character[spieler].x<400){zielx[spieler]=500+Random(250);}
      if (character[spieler].x>=400){zielx[spieler]=50+Random(250);}
      if (character[spieler].y<300){ziely[spieler]=400+Random(150);}
      if (character[spieler].y>=300){ziely[spieler]=50+Random(150);}
      sillywalk[spieler]=true;
    }
   
  }


Again: What's up with the letter "r" when used with code-tags? A single "r" is written as "are" and a line saying "r"=random(bla) isn't shown at all. I again had to change it to "a".


EDIT:

Sorry for possible confusion. Although it seemed so the problem had nothing to do with the sillywalk variable. The problem was that the knights also tried to attack themselves and always moved some pixels to do so. I should have included && (spieler!=i) in the if clause. What an annoying mistake that was  :P.
#43
I really don't know what's going on here. I just want a character to go to certain coordinates, represented by variables.

When I write something like this (in the room's rep ex), nothing happens:

Code: ags

gx=100;gy=450;
character[1].Walk(gx,gy);


Strangely enough this doesn't work either:

Code: ags

character[1].Walk(100,450);


When I use a randomizer, it works fine (without variables):

Code: ags

a=Random(10);
if (a==5) {character[1].Walk(100,450);


What the heck is going on here? Any idea what could cause a problem?


And another thing: First I used "r" instead of"a" as the variable in this post. The result was (in the preview) that the random line wasn't shown at all and the "r" in the next line was written "are". I needed to put the "r"s here in quotation marks..
#44
I want my character to look either left or right, but not up and down. If he walks up or down he's supposed to subsequently face the direction he faced before walking. So loop 0 and 3 are only for walking, not for standing.

I really don't know how to solve that problem but it's perhaps because I'm not really concentrated right now.

If it matters: I use the keyboardmovement-module (that comes with AGS) and disabled the cursor.
#45
It seems that gobal ints can't be arrays. Is that true? That would be a pity.
#46
Sorry, perhaps I'm just too tired... but:

I want to check if the mouse is over a certain GUI-Button (cause then a label with a description should appear). I only found solutions for either other locations (hotspots, regions etc.) or for GUI-buttons when a mousebutton is pressed but that's not the case.

I guess GetAtScreenXY could help but I admit that I don't quite understand that command.

So any help is appreciated.
#47
General Discussion / The Yesmen striked again
Thu 13/11/2008 08:26:21
Haha, I love the Yesmen. Did you hear of their newest prank, the fake New York Times issue?

http://urbanprankster.com/2008/11/massive-fake-ny-times-prank/

http://www.nytimes-se.com/
#48
General Discussion / Who is this?
Sun 26/10/2008 02:25:40
This is a drawing I made in 2006 but I just don't know who the woman is. Does anybody has an idea?

#49
This is the first background I made for my new project. It's a dark forest-swamp-jungle-mix, only lightened by lanters.

I used a simple drawing style with few colors in order to create backgrounds relatively fast. My main concern is to create an eerie mood, making it very dark and using strange forms for plants and trees. I think it worked well and that it's a good compromise between simplicity and a richness of details.

I would like to know what you think of it. Be sure that no light is shining on your screen when looking at the images. And your contrast/brightness should be adjusted in a way that your black is a pure black.

The second image shows a sprite of a beetle I want to include. The rider obviously isn't finished yet, but the beetle is. Does it fit the style of the background? I'm asking because the sprite is more detailed than the BG. Note: I included the sprite in Illustrator, not in AGS, since I haven't started the game yet.



#50
General Discussion / The FOX Network
Fri 24/10/2008 16:19:25
Damn, did anybody watch "Outfoxed - Rupert Murdoch's War On Journalism"?

After watching the movie I understand why Bush was elected a second time. The aggressive right-wing propaganda of the network is so obvious, stupid and extrem I can't believe it. And since it reaches about 96 % of the USA (=102 million households) I guess it has an enormous impact on society.

Doesn't turning on FOX immediately leave you with a serious braindamage? I know, TV is stupid everywhere but this is the ultimate exaggeration...
#51
I am planning to make a game where you are a pirate, have your ship and go plunder other ships, trade in cities etc. It should be turnebased and every turn the player can move the ship from one area to another (I don't think they can be called tiles).

I could program that with Turbo Pascal (I'm not familiar with any other language), but there are several reasons why I'd prefer doing it with AGS. So my questions are:

1. Is it possible / Is AGS capable of such idea?
2. Would it be very difficult?
3. What would be the best way?

I have two major problems:

1. I don't know what the best way to move the ship is. I could create hotspots for every "area" and a certain place where the ship is placed. I could number all the areas to check where the ship can move to. Another thing (2nd screenshot) would be to make the areas rectangular and always place the ship in the middle. Then perhaps a keyboard control would be adequate. But then again there would be land areas where the ship isn't supposed to be.

2. I don't have the slightest idea how to make some sort of an algorithm to let the player choose between several maps without having to script the same things for every map.

Here are the screenshots. They're very rough sketches, so don't mind the look.






Any ideas? Tell me if AGS isn't the right choice to do something like that. And tell me too if this would be too circuitous and difficult to script.
#52
Finally, here's the third competition I had to start:

Rules:
A sprite is supplied, with a theme.
Participants must use the given sprite for their animation
Each competition will last 11 days
The starter of each competition will decide on the winner.
The winner, who will decide on the next competition's theme, must also supply a sprite.

Theme: Jump'n'run

A little jump'n'run scene is to be animated. The little stickman wants to get to the exit. It's up to you if he reaches his goal or not. Be creative, let the guy interact with his environment (pull the rope, throw the ball, move blocks etc.). I tried to make everything as easy as possible so it won't be too hard to animate. You can add things during the animation but the first frame has to be the original one.




Regarding the few entries of the latest competitions I think it would be better to give you more than 11 days, but these were the rules and I don't think I'm supposed to change them..
#53
Okay, it was my task to start a new one so here it is:

Make a sprite that fits the style of this Max Ernst picture.


- It should be some kind of creature/animal (snail, scorpion, dragon, zombie etc.)

EDIT: I decided that a person would be okay too. Just keep the style in mind

- Max. 16 colors (+ transparency color), that should cover the green, orange and black tones

- Try to keep the colors similar to those in the picture

- Max. size is 300 x 300


I hope I get some entries here...

#54
Sorry for letting you wait so long. Here it is.

Do whatever you want with it, it doesn't have to be a Totem.

- You can resize and rotate it
- You can draw both outside and inside the outline.
- No color limit
- You can even slightly change the outline but keep it recognizable.





3rd:2nd:1st:
#55
Is there a way to set a space between inventory items?

I searched around and the only solution I could find is to increase the itemsize, which I'm already doing. But I don't want the items to be clickable when the cursor is actually between them. The main problem is that the last item on the right side is clickable when the cursor isn't over the inventory anymore but a bit on the right of it.

Or is there a way to let the items just be clickable when the cusor is over the sprite and not within the itemwidth and -heights? That would be okay too.
#56
It's just a working title. I don't know yet how I'm going to name the game.

You have three days to get enough money to pay a train-ticket and spend your vacations in some other country.

Some things I should mention:

When I first came in touch with the editor in late 2006 I just started off and drawed a bar and some people in it. Then I let it down for a year and started again last december. I didn't have a plot, just some pictures and characters. I wanted to use them and I used the idea of the player character going to get money just to have an easy plot where my already drawed stuff could fit in. So the plot is in fact a bit "thin" (as SSH stated in his blog). All I'm doing is adding some (hopefully) entertaining actions, dialogs and locations to that plot. It's all somehow an experiment, but I think the outcome will be something that is worth to be played.

As for the drug trips: I didn't include them because I'm a junky or something. The reason was more of an artistic nature. I wanted to add some psychedelic stuff that wouldn't fit the usual everyday- setting I use for the game, so I thought: Why not let the player have hallocinogene drugs? The problem is that I'd also like to make a sci-fi game or a surrealistic game but I don't know if this will ever happen, so I'm always willing to put elements of other ideas in this game which is not going to work.

I don't think I'll add a second chapter like I originally planned. Instead I'll add some stuff to the town to make it more interesting.

I try to get this game done this year as I'm considering making another game.

-----------------------------

As for now the game features... a thief, a dealer, cops, a demonstration, psychedelic drug trips, lots of dialogs, plotchanging according to the player's decisions.. and some animals..

Technical aspects:
- Large animated sprites (like a car and a train wagon)
- 800x600 32-bit resolution (yeah, it's a bit slow)
- 30 MB filesize so far (not zipped)

-----------------------------

NEWS

June 29.:

Good news, everyone. I fixed my .NET Framwork problem and can finally work with the editor again. I still have to do a lot of studying for the exams next month but I'll do some scripting and characterart in the meanwhile.

-----------------------------

PROGRESS

Plot/Puzzles: 80%
Backgrounds: 40% (6 Rooms finished, 7 in progress, ~3 left)
Character(-animation): 25%
Scripting: 10%
Music / Sound: 40%

-----------------------------

OK, here are some first impressions.

The screenshots are taken from a 2000 px long bar, that could be called the center of the town, basically due to its size and the number of persons in it.

First screenshot: Updated characters and Inventory, July 7.




#57
I can't open the editor anymore. When trying an error occures: "AGS Editor for Windows has a problem and must be closed" (translated from german). Typical windows error without any information..

The only thing I did just before the error occured was copying the compiled-folder to a mobile harddisc. But there should be no problem with that, right?

Any idea?
#58
Is there a possibility to make rooms be either shown in daylight or at night, without using two different rooms? The background animation doesn't help. Or is it possible to turn on/off the backgroundanimation (wherein is a darker room) and set the delay somehow to infinite?

If this was discussed earlier I'm sorry, but I found it nowhere..
#59
Immediately after a dialog between the main character and another person I want that person to have a short dialog with another one. In the dialog editor I used the start-script function to set a certain variable to true. Then, in the room script's repeatedly execute section I scripted the dialog (with several say.background commands) if the variable is set true.

Problem is: Both characters just say their last phrases.

If I put a wait command between the phrases, it says there's a blocking command within the repeatedly execute section. But I don't want that anyway cause the main character should be free to do whatever one wants while this dialog appears in the background. What do I have to do to let all sentences appear one after another. And is there a better way than putting the dialog into the rep.-exec.-section? cause it should just happen once, so there's no need to check it all the time.



EDIT: I solved it now in a complicated way. Just set a timer and scripted like this:

Code: ags

  if (lucyannatalk==true){
    lucyannatimer=lucyannatimer+1;

    if (lucyannatimer==50) cLucy.SayBackground("");
    if (lucyannatimer==150) cAnna.SayBackground("");
    if (lucyannatimer==200) cLucy.SayBackground("");    
    ..
    ..
    ..
    if (lucyannatimer==800) lucyannatalk=false;
  }


I had to try a bit around to get the timing of the phrases right. How can I script, that the phrases just come one after another in normal timing. Has the overlay-function to do with that?
#60
Below is my inventory-script. It allows to cycle through the different cursor-modes in the inventory, if the cursor is located over an inventory item. Strange problem is, it doesn't work if the cursor's x-coordinate is below circa 120 (60 in the editor). I don't know if it has anything to do with the script, but I thought I'd better post it...

Perhaps someone has an idea what the problem could be about.


Code: ags

#sectionstart on_mouse_click  // DO NOT EDIT OR REMOVE THIS LINE
function on_mouse_click(MouseButton button) {
  // called when a mouse button is clicked. button is either LEFT or RIGHT
  if (IsGamePaused() == 1) {
    // Game is paused, so do nothing (ie. don't allow mouse click)
}

  if (button == eMouseLeftInv) { // left click on inventory item

    if (mouse.Mode == eModeInteract) { // select inventory item on eModeInteract:
        player.ActiveInventory = inventory[ game.inv_activated ];

    }

    else { // if your cursor isn't in interact mode, it will run the action wanted by the cursor selected
         inventory[ game.inv_activated ].RunInteraction( mouse.Mode );
    }

}

  else if (button == eMouseLeft) {
    ProcessClick(mouse.x, mouse.y, mouse.Mode );
  }
  else {   // right-click, so cycle cursor
  
  character[EGO].ActiveInventory = null;

    mouse.SelectNextMode();
  }

}

SMF spam blocked by CleanTalk