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

#81
Once someone made a really good simulator of a life on a space station. It looked a lot like Yahtzee but I cant be really sure. You first chose whether you are male or female, soldier, engineer or scientist and than you went to the station. You could work, talk to NPCs and stuff like that. Does anyone knows what was its name? Thanks!
#82
Well, like I said, I can not thank you enough but THANKS!  :)
#83
Really? That easy and fast? Oh my goood, thank you very much kind stranger! I am forever in your debt! How if I may ask did you find it?
#84
Adventure Related Talk & Chat / Sleepy Island
Sat 04/06/2011 20:29:41
Hello everyone!

Once upon a time I created a short game called Sleepy Island. It was one of my first games, but as I changed computers over time, I somehow lost the game and of course file hosting doesnt last forever...  :'( And so I lost my game and I dont know how to get it back. There is however a faint ray of hope that one of you AGS members might have it.

Thank you!
#85
Ok, now we have the "needle" defined. My character comes to NPC and starts a dialog with him. The NPC has a text string assigned with words like "one two three", lets call it haystack. Dialog-request-script will run differently if the "needle" is contained in that NPC´s text string or isnt. Right? But how to do it?

if (haystack.Contains ("%s", needle)) {} can´t be used so what else???
#86
Thanks both. Im still not sure how to do this though. Not to stick to the string "theory" :D Is there another way to choose a word in one part of the game and then see if that word is contained in a sentence later in the game?

Thanks.
#87
Problem is, that it is always a different word that Im looking for. Not just needle. It depends on what player chooses from a certain list.
#88
Yes, but Im using 2.71 (or 72).
#89
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.
#90
Hi, thanks for the answer, what I have now is this:

Code: ags
function CheckTopics (String topicname) {
  int i = 0;
  while (i < topics.ItemCount)
  {
    if (topics.Items[i] == "topicname")
    {
      topics.AddItem (topicname);
      i = topics.ItemCount; // break out of the loop
    }
    i++;
  }
}


But it doesnt work :( Why?

Oh I know why! I had to change the == into != and there needs to be at least one item in the listbox, otherwise it wont work... Thanks for the help.
#91
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.
#92
EDIT: Now I see! I forgot to change the header of that function to match. Sorry guys.
#93
Thanks a lot everyone! It is working now that removed it from header.
#94
Quote from: mode7 on Fri 04/03/2011 08:22:59
Put Khris' code on top of your script.

Now that I did that, it says: Type or identifier differs from original declaraion...  :-[
#95
Thanks both for suggestions. One problem is that it can not be a character that defines travel time (thought about it though). The other problem is :) and now do not hate me for being stupid (: that when I place the code Khris gave me under button click script it gives me the error: Nested functions not supported. Please help.
#96
Hi. Thanks for the cod. Im having a problem with it as it wont compile:

First when I add exgain to integers:
---------------------------
Compile Error
---------------------------
'exgain' is a global var; cannot use as name for local.


Than without it:
---------------------------
Compile Error
---------------------------
Function declaration has wrong number of arguments to prototype.

So I do not know how to do it, although I know Im doing some silly mistake.
#97
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.
#98
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.
#99
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!
#100
You are a genius! Works fine :) Thanks a million!
SMF spam blocked by CleanTalk