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

#1
Hi... This is a rather stupid but annoying problem I've been having with AGS 2.72....

  As some of you may know you can use the "mousewheel + Ctrl" to zoom the text in the script editor.  Well the fact is that it was somehow set to default to very tiny letters everytime I open it so I have to zoom it everytime and its really annoying. 
  I dont know how to change the default zoom, probably it has to do with a windows setting that I can't guess... The only thing that comes to my mind that could have changed the Zoom is the application I recently installed called Notepad++ that is a nice improvement to the normal notepad and may have changed something somewhere  ???
 
  Any Ideas?

                              Thanks

#2
Hi, Im trying to code a function with enumerated types where i can choose different sets of probabilities for each option.  If I do it for a single probability it works allrigth but if I increase the number it doesnt recognize the other probabilities.  I imagine that the problem involves the way I coded the function because I use the function a number of times in a while for example:

[EDIT1]
THIS IS THE PROBLEM!!!! HERE:
It doesnt seem to recognize the different enums this way (gives me always the 50-50):

function somethingelse () {
while (intsomething > 500) {
                DoStuff(enum1);
                DoStuff(enum2);
                etc...
               
                intsomething++;
   }
}
[EDIT1]

Ive tried to code it directly in the while function,not making separate functions & without enum parameters and it worked but its much more messy...

Any ideas or help will be highly apprecciated... Sorry for the spelling I'm really running against de clock.

Code: ags

// Script header for module 'as'
int TeamCount[10];
int tipo;

struct Mankind {
  int Team;
};

int returno;

Mankind Man[500];

	enum SecondOption {
  primero, 
  segundo, 
  tercero
};

function second (SecondOption param) {
  int RanNo;
  RanNo = Random(99);
  if (param == primero) {
  if(RanNo < 0) returno = 1;                            // Its meant to be ALWAYS 2  (for testing)
  else if(RanNo < 100) returno = 2;
  }
  if (param == segundo) {
  if(RanNo < 50) returno = 1;                          // Its meant to be 1 or 2 50% each  (for testing)

  else if(RanNo < 100) returno = 2;
  }
  if (param == tercero) {
  if(RanNo < 100) returno = 1;                        // Its meant to be ALWAYS 1  (for testing)
  else if(RanNo < 0) returno = 2;
  }
}

function first () {
  int auxiliar,counter;
  //Pone todo en 0
  while (counter < 10) {
		TeamCount[counter] = 0;
		counter++;
		}
		counter = 0;
		
  while (counter < 500) {
    if((tipo > 3) || (tipo < 1)) { tipo = 1;}
    if(tipo == 1) {
		second(primero);
		auxiliar = returno;
		}
		if(tipo == 2) {
		second(segundo);
		auxiliar = returno;
		}
		if(tipo == 3) {
		second(tercero);
		auxiliar = returno;
		}
    TeamCount[auxiliar]++;
    counter++;
    tipo++;
  }

}
//END OF MODULE HEADER

I DID THE FOLLOWING TO CHECK AND IT CHOOSES THE 50 50 VALUES NO MATTER WHAT ENUM I RUN.  IVE TRIED IT WITH OTHER EXAMPLES...
// main global script file
#sectionstart repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute() {
  
  if(IsKeyPressed(32)) {
    first();
    Display("Tipo %d",tipo);
    Display("0 %d, 1 %d, 2 %d, 3 %d, 4 %d, 5 %d", TeamCount[0], TeamCount[1], TeamCount[2], TeamCount[3], TeamCount[4], TeamCount[5]);
  }
}
[CODE]
[/code]
#3
  *Each time I put a textbox in a GUI the following appears "TEXT BOX CONTENTS" crossing all over my Gui makig it difficult to understand when there are other things nearby.   Could you remove that annoying text from the further versions... One knows where the textbox is and if you choose hide borders you can use the highlight option.

NOT ANYMORE A REQUEST (Sorry)   Could you put the limit of the GUIs to 50... please... Im currently over 15 and being pressed by the limit  (ok I admit it has more elements of RPG than of adventure game but still...)

EDIT: MY BAD I confused the Gui control limit of 30 (wich once I had trouble with but I learned my way around label usage) with the GUI limit itself... Sorry about that.
 
                                             Thanks anyway.
                      Alexhans
#4
   Well I tried to make Random Fixture with 20 teams like any common league... There should be 10 matches per Week and 19 total weeks because every team plays only once with each team (I dont care about being local, yet).  I made this script and I have problems with the 15001 loop error.  Its not a matter of noloopcheck, there is a problem with logic.
  If I put less teams, say 4 teams, 2 matches per week, 3 weeks.  There is no problem, but if I increase the number of teams (6,8,10,12, etc) maybe they hang up with the loop problem.  That makes me think there is a problem with the random or with the way I wrote it. 
  Right now I just cant figure it out, Id appreciate any help.

Code: ags

// Script header for module 'soc'
int g, a, b;
String sg;
int aeamnumber = 5;                       // this would be the number of teams in this case 6  
int aatches = 2;                               // Number of matches played per week in this case 3
struct eams {
  String Name;
	int EconSitu;
	int played[20];
  int MediaAttack;
	int MediaDefensa;
	String Manager;
	int FechaMatch;
	String Stadium;
};
	
eams team[20];

int FechaLeague;

struct eague {
  String Match[10];
  int match[10];
  };
  
eague league[20];

function nineteenrandom () {		// I dont use it, but i could and it would be the same

  int f;
  if (f > 19) { 
  f = 0;
	}
f++;
}

function whilee (int teamnumber, int matches) {									// this is where the problems start, in this while that I transformed into an independent function trying to solve them but the problems remain.  THIS IS THE LINE WHERE THE LOOP CROSSES THE 15001.

			while((team[a].played[b] > 0) || (team[b].FechaMatch > FechaLeague) || (a == b)) {							// did they play against each other?,  Has "b" Played this week?, and if "a" equals "b"

				g++;
			//	if(g > 100) { Display("%d", g); }
				b++;
				if (b > teamnumber) { 
				b = 0;
			//	Display("did they play against each other?: %d match %d Week %d", team[b].played[a], team[b].FechaMatch, FechaLeague);
				}
			}
  }

function /*noloopcheck*/ dostuff (int teamnumber, int matches) { // teamnumber 19, matches 9

  a = Random(teamnumber);
  b = Random(teamnumber);
  int c, d = 0;
  int f;
File *output = File.Open("stats.txt", eFileWrite);
  while(FechaLeague < teamnumber) {										// If all matches are played

		while(c <= matches) {															// if last match of the week is played
			while(team[a].FechaMatch > FechaLeague) {	// if "a" played this week
				a = Random(teamnumber);
				}
			}
	whilee (teamnumber, matches);
/*			while((team[a].played[b] > 0) || (team[b].FechaMatch > FechaLeague) || (a == b)) {							// if they played against each other,  if "b" played this week, and if "a" equals "b"
				g++;
			//	if(g > 100) { Display("%d", g); }
				b++;
				if (b > teamnumber) { 
				b = 0;
			//	Display("did they play against each other: %d Fechamatch(match) %d FechaLeague(week) %d", team[b].played[a], team[b].FechaMatch, FechaLeague);
				}
			}*/
			team[a].played[b]++;											// writes that they play against each other
			team[b].played[a]++;											// ditto									
			team[a].FechaMatch++;											// writes that it played this week 
			team[b].FechaMatch++;											// ditto
		//	Display("Fecha(week) %d Partido(match) %d %s Vs %s", d, c, team[a].Name, team[b].Name);
			

//output.WriteInt(a);
//output.WriteInt(b);
output.WriteString(team[a].Name);
output.WriteString(" Vs ");
output.WriteRawLine(team[b].Name);


		
			league[d].match[c] = 1;
			//league[d].Match[c] = "a Vs b";			
			c++;
		}
		output.WriteRawLine("Fecha");
		d++;																			// new week
		FechaLeague = d;													// ditto
		c = 0;																		// Match 0
	}
output.Close();
}      
		
		
	
      

// Script header for module 'list'
/*struct eams {
  String Name;
	int EconSitu;
	int played[19];
  int MediaAttack;
	int MediaDefensa;
	String Manager;
	int FechaMatch;
	String Stadium;
};*/

function maketeams () {				// In case you wonder this are Argentinian games (Best League of the world!!) ;)				
team[0].Name = "Argentinos";
team[1].Name = "Arsenal";
team[2].Name = "Banfield";
team[3].Name = "Belgrano";
team[4].Name = "Boca";
team[5].Name = "Colon";
team[6].Name = "Estudiantes";
team[7].Name = "Gimnasia de Jujuy";
team[8].Name = "Gimnasia de la Plata";
team[9].Name = "Godoy Cruz";
team[10].Name = "Independiente";
team[11].Name = "Lanus";
team[12].Name = "Newells";
team[13].Name = "Nueva Chicago";
team[14].Name = "Quilmes";
team[15].Name = "Racing";
team[16].Name = "River";
team[17].Name = "Rosario Central";
team[18].Name = "San Lorenzo";
team[19].Name = "Velez";

}


$$$!$$$ MS 1 -320440618
// Main script for module 'list'


  


  I hope its not to hard to understand, I believe the problem relays in some logic error in the while I Extruded as an independent function.
             
                                   
                                                 Alexhans

mmmmm... is someone there?... hellooo...
#5
Hi, some days ago I started making a very tiny test game to see if I could achieve a couple of things and I tried to make a random name generator but couldnt do anything about it without scrypting Thousands of lines (wich I didnt, of course).  The generator should get a Name and a Surname from a two lists and put them together in a string that will remain like that for the rest of the game.

I'd appreciate any help or ideas you could give me.  Thank you very much.

By the way, im working with AGS 2.71
#6
Testing with AGS Ive found myself in a strange situation, I wanted to implement the possibility of having two text boxes enabled and the option to write in one of them but always wrote in both.

Is it possible in any way to could click in the one you wish to write leaving the other still visible...?  and then normally ending the first one you would be able to choose the second one and write over it having the two text boxes displayed?

Or... I thought about other possibilities but they seem far too complicated. (Yes! even more)

Ill tell you how this came in to my mind:

I wanted to make a World Cup Fixture with the possibility to enter your own scores as to guess its possible outcomes (Im experimenting in order to undestand more capabilities of AGS) and I discovered you cannot use textboxes like in Microsoft's Excel (With wich, by the way, I made a fixture with its functions).  I could make the player write one result in one GUI, hide it, pop up the other, make the player write the second score, and then display a third GUI with labels but It would be endless scripting (there are more than 80 matches) boring and linear.

So... you guys that are old (in AGS usage of course) to know better, tell me what do you think (even if its for curiosity`s sake)   ::)

Alexhans

#7
Hi! I don`t know if this has been posted earlier but I haven`t found it in the forums.  I would like to know how to animate a character, or change a globalin, or bring up a GUI if there player says  a specific line in a dialog.
My dilemma starts when I notice that the dialog script is in a different script than the one I will use for the functions

Thanks

Alexhans

Im currently practicing scripting with a multiple choice and variables game but these could prove usefull.


#8
Excuse me if it is a silly question but Ive been trying to run a certain function after a dialog and I havent succeded.  I go to the dialog script editor and write what they say for example:

ROBIN: "Can you shoot me?"
GRANPA: "Yes I can"

And I want to have Grandpa animated (with the animation I already created and looks good) and shoot his grandson.  I dont know how to link the dialog script to the room script.  If someone can tell me the way to do it I will be forever thankfull

Alexhans
SMF spam blocked by CleanTalk