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

#21
Is it possible to check whether a string contains another string?

Formula " haystack.Contains ("s%", needle) " failed so I guess it is not possible to use reference to a string in another string. Is there any other way?

Just so you have clear idea what I am talking about. On one place in the game I decide that: String needle = "one"; and on another place I decide that: String haystack = "one two three five". Now I need to check whether there is a needle in a haystack. Can you help me please?

Thanks.

PS: Did search the forum.
#22
Yes, I searched the forums. Basically when a player enters a room, I need the script to check a certain listbox for an item and IF there is no such item in that listbox, I want to add that item into that listbox. Is there any easy way of doing this? Thank you very much for helping me.
#23
Hi there!

In my game I have a time system. This is why I need to calculate a distance between two points on a Gui map. I have buttons on my map that represent a certain points. Lets say we have points A and B. Player is currently in point B which is located at 100 x and 50 y. He wants to travel to point A which is located at 50 x and 100 y. I can not sum x and y for each place and than do A-B = time cuz I will get 0. I tried almost everything but still have no clue what to do. How to count a distance between two points on a 2D map???

Thanks.
#24
How, I have this function that basically removes a certain item from a list.

   
Code: ags
function LoseQuest(String text){
	int p;
	while (p < quests.ItemCount){ //Change ListBox1 with the name of your listbox
	if (quests.Items[p].CompareTo(text, false) == 0){ //Change ListBox1 with the name of your listbox
	quests.RemoveItem(p); //Change ListBox1 with the name of your listbox
	PlaySound (10);
	return;
	}
	p ++;
	}
	}


I also have an int called "experience". Now what I wish to do is add the possibility not only write what quest (item) will the player lose but also how much experience will he get for it. Any idea how? Thanks.
#25
I am working on a game in AGS 2.7something. With the help of many of you I managed to create a system like this.

Player comes to a NPC and in dialog he chooses Trade option. Dialog request script runs like this:

Code: ags
 if (parameter==59) {
   if (character[MR].InventoryQuantity[ibandage.ID] < 2) character[MR].AddInventory (ibandage);
   gTrade.Visible = true;
   chmoney = Merchant;
   sellerlabel.Text = "Merchant";
   int i = 1;
   while (i <= Game.InventoryItemCount) {
    character[INV3].InventoryQuantity[i] += character[MR].InventoryQuantity[i];
    character[MR].InventoryQuantity[i] = 0;
    i++;
   }
   UpdateInventory ();
}


In global script (game start) I have this:

Code: ags

    sellstuff.CharacterToUse = cF;
    giveinv.CharacterToUse = cInv1;
    takeinv.CharacterToUse = cInv2;
    sellerinv.CharacterToUse = cInv3;
//Traders
	//Merchant (Vaspun)
	Merchant = 1000;
	character[MR].AddInventory (ibandage);


The problem is that even if that character has more than 2 bandages, he still gets new bandage every time I want to trade with him (every time the dialog request script runs). Any idea why? Thanks!
#26
 
Code: ags
if (IsKeyPressed(83)==1) {
   if (GetGlobalInt(24)==0) {
   character[O].Walk (171, 104, eBlock, eAnywhere);
   if (GetGlobalInt(30)==2) if (player.InventoryQuantity[44]>=1) dOleg.SetOptionState (11, eOptionOn);
   else if (GetGlobalInt(30)==3) if (player.InventoryQuantity[45]>=1) dOleg.SetOptionState (11, eOptionOn);
   else if (GetGlobalInt(30)==4) if (player.InventoryQuantity[46]>=1) dOleg.SetOptionState (11, eOptionOn);
   else if (GetGlobalInt(30)==5) if (player.InventoryQuantity[47]>=1) dOleg.SetOptionState (11, eOptionOn);
   else if (GetGlobalInt(30)==6) if (player.InventoryQuantity[48]>=1) dOleg.SetOptionState (11, eOptionOn);
   else if (GetGlobalInt(30)==7) if (player.InventoryQuantity[49]>=1) dOleg.SetOptionState (11, eOptionOn);
   else if (GetGlobalInt(30)==8) if (player.InventoryQuantity[51]>=1) dOleg.SetOptionState (11, eOptionOn);
   dOleg.Start ();
   SetGlobalInt (24, 1);
   }
   }


This is the script for while player is standing on region... The option wont show in the dialog. I have no idea why. There is no option-off-forever in my script, globalint was set to number 8 previously and my character has the item 51 so I really dont know what is going on here.
#27
WI-AA

Now here is a game inspired by Fallout (first two parts). It is an adventure rpg that will give you quests and side quests on your journey to the post-war world. Your character can gain experience and improve his skills. There is a turn based battle system in the game and 6 types of enemy so far (more to come). Trade system is also a part of the game as well as biohazard and radioactive areas that you will need to avoid in order to stay alive. Player will have to keep an eye on his health as well as food and water bars.

So far I managed to finish about 50% of the game. Here are some screens:







If you cant see them try clicking here:
http://www.glowfoto.com/static_image/13-193411L/4982/jpg/04/2010/img4/glowfoto
http://www.glowfoto.com/static_image/13-180727L/3912/jpg/04/2010/img6/glowfoto
http://www.glowfoto.com/static_image/13-193558L/2256/jpg/04/2010/img4/glowfoto

Now my question: What would you like to see in this game?
#28
I have a lot of properties in AGS 2.72 but there are just too many of them and the window is too big so I cant see the ones I added last as there is no slidebar and not even the OK and other buttons. Is there a way around this? Or can I add more and actually be able to see and work with them? Through script maybe? I dont know.

I tried upgrading the game to 3.2. but the program just messes with my shitty Vista (taskbar, theme colour), the window while testing the game is too small as my game is 320x200 and if I want it fullscreen fonts are displayed really ugly and sometimes you cannot see them clearly when in groups of words. Maybe it is because I need the NET Framework 2 but I just cannot uninstall 1.1 version currently on my computer so Im stuck here.

Please help me, Im desperate.
#29
I have the following script in "while player stands on region":

Code: ags
if (IsKeyPressed(83)==1) { //while key "S" is pressed
  		gObsah.Visible = true; //simple gui shows up...
      container.Text = "container:"; //...with this label. The name can be anything for example wardrobe or box etc.
      if (GetGlobalInt(103)==0) {
        object[3].Visible = true;
        object[4].Visible = true;
        object[5].Visible = true;
        }

      if (GetGlobalInt(103)==1) {
        object[4].Visible = true;
        object[5].Visible = true;
        }

      if (GetGlobalInt(103)==2) {
        object[3].Visible = true;
        object[5].Visible = true;
        }

      if (GetGlobalInt(103)==3) {
        object[3].Visible = true;
        object[4].Visible = true;
        }

      if (GetGlobalInt(103)==4) {
        object[3].Visible = true;
        }

      if (GetGlobalInt(103)==5) {
        object[4].Visible = true;
        }

      if (GetGlobalInt(103)==6) {
        object[5].Visible = true;
        }

      else {}
      }
}


After clicking on a certain object there is this:

Code: ags
if (carry+9 <= carryweight) {  
object[3].Visible = false;
 player.AddInventory (ibeans);
 if (GetGlobalInt(103)==0) {
 SetGlobalInt (103,1);
}
 if (GetGlobalInt(103)==2) {
 SetGlobalInt (103, 6);
   }
 if (GetGlobalInt(103)==3) {
 SetGlobalInt (103, 5);
   }
 if (GetGlobalInt(103)==4) {
 SetGlobalInt (103, 7);
   }
}


As you can see it is really long script. What I wish is to simplify this in any way. Any suggestions please?
#30
I created a pretty clumsy and bulky battle script. One of the main reasons why is it like that is that I dont know how to refer to a certain character. Here is an example:

Code: ags
function MeleeAnimation () {
 gFight.Visible = false;
 character[T].StopMoving ();
 character[M1].StopMoving ();
 character[M2].StopMoving ();
 character[M3].StopMoving ();
 character[U].StopMoving ();
 character[W].StopMoving ();
 character[HB].StopMoving ();
 character[L3].StopMoving ();
 character[L4].StopMoving ();
 if (GetGlobalInt(5)>0) {
 if (player.x < enemyx) {
 player.Animate (6,4,eOnce,eBlock);
 player.FaceLocation (enemyx, player.y, eBlock);
 }
 if (player.x >= enemyx)  {
 player.Animate (5,4,eOnce,eBlock);
 player.FaceLocation (enemyx, player.y, eBlock);
 }
 }
 else if (GetGlobalInt(15)>0) {
 if (player.x < enemyx2) {
 player.Animate (6,4,eOnce,eBlock);
 player.FaceLocation (enemyx2, player.y, eBlock);
 }
 if (player.x >= enemyx2)  {
 player.Animate (5,4,eOnce,eBlock);
 player.FaceLocation (enemyx2, player.y, eBlock);
 }
 }
 gFight.Visible = true;
}


or everyones favorite:

Code: ags
if (battlemove > 0) {
 if (player.Moving == true) battlemove -=1;
 if (character[T].Moving == true) battlemove -=1;
 if (character[M1].Moving == true) battlemove -=1;
 if (character[M2].Moving == true) battlemove -=1;
 if (character[M3].Moving == true) battlemove -=1;
 if (character[U].Moving ==true) battlemove -=1;
 }


and of course:

Code: ags
if (GetGlobalInt(3)==2) {
//SetGlobalInt (3, 1);
if (enemyammo == 0) {
 if (GetGlobalInt(5)==0) {
 if (henemy >0) {
 gFight.Visible = false;
 if (henemy2<=0) SetGlobalInt(3, 4);
 battlemove = enemymove;
 if (enemyname.Text == "brown dog") character[D].Walk (player.x, player.y, eNoBlock, eWalkableAreas);
 if (enemyname.Text == "Tika Liji") character[T].Walk (player.x, player.y, eNoBlock, eWalkableAreas);
 if (enemyname.Text == "Untam") character[M1].Walk (player.x, player.y, eNoBlock, eWalkableAreas);
 if (enemyname.Text == "Weeten thugs") character[M2].Walk (player.x, player.y, eNoBlock, eWalkableAreas);
 if (enemyname.Text == "grey dog") character[W].Walk (player.x, player.y, eNoBlock, eWalkableAreas);
 if (enemyname.Text == "heavy bot") character[HB].Walk (player.x, player.y, eNoBlock, eWalkableAreas);
 if (enemyname.Text == "Lostials guards") character[L3].Walk (player.x, player.y, eNoBlock, eWalkableAreas);
 }
 }


These are just parts of the script. As you can see I need to write down every character in the game that could be involved in the combat because I dont know any other way. Sometimes the fight can include two enemy characters, sometimes just one, never three though. It can start by attacking the char (clickin on it) or by coming close to it. Is there a way to get rid of these long scripts?

Thanks!
#31
I have a problem creating a trade inventory for my game. I have a GUI with four inventory windows (similar to the one used in Fallout). One is the players inventory, on the other side is the traders (NPCs) inventory. Than there is inv window for the items that player wants to sell and another window for things he wants to buy. I want the player to be able to click on an item in his inventory and this item will be transfered into the sell inv window and also the other way around. When he click on an item in traders inventory, this item will be transfered to the inv window he wants to buy...

Now... How do I make a script that will "know" in which inventory window is the item located? Because now if I click on an item that is in players inventory, it could travel anywhere if you know what I mean. Also if there are two identical items, one in sellers inventory and the other in players inventory... Oooh! This is so hard. Please help anyone.

Thank you.
#32
Hi there, I would like to know how to do an inventory that will handle object properities. So far I managed to add a properties for each object (weight, food, water...).

Now I need my script to calculate how much is my character carrying. Sum up the weight property of each item. I need this because if my character finds a new object and wants to pick it up, the script must check if he can carry it or not:

Code: ags
if (carry+10 <= maxcarryweight) {...


Also, I have a button in inventory that is supposed to recycle/eat/drink selected item... Anyway, after pressing this button I would like to use the getproperty function to subtract item weight from the carrying weight AND lose the selected inventory (active inventory item, because player first needs to select this item and than click the button). In case this is an edible item I want its food or drink property to decrease the hunger or thirst value respectively.

I really dont know how to do this.

Can you help me please? Thx...
#33
Is there a way I can find out the difference between the position.x of player character and some other character and possibly store this result as an int?

Thanks!
#34
Hi there. I have troubles creating a quest listbox.

Two quests:
- dig a grave
- find a cadaver

If he will first get the quest "dig a grave" it will be number "1" in the Listbox, but if he will get it after he got the quest "find a cadaver" than it will be number "2"... Now since numbers of these quests in the listbox can be different, how can I remove a specific item from the listbox? I cant. I can only remove it by its number :f ( not by text ("dig a grave").

I have tried this (found in one old thread, but it didnt work where marked)

Code: ags

function AddQuest (String text) {
  quests.InsertItemAt (0, text);
  }

function LoseQuest (String text) {
 int Temp;
 while (Temp < quests.ItemCount) {
 if (quests.Items == text) { //DIDNT WORK
 Temp = quests.ItemCount;
}
Temp ++;
}
}


I would prefer the easiest method if possible. Thanks a million.

Gepard
#35
I want my character after performing a certain action to lose every inventory item that he posses. Is it possible to do?

Thanks.
#36
---ALL THE MAGICAL THINGS---


This is a non-adventure game created in AGS.

It has some RPG elements, but it is basically a card game (or a turn-based game if you want). You play as a magician who wants to conquer the land using dark spells and creatures. You gain experience as you go and there are also some other elements that the player might like.

However I am afraid it is necessary for a player to read the included manual (yeah I know) to know how to play the game, so please do so before you write about how difficult is it to play the game.







DOWNLOAD: http://www.filehosting.org/file/details/71948/AMT.rar

I would like to thank to Crimson Wizard for being my only real beta tester (kaputtnik deserves a credit too LOL).
#37
Hi everyone!

I just finished my little non-adventure simulation of tiny people randomly building their large station. Check it out if you are interested.



Image:
http://img141.imageshack.us/img141/7606/onemy.jpg

You can download it here: http://www.filehosting.org/file/details/71265/WOO.rar

NOW WITH MULTITASKING MODE SET TO 1.
#38
I have these characters that I want to speak random words in sentences. Is it possible at all? Lets say I have a list of words divided into sections. First section is something like: I, you, he, we... and words like that. Second one contains words like want, see, etc. Now I want a character to speak these words like this: First he will say a word from the first section, than word from the second section etc. Can this be done? And how?

THX
#39
I have a room with multiple characters. I have a region. The characters are moving randomly on the screen. I want a script (an animation for example) to take place, whenever a character is colliding with the region, but I dont want to write script for each character. I want the script to take place whenever there is any character in the region, BUT I want only the character standing on the region to be affected by that script (understand: only that character to animate). I just want to avoid long script. I want script that will be started by any character, but will only affect the triggerer character. Hope its clear now :fD.

Thanks.
#40
---ALL THE MAGICAL THINGS---


This is a non-adventure game created in AGS.

It has some RPG elements, but it is basically a card game (or a turn-based game if you want). You play as a magician who wants to conquer the land using dark spells and creatures. You gain experience as you go and there are also some other elements that the player might like.



The game itself is 90% done and now I need some testers who would try it (tested it many times myself).



Write here if you want to try it as a tester. I need five people.



Thank you very much.
SMF spam blocked by CleanTalk