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

#1
Nice.  Best of luck with the project.
#2
I'd be interested in making a spanish tranlation if no one is working on one (and I'd advertise the game on some spanish forums) or proof reading it if it's already in progress.  

PM me if interested.

EDIT: nvm,  I visited the webpage and there seems to be a spanish translation already.
#3
Can´t you make some standard GUIs???

One thing I did in a test game was have a function to completely change a the appearence of a GUI, changing buttons color,text, position, disabling views of sliders, etc.

You may Optimize it a bit if you are Tidy...
#4
I'm not sure if it is possible, and not quite sure if it has been already implemented in the last versions i havent tried... but is there a possibility to make Strings importable from the headers without using GlobalStrings?  Like functions and ints....

Thanks.

EDIT:  Oh... Sorry... I figured out I way arouund it... He, the "new"style strings from 2.7 on  are really cool.
#5
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

#6
Thanks for the Fading GUIs, I couldnt find a way to do that. 
#7
Critics' Lounge / Re: Song C+C?
Sat 24/05/2008 14:36:26
 I liked your song, sometimes Its hard to understand the Lyrics because it is too merged with the music.  But Its really good.
(note that I'm not fit for a real critic, lack of Knowledge ;)



[Edit: A couple of minutes later]:  The more I hear it the more i like it.
#8
I Finally found out my problem thanks to your ideas & help, The problem was the way I counted the stuff all together and it is solved by using different counters for each Probability set (this can be done as a struct).

                                 Thank you all for your help     :D

                                                                Alexhans
Code: ags

// Script header for module 'as'
int CountFirst[10];
int CountSecond[10];
int CountThird[10];

struct Mankind {
  int Team;
};

int returno;

Mankind Man[500];

	enum FirstOption {
  primero, 
  segundo, 
  tercero
};

function first (FirstOption tipos) {
  int auxiliar,counter;
  int RanNo;
  RanNo = Random(99);
  if(tipos == primero) {
    if(RanNo < 0) returno = 1;
    else if(RanNo < 100) returno = 2;
  }
  if(tipos == segundo) {
    if(RanNo < 100) returno = 1;
    else if(RanNo < 100) returno = 2;
  }
  if(tipos == tercero) {
    if(RanNo < 50) returno = 1;
    else if(RanNo < 100) returno = 2;
  }
  auxiliar = returno;
  if(tipos == 1) {CountFirst[auxiliar]++; }
	if(tipos == 2) {CountSecond[auxiliar]++; }
	if(tipos == 3) {CountThird[auxiliar]++; }
}

function RAPIDO () {
  int auxiliar,counter;
  //Makes all cero
  while (counter < 10) {
    CountFirst[counter] = 0;
    CountSecond[counter] = 0;
    CountThird[counter] = 0;
    counter++;
  }
  counter = 0;
  while (counter < 500) {
    first(1);
    first(2);
    first(3);
    counter++;
  }
}

// IN GLOBLAL SCRIPT
if(IsKeyPressed(32)) {
    RAPIDO();
    Display("First  0 %d, 1 %d, 2 %d, 3 %d, 4 %d, 5 %d", CountFirst[0], CountFirst[1], CountFirst[2], CountFirst[3], CountFirst[4], CountFirst[5]);
    Display("Second 0 %d, 1 %d, 2 %d, 3 %d, 4 %d, 5 %d", CountSecond[0], CountSecond[1], CountSecond[2], CountSecond[3], CountSecond[4], CountSecond[5]);
    Display("Third  0 %d, 1 %d, 2 %d, 3 %d, 4 %d, 5 %d", CountThird[0], CountThird[1], CountThird[2], CountThird[3], CountThird[4], CountThird[5]);
  }

Quoteif (RanNo < 20) return wFat;
QuoteMan[counter].Weight = GetStat(pWeight);
Ashen... Im seeing your solution right now and I think it works... but as it is if
RanNo < 20: Man[counter].Weight = wFat, can a variable like the weight that must be an int take that kind of value? What do you do with it?

                               Thanks anyway
#9
mmmm I kinda get the point now  :-\

imagine this

Weight
20 % fat
50 % normal
30 % skinny

Height
20 % tall
40 % normal
40 % short

Skin
34 % caucasian
33% black
33 % asian

now you have a function with a while (and lots of extra stuff)

function Create () {
    while (counter < 40) {
    character.Weight = SPecialfunction(Weight);   // returning the value that belongs
    character.Height = SPecialfunction(height);        // returning the value that belongs   
    character.Skin = SPecialfunction(skin);             // returning the value that belongs      
    counter++;
}
}


How can I achieve this? bear in mind there are more than 3 options...
#10
Ive edited the post...  Its not just three teams... its gonna be a lot more stuff like Weight (imagine 40 % fat 30 normal 20 skinny 10 obese whatever) and lots of other stufff that need to be identified by its enum name
#11
I did it on purpose "< 0" to have odds that give me 50 50, 100 0 or 0 100 in each case so I can see clearly if it works (its not gonna be like that after ive solved it)... but try it... it doesnt for enumerated types inside a function...

                           ALexhans

When i have time ill make it a little bit tidier,but if you get the point and know the answer HELP! 

Im trying to put a lot of different probabilities that can be called by one function with different enum parameters.



jeh... Manjob is something for a game but i need to sort this out (Exactly the Job of each character... ;)
#12
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]
#13
Hi... Im not sure that anybody has read this topic or the code but just to clear things out if someone has looked at it.
            I want to tell you that I found that the problem was that the way it was being created, it went through loops imposing conditions that sometimes could not be fullfilled and it crashed because not all the combinations that were randomly created where possible.
            After investigating what mathematical models were used in real fixtures (like NBA, NFL, Argentine and Chilean Football, that have a lot more restrictions than mine)  I decided to use a simple Model and swap positions at random so that althoug slots are the same the fixture is practically random.

              A    B            then         A   C              and so on
              C    D                            E   B
              E    F                             F   D

Then... All thats left is to randomly choose a slot for each team and you can even swap the fixture of each week so as to make it even more random.

Ive coded a kind of Argentine league in wich the teams play matches taking into consderation two variables and there's a Table with points and Average that makes out wich team is relegated each season.  Its pretty fussy because I made it just for fun and testing and maybe to stick in some game in the future.

  If anyone is interested in the code just ask...


                                                          Alexhans
                                           


           
#14
Im just saying it would make the GUIs look nicer and tidier to be able to remove that line... and as AGS 2.8 features many interface issues, I thought it was the right time to bring it up.  As you say, not a priority.

About the GUI limit : 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.

Alexhans
#15
mmmm.... Its odd... It'l take time to get used to.

BAD THING:  The net framework 2.0 is a 22.4 mb download.  And in a semifast machine took almost 15 min to install completely.
I wonder if its gonna work in the machine I have at home Pentium II 128 RAM ???

Where on earth can I find the Module manager...?
What happened to the wonderfull keyshortcuts like Ctrl+W,etc that made my life happier...?
the tags above are handy, but if you like working faster than with the mouse shortcuts are the way to go... dont forget about them and about us keyboard users  ;)

nothing further... thanks for your time...

                                           Alexhans
#16
  *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
#17
   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...
#18
Thanks for all the help, I will try your ideas and in a couple of days (Im a little bit LOADED with work) tell you how it went.   :)

thanks again
#19
I finally understood what was wrong with my code:Ã,  the following code, instead of counting the amount of races, sets it so that if I repeat the function it changes the amount of people in each race.

Code: ags

function whatever () {Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, // I run it at gamestart or if I use a reset button
Ã,  int tmp,ii=0;
Ã,  while(ii<=4){
Ã,  Ã,  RaceCount[ii]=0; 
Ã,  Ã,  ii++;
Ã,  }
Ã,  ii=0;
Ã,  while (ii<=10){
Ã,  Ã,  tmp = Random(4);
Ã,  Ã,  RaceCount[tmp]++;
Ã,  Ã,  member[ii] = Species[tmp];
Ã,  Ã,  ii++;
Ã,  }
}


what Im trying to do right now,  its a similar function that only reads the amount of each race without modifying it.  But Im crashing  the game with never ending loops.

I would appreciatte any help.  Thanks.
#20
Hi, Ive tried it but It doesnt seem to work, even if I change the odds to 99 % to one it still gives me aproximately 20 % to each one, are you sure that I have to replace the Random(4) with function GetSpecies ()?

Im writing down the function in the module manager Header script.
Is there something wrong about this?

Code: ags


/// Script header of a module ///////////////////////////////

String Species[5];
String member[11];
int RaceCount[5];

Species[0] = "Men";
Species[1] = "Aliens";
Species[2] = "Khudans";
Species[3] = "Ewoks";
Species[4] = "Chewys";


function whatever () {Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, // I run it at gamestart or if I use a reset button
Ã,  int tmp,ii=0;
Ã,  while(ii<=4){
Ã,  Ã,  RaceCount[ii]=0; 
Ã,  Ã,  ii++;
Ã,  }
Ã,  ii=0;
Ã,  while (ii<=10){
Ã,  Ã,  tmp = Random(4);
Ã,  Ã,  RaceCount[tmp]++;
Ã,  Ã,  member[ii] = Species[tmp];
Ã,  Ã,  ii++;
Ã,  }
}

function GetSpecies() {
Ã,  int Which = Random (99);
Ã,  if (Which < 50) return 0;
Ã,  else if (Which < 70) return 1;
Ã,  else if (Which < 85) return 2;
Ã,  else if (Which < 95) return 3;
Ã,  else return 4;
}

function whatever () {Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, // I run it at gamestart or if I use a reset button
member[0] = Species[GetSpecies()];
member[2] = Species[GetSpecies()];
member[3] = Species[GetSpecies()];
member[4] = Species[GetSpecies()];
member[5] = Species[GetSpecies()];
member[6] = Species[GetSpecies()];
member[7] = Species[GetSpecies()];
member[8] = Species[GetSpecies()];
member[9] = Species[GetSpecies()];
member[10] = Species[GetSpecies()];
}


Thank you very much.
SMF spam blocked by CleanTalk