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

#1
It's important to pick a concept that interests you. If you set out to make a "small game" that doesn't excite you, it can feel like a chore.

If you're doing this for fun, just pick an idea that you think is fun. If that means a throwback adventure game, fine. Try to come up with a story, and then (this is the hard part) map out the story in Word or Excel. If there are branching plots, map out the branches. Then try to make a rough draft of the dialog. Then assign each scene or plot point to a location and get a sense of how many locations the game has. Then assume that each location will take about a month to implement.

You might find yourself working backward to design a small part of your original idea. Or you might find that your original idea is just the right size. Or (most likely) you'll discover that your idea is way too big a deal try to tackle it anyway.

I doubt anyone finishes the first game they attempt. My first few games had too many characters, too many locations, and (MOST IMPORTANT) weren't planned in advance. To be fair, I learned a lot about scripting and planning from those failed attempts, which is ultimately what I enjoy about this hobby.

However you get started, the first step is just to start. Most of the other steps involve pre planning and the AGS technical forums.

Also, don't attempt anything higher than 320p resolution on the first go round. Unless you are an incredibly experienced and prolific graphic designer, there is no way for a solo developer to make a hi res game.
#2
Hi all -

I'm working on a simple particle system for my game, and I'm curious about the efficiency of bitwise operators in AGS.

In principle I could store the coordinates of several particles in a single int, which could be more efficient (this is also a fun way to learn bitwise operations).

However, some older forum posts say that bitwise operations in AGS aren't faster (or might be a little slower) than standard logic. Does anyone know if this is still the case?

Thanks.
#3
Hi -

Can regular structs contain dynamic arrays?

I'm trying to make an array of integers inside of each room, with the size of the array proportional to the size of the room. I've tried declaring a struct containing a dynamic array int rsize[], but when I try to initialize the struct the game crashes.

In the manual it states explicitly that managed structs can't contain dynamic arrays, but the documentation on regular structs is a little more vague. I see older technical threads saying that dynamic arrays don't work in regular structs, but I just want to be sure that I'm not missing anything in the newer versions of AGS.

Thanks as always.
#4
Yep, that did it.

That was simpler than I expected. I had completely forgotten about late_repeatedly_execute.

Thanks.

#5
Hi all -

I'm working on an effect where characters appear to "wade" through water.

Right now it works by (1) making a DynamicSprite* dyWade from the character's currently displayed ViewFrame*, vwCurrent, (2) drawing a transparent rectangle over the bottom of dyWade, (3) assigning vwCurrent.Graphic = dyWade.Graphic, and (4) restoring vwCurrent.Graphic to its default value when the next animation frame is displayed.

This works well at low res with one issue: there's a "flicker" effect. I assume this is from the default sprite being drawn, and then the modified sprite being drawn an instant later. It's just a little distracting.

Is this something that I can work around (ie, is it possible to modify a character's current ViewFrame before it's drawn onto the screen)?

Here's the relevant code (dyWade, vwCurrent, vwLast, and lastgraphic are arrays declared elsewhere):

Code: ags

void RestoreLastViewFrame(this Character*) {
  //restores the previously displayed ViewFrame for "this" to "lastgraphic," its default sprite
  //must be called after lastgraphic is stored
  
  vwLast[this.ID].Graphic = lastgraphic[this.ID]; 
  vwLast[this.ID] = null; 
}

void MakeWadingSprite(this Character*, int depth) {
  //makes a wading sprite out of "this"'s current viewframe
  //  and stores it to dyWade[this.ID]
  //also saves the default graphic for "this"'s current ViewFrame to lastgraphic[this.ID]
  
  //must have stored vwCurrent[this.ID] before calling
  dyWade[this.ID] = DynamicSprite.CreateFromExistingSprite(vwCurrent[this.ID].Graphic, true); 
  DrawingSurface* dwWade = dyWade[this.ID].GetDrawingSurface(); 
  dwWade.DrawingColor = COLOR_TRANSPARENT; 
  int x1 = 0; 
  int x2 = dyWade[this.ID].Width; 
  int y2 = dyWade[this.ID].Height; 
  int y1 = y2 - depth; 
  dwWade.DrawRectangle(x1, y1, x2, y2); 
  dwWade.Release(); 
  
  lastgraphic[this.ID] = vwCurrent[this.ID].Graphic;   
}

void Wade(this Character*) { //CALLED IN REPEATEDLY_EXECUTE
  
  vwCurrent[this.ID] = this.GetCharacterFrame(); //GetCharacterFrame(this Character*) returns ViewFrame for this.View, this.Loop, this.Sprite
  
  if (vwLast[this.ID] == null) {
    vwLast[this.ID] = vwCurrent[this.ID]; 
    this.MakeWadingSprite(15); 
    vwCurrent[this.ID].Graphic = dyWade[this.ID].Graphic; 
  }
  else if (vwLast[this.ID] != vwCurrent[this.ID]) {
    this.RestoreLastViewFrame(); 
  }
}
#6
Thanks - I knew it was something simple.  The revised code worked:

Code: ags

Particle* pRaindrops[1000];
 
void LoadParticleArrays() {
    pRaindrops = new Particle; 
    int i; 
    while (i < 1000 {
        pRaindrops[i] = new Particle;
        i++; 
    }
}



I haven't adopted for loops yet because I got so accustomed to the old-fashioned way. The do/while and switch/case formats have been a great addition, though.
#7
Hi all -

I'm working with managed structs for the first time, and I'm running into a syntax issue. I've reviewed the manual and some other forum entries but can't figure what I'm doing wrong.

I made a managed struct "Particle" to do some particle effects (floating dust, things like that). I'm having trouble initiating it. Here's the relevant code

Code: ags

Particle* pRaindrops

void LoadParticleArrays() {
    pRaindrops = new Particle[1000]; 
    int i; 
    while (i < 1000 {
        pRaindrops[i] = new Particle;
        i++; 
    }
}

function game_start() {
    LoadParticleArrays(); 
}


When I launch the game I get an error "Type mismatch: Cannot convert 'Particle' to 'Particle,'" which is a little baffling.

What am I doing wrong here?

Thanks.
#8
Hi all -

Short version: If the game crashes, is there a way to view the last series of functions that were called before the crash? I've tried using the AbortGame command, but it just directs to the last function called, not the calling function. 

More detailed: My game has a reference list of "families" that used to live in the post-apocalyptic game world.  I have a command GetName(int f) that returns the name of family "f." This command is called by many other functions, for example to give the player information about the inhabitants of an abandoned house.

Occasionally the game crashes because a calling function passes GetName(-1). Is there a way to see which function called GetName(-1)? It would save me some time.

Thanks.
#9
The specific question was when the dialog ends (ie, passes "exit").

My work around for was to add a bool called indialog. In repeatedly_execute indialog=false, and in dialog_repex (or whatever the custom dialog repeating function is called), indialog=true. It works.
#10
Hi all -

I'm making a custom speech system so that I have more control over the location of the speech GUI. 

Essentially I'd like the player's speech to appear in one part of the screen when they're simply talking and to appear in a different part of the screen when they're in dialog with someone.

It's easy enough to change the location of my speech GUI and launch a dialog in the same command.

However, I'm not sure how to change the location of the speech GUI when the dialog ends.  I'd really prefer not to enter a "ChangeSpeechGUIPosition" command at the end of every dialog.

Is there a game event that's triggered whenever a dialog stops?  Or is there a game variable that becomes true (for example) when a dialog is running?

Thanks
#11
The issue you bring up with not being able to use the dialog system was exactly my concern. Thanks for the suggestion.
#12
Hi all -

When I pass the command player.Say(string message), does "message" get stored in a way that's retrievable? For example, if I wanted another character to repeat whatever the player was saying, could I retrieve "message"  from the engine and then pass it to Parrot.Say(message)?

I know this could be done by declaring the player's dialog in local strings first, but I'm wondering about a more general approach.

Thanks.
#13
If the object doesn't move continuously, you could place its movement inside of a cutscene (or just switch it to eBlock). 

Or you could override keyboard entries in the room with the object:
Code: ags

//room script
function on_key_press(eKeyCode keycode) {
    if (oMoving.Moving) ClaimEvent(); 
}


That should prevent the game from processing any keyboard entries while "oMoving" is moving.  Though it is a little odd that key entries are causing that issue. 
#14
Using Sierra-style speech with an opaque background, I noticed a little quirk: If I use the default text window GUI, the characters' speech is printed to the GUI in their speech color.  If I use a custom text window GUI, their speech is printed in that GUI's "text color."  Is there a way to print speech to a custom text window GUI using a character's speech color (the way it does with the default window)?

Reading the forums I'm pretty sure the answer is "no," but I'm being cautiously optimistic. 
#15
UPDATE - my apologies, after posting I reread the manual entry again, and it answered my question.

PLEASE DISREGARD. 

Hi all -

I've been looking at the manual and forums, but I can't find an answer to this question that makes sense at my (very basic) level. 

I'm writing a function that would generate a list containing multiple items (strings). 

Can I declare a dynamic array and then declare a new size for that array each time the function is called? 

This is what I'm thinking of:
Code: ags

String rstring[]; 

String MakeList(int howmanyitems) {
    rstring = new String[howmanyitems]; 
    String output = ""; 
    char i;  
    while (i<howmanyitems) {
        rstring[i] = ##SELECT FROM A PREEXISTING ARRAY#; 
        output = output.Append(rstring[i]); 
        i++; 
    }
    return output; 
}


I'd like to know if this is going to compile, or if I'm misusing dynamic arrays.

Thanks
#16
AGS Games in Production / Re: The Bestiary
Sat 17/02/2018 19:19:13
Sorry to be US-centric - Labor Day is in September (end of the summer).  Most of the work to be done is graphics-related (including things like regions and hotspots), and carving out the time is its own challenge. 

And the game does feature both combat and game-overs.  At the start of the game you can choose to carry a knife or firearms - carrying a knife makes the creatures less aggressive, but if they attack you have to fight up-close - and they are deadly up-close (of course, you also have to get close to observe them :-D).  Right now the game is stingy with health but generous with auto-saves. 
#17
AGS Games in Production / The Bestiary
Fri 16/02/2018 21:09:38


You are a Student of the Observers, making your first descent into the Fallen World. Your Teacher is with you, but you know your duty: Observe the fallen Creatures and return to the Observers with your field notes. But once you enter the fallen world you duty, your faith, and your life will be in constant peril.

Explore the Fallen World, an open map of streets and homes, an atmosphere of danger and loss. Its denizens have long since departed, but they've left secrets: a history of love and loss that changes with every play-through.

Observe the Creatures - alive or dead. Fortify yourself for brutal combat, or relinquish your weapons - the Creatures will know. Each Creature's description and location is set dynamically; find all of them and fill your notebook with observations of their decline.

Stay alive. Not even your Teacher can protect you in a world of floods, disease, and dark corners. But even if you make it back, the Observers may not like what you have to say.

Features:
- An open map to explore at your own pace, in your own way!
- Hundreds of in-game texts generated dynamically on every play-through!
- Fluid keyboard-and-mouse controls!
- Ultra-high-resolution 320x240 graphics!
- Original chiptune-style score!
- An NPC companion that may actively dislike you!

Progress:
Graphics: 50%
Sound: 40%
Scripting: 75%

These stairs appear to climb, but make no mistake: We are descending.
















This game has been my hobby since around Christmas 2016. It's been my introduction to scripting and low-resolution graphic design, so there's been a steep (but very fun) learning curve. I'm cautiously optimistic that a playable version will be done by Labor Day 2018. (Fingers crossed)
#18
That did it.  Simple, as I expected.

Thanks.
#19
Hi all -

This is a very simple but annoying issue.  I'm trying to remove the default "button" graphics from the buttons on a GUI and replace them with a transparent sprite that has the button's description on it.  Here is the code I'm using:

Code: ags

            DynamicSprite *bfast = DynamicSprite.Create(btnFast.Width, btnFast.Height); 
            DrawingSurface *dfast = bfast.GetDrawingSurface(); 
            dfast.Clear(); 
            dfast.DrawingColor = player.SpeechColor; 
            dfast.DrawString(0, 0, Game.NormalFont, "Fast"); 
            dfast.Release();
            btnFast.NormalGraphic = bfast.Graphic;


That code is repeated for each of the buttons, however it doesn't work.  The button either retains its original default graphic or (if I delete the button text) it is completely invisible (the GUI and buttons are still enabled correctly, just invisible).  This seems like a problem with a simple solution, but I'm not sure why my code isn't working.

Thanks.
SMF spam blocked by CleanTalk