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

#2341
requires AGS 2.71 or above

It's a real pain to script multiple responses to an action, sometimes. You have to go around declaring variables, put in bunches of if statements, etc. Not too much effort for one interaction, but if you're doing it for all of them?

SSH to the rescue with MultiResponse...

add a script action to your "interact with hotspot" for example and say:

Code: ags

Multi.Disp("No, I'm not touching that>No, I'm really not going near it>Look, for the last time, NO!");


And the first click on it will give you "No, I'm not touching that", the 2nd "No, I'm really not going near it" and the 3rd and subsequent clicks "Look, for the last time, NO!"

Great, I hear you say, but there's more!

The function returns which of the responses was given, so you can do something special:

Code: ags

int state=Multi.Say("I don't think I want to take any>I'd rather not>OK, if you insist>I've already got some");
if (state==3) player.AddInventory(iIckyGoo);


Full documentation at http://ssh.me.uk/moddoc/MultiResponse

Download MultiResponse module here

UPDATED FOR v1.1:

Multi.Respond still does what it used to, but Multi.Disp is now preferred (I would have made it Display, but AGS won't allow it :( ) There is now also Multi.Say to use player.Say instead of Display, and Multi.SRespond which returns the string as GarageGothic suggested. Also new Multi.SLoop and Multi.SRandom which return a looping or random string respectively. There is also the current position in Multi.reponse and a "last response" detector in Multi.last.

UPDATED v1.2:

Added some v3.0+ support with extender functions
#2342
I'll have a go at making it work with 2.71 and 2.72 soon
#2343
Well, for sure you can declare it inside a struct, and import the struct. Or you could write a function that gives you the random string value form the global array and import the function.
#2344
That's because there isn't one, unless you use a customised dialog interface, such as monkey_05_06's ScrollingDialog script module.
#2345
Bah, that was my idea!
#2346
Not sure about the others, but (a) This list has been around since at least 2004 and (b) That 1st place one is an Urban Myth.
#2347
At last, a Princess Marian game that takes more than 2 minutes to play...


Download the teaser trailer







Help Princess Marian with a hatty adventure. The game will be finished by mid-September.

PROGRESS
Now in beta testing...
Character art: 100%
backgrounds: 100%
Inv items: 100%
Objects: 100%
Animations: 100%
Plot: 100%
#2348
There must be more than one Private Detective monologue comedy skit. Any more details? British/Australias/American, plot, jokes, ANYTHING?
#2349
Also, objects can be used as they don't anti-glide. I wouldn't wait for a new AGS version as history tells us it will be at least 6 months before a new one and even then it might not have the feature you want.
#2350
Yes, run this script on PHP, but not too often as it throws lots of HTTP requests at CJ's server

Code: ags

<?php

function array_average($arr) {
	$sum = array_sum($arr);
	$num = sizeof($arr);
	return ($sum/$num);
}

function distributor_compare($a, $b) {
   $adist = intval($a['avg']);
   $bdist = intval($b['avg']);
  
   if ($adist == $bdist) {
     return 0;
     }
     return ($adist > $bdist) ? -1 : 1;   
}

$i=1;

if ($fh=fopen("ranking.csv", "r")) {
	while ($line=fgets($fh)) {
		$i++;
	}
	fclose($fh);
}
print "Start from: $i
";
$fh=fopen("ranking.csv", "a");

for (; $i < 750; $i++) {

	$url="http://www.adventuregamestudio.co.uk/games.php?action=detail&id=" . $i
	$ch = curl_init($url);


	curl_setopt($ch, CURLOPT_HEADER, 1);
   	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
   	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
	curl_setopt($ch, CURLOPT_PROXY, 'web-proxy:8088'); 
	
   	$data = curl_exec($ch);
	if (curl_errno($ch)) {
   		print "Error: " . curl_error($ch) . "
";
	} else {
   		curl_close($ch);
	

		$pattern='/<title>(.*) - AGS Games Database</title>/';
		preg_match($pattern, $data, $matches);
		$gamename=$matches[1];
			
		$pattern='/<tr><td>Visual:</td><td><b>(d+)\%</b> </td></tr><tr><td>Immersion:</td><td><b>(d+)\%</b> </td></tr><tr><td>Puzzles & Pacing:</td><td><b>(d+)\%</b> </td></tr><tr><td>Overall Enjoyment:</td><td><b>(d+)\%</b>/';
		
		if (preg_match($pattern, $data, $matches)) {
			fprintf($fh, "%s,%s,%d,%d,%d,%d,%d
", $url, $gamename, $matches[1],$matches[2],$matches[3],$matches[4], array_average(array($matches[1],$matches[2],$matches[3],$matches[4])));
			
	
		}
	}
	
}

fclose($fh);

#2351
You can sort the digest page by clicking on the column headings: http://www.adventuregamestudio.co.uk/games.php?action=digest

My page is at http://ssh.me.uk/ranking.htm and can also be sorted by clicking column headings, but is based on the ratings at the point I captured them a while ago
#2352
General Discussion / Re: Buying a new system
Wed 16/08/2006 12:14:50
Get a new Core 2 Duo processor if you want to be very future-proof.

Something like: http://www.meshcomputers.com/Default.aspx?PAGE=PRODUCTVIEWPAGE&USG=PRODUCT&ENT=PRODUCT&KEY=96504
#2353
I'm only joking!
#2354
Princess Marian X will be about hatmaking, too, so lets hope that we don't each other use the same plot points/puzzles...

This looks good, even if all the characters look like condoms ;)
#2355
What Ishmael said
#2356
Just got this trying to paste something into a  newly created sprite folder in AGS 2.72:

Exception 0x0000000
at EIP=0x000000000
AGSEDIT v2.72.652 SIP=26

:(

and I can recreate it, it seems. The image was a subselection of a layer in Paint.NET... when I pasted it into MS Paint and copied it again, it worked fine....
#2357
You can set the game to continue in the background with:

SetMultitaskingMode (1);

#2358
In which way doesn't it work?

Also, you could use the String.Contains function to get the position of the letter in the alphabet, rather than a huge list of ifs

And you should probably keep a copy of the original coded message in a string and work from that, rather than keep copying it from the label test, becuase as it is, every time the player swaps 2 characters, the "decoding" process is applied to the already failed decode string again. e.g.

If the player swaps A and B and the coded message is

ABCDABCD

you would get

BACDBACD

then they swap E anf F which arenmt in the message you'd get

ABCDABCD again becuase the a-b swap transition is reapplied! You need to start from the original coded message again each time.
#2359
errr, dave...
Quote from: http://www.firehydrantred.com/davelgil
This is a default setup of the osCommerce project, products shown are for demonstrational purposes, any products purchased will not be delivered nor will the customer be billed. Any information seen on these products is to be treated as fictional.
#2360
General Discussion / Re: Plane Terrorists
Mon 14/08/2006 12:02:14
Apparently, the movie Snakes on a Plane has been affected by this, as Sam Jackson wasn't allowed to take any snakes on the plane as hand baggage under the new security regulations.
SMF spam blocked by CleanTalk