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

#21
Hey all,

In the little time I have to play around with this, I'm still stuck creating my struct, :( Here's the info.

Global Script
Code: ags
// main global script file

Char_Mind charminds[2]; // here I want to create an array called charminds using the Char_Mind struct


Global Script - function
Code: ags
#sectionstart create_struct
function create_struct()
{
  charminds[cSeller.ID].calmness = -3;
	charminds[cSeller.ID].IQ = 90;
	charminds[cSeller.ID].prejudice = 75;
	charminds[cSeller.ID].name = "SellerDude";
}
#sectionend create_struct

I did the above because some searching on these forums someone said they needed to create the definition in a function. At this point I'm just stabbing in the dark, doing trial and error without any understanding why, hoping I discover what works.

Header Script
Code: ags
// Main header script - this will be included into every script in
// the game (local and global). Do not place functions here; rather,
// place import definitions and #define names here to be used by all
// scripts.
import function create_struct ();

struct Char_Mind
{
  int calmness;
  int IQ;
  int prejudice;
  String name;
};


Room Script
Code: ags
#sectionstart hotspot4_a  // DO NOT EDIT OR REMOVE THIS LINE
function hotspot4_a()
{  
	// script for Hotspot 4 (Hotspot 4): Look at hotspot
  create_struct();
	trust[cSeller.ID] = -6;
	Display("Trust for Seller is %d", trust[cSeller.ID]);	
	Display("Calmness for Seller is %d", charminds[cSeller.ID].calmness);
}
#sectionend hotspot4_a  // DO NOT EDIT OR REMOVE THIS LINE


When I save my work, I get the following error:
Code: ags

The problem was In 'Room 1 script'
Error (line 205): undefined symbol 'charminds'


Which leads to this
Code: ags

Display("Calmness for Seller is %d", charminds[cSeller.ID].calmness);


I'm sure I have code in the wrong place, but don't know where. Thanks in advance for any help.
#22
Thank you both Ashen and KhrisMUC. I had read the manual, but didn't understand what it meant by, "with its parameter being the dialog topic number that the player was in." Thanks your replies, now I see that dialog topics do have an ID number in the left side listing of topics. It all makes sense now. Thanks! I'm looking forward to trying this when I get home tonight.

-Reid
#23
Hi all,

As you can hopefully see below, I'm trying to create dialog options (which works great) and have the fourth one be a txtBox for users to give their own responses. It's unclear how I can run a script on that one dialog box though. I really suck at making GUIs so far, so I'd rather not have to create a new one from scratch. I realize in the AGS editor, the 4th option (blank) doesn't relate to the txt parser box.

Thanks,

-Reid



http://game.rbkdesign.com/ags/dialog_txtparser_help.jpg
#24
Hi all,

I started using AGS about a week ago and I'm loving it so far. My current plans are to create a test case where doing different actions will dynamically change a character's behavior. To do this I created a struct called char_mind in the global script like so:

struct char_mind
{
  int calmness;
  int IQ;
  int prejudice;
  String name;
};

char_mind guard01
guard01.calmness = 10;
guard01.IQ = 110;
guard01.prejudice = 10;
guard01.name = "Rob";

Then, in my interaction scripts, when the player interacts with a character, I want to modify the values of the variables defined from the struct and then based on the changed value the character will say different things, etc. I'm having trouble being able to do this though and I'm not sure if I'm placing my code in the right sections. Anyone have ideas? Thanks.
SMF spam blocked by CleanTalk