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

#2
Code: ags

int a,b,c,i;
int Rainbow[10]; // Just use 0 - 6 for final values
//create unique values
for (i=0;i<10;i++)
{
 Rainbow[i]=i;
}
for (i=0;i<50;i++) //Amount of mixing up
{
 //swap two random elements
 a=Random(10);
 b=Random(10);
 c=Rainbow[a];
 Rainbow[a]=Rainbow[b];
 Rainbow[b]=c;
}
#3
Hints & Tips / Re: Crave
Wed 06/09/2006 22:10:59
Emma,
Spoiler
You need to tease the purple thing out of the hole.
[close]

Spoiler
Drop or throw! a berry in front of it.
[close]
#4
Hints & Tips / Re: Magsic II
Mon 14/08/2006 09:02:05
desimaui,
Spoiler
Try getting all the slugs as high as possible.
[close]
#5
Hi Maverick,
Sorry I didn't realise this was in the Beginners section when I posted hence I assumed rather a lot.

The idea is to use the HotSpots and Regions as two seperate masks that work together, You use (Version 2.72 code)

Code: ags

function on_mouse_click(MouseButton button) // called when a mouse button is clicked. button is either LEFT or RIGHT
{
Ã,  Hotspot* Hot;
Ã,  Region* Reg;

Ã,  if (button==eMouseLeft)
Ã,  {
Ã, Ã,  Ã, Hot=Hotspot.GetAtScreenXY(mouse.x,mouse.y);Ã,  
Ã, Ã,  Ã, Reg=Region.GetAtRoomXY(mouse.x, mouse.y);

Ã,  Ã,  if (Hot.ID!=0 && Reg.ID!=0)
Ã,  Ã,  {
Ã,  Ã,  Ã,  Ã, BoardSquareX=Hot.ID-1;
Ã,  Ã,  Ã,  Ã, BoardSquareY=Reg.ID-1;
Ã,  Ã,  Ã,  Ã, ClickOnBoard=true;
Ã,  Ã,  }
Ã,  Ã,  else
Ã,  Ã,  {
Ã,  Ã,  Ã,  ClickOnBoard=false;
Ã,  Ã,  }

}


function ScreenXY(int x,int y), is to calculate the centre of the squares in screen space, from the Board X,Y position . Sorry I got the board upside down, (0,0) is the bottom left corner. Might be better to change the function to ScreenXY(int BoardX,int BoardY), to be clearer.

All the 'if's just convert the Board Y value to the corresponding Screen Y values for the vertical cantres of the squares.

Code: ags

  ky=1.0-(IntToFloat(SY)-81.0)/(220.0-81.0);  //ky=1.0 at bottom, ky=0.0 at top
    //81.0 is vertical centre of top row
    //220.0 is vertical centre of bottom row

This gives me a float (ky) that is 0.0 at the top of the board and 1.0 at the bottom of the board, the Values are just taken from the list of ifs above.


Code: ags

Ã,  kx=(IntToFloat(x))/(IntToFloat(BoardSize-1));

This gives me a float (kx) that is 0.0 at the left of the board and 1.0 at the right of the board.
Sorry BoardSize is the size of the Board, so 8 in my case. (as 8x8 Board). Actually would be better to use BoardSizeX in case you have a rectangular board.

#6
Macerick,
As requested. In Zugzwang I used two Screens, one with Hotspots and one with Regions. I read both on a mouse click. The Hotspots gives me the Board X value and Regions the Board Y value.



To get the centre of each square I took the coordinates of the centres of the 4 corner squares then use this;

Code: ags

float BX0=58.0;Ã,  Ã,  Ã,  Ã,  //X value centre top left square
float BX1=256.0;Ã,  Ã,  Ã,  //X Value centre top right square
float BX2=20.0;Ã,  Ã,  Ã,  Ã,  //X Value centre bottom left square
float BX3=299.0;Ã,  Ã,  Ã,  //X Value centre rottom right square

int SX;Ã,  Ã,  Ã,  Ã, //Final Screen X 
int SY;Ã,  Ã,  Ã,  Ã, //Final Screen Y
float SScale;Ã,  Ã, //Scale of piece for mock 3D effect

function ScreenXY(int x, int y)Ã,  Ã, //Board (x,y)Ã,  Ã,  (0,0) is top left
{
Ã,  if (y==0) SY=220;Ã,  Ã,  //Get Screen Y values for vertical centre of each square
Ã,  if (y==1) SY=195;
Ã,  if (y==2) SY=171;
Ã,  if (y==3) SY=150;
Ã,  if (y==4) SY=129;
Ã,  if (y==5) SY=110;
Ã,  if (y==6) SY=94;
Ã,  if (y==7) SY=81;

Ã,  //Calculate Screen X values assuming linearly spaced squares
Ã,  float kx;
Ã,  float ky;
Ã,  float x0;
Ã,  float x1;
Ã,  
Ã,  ky=1.0-(IntToFloat(SY)-81.0)/(225.0-89.0);Ã,  //ky=1.0 at bottom =0.0 at top
Ã,  
Ã,  x0=BX2+ky*(BX0-BX2);
Ã,  x1=BX3+ky*(BX1-BX3);
Ã,  
Ã,  kx=(IntToFloat(x))/(IntToFloat(BoardSize-1));
Ã,  SX=FloatToInt(x0+kx*(x1-x0));
Ã,  
Ã,  SScale=(100.0+(70.0-100.0)*ky)/100.0;Ã,  //Scale calculation to give mock 3D effect based on ky
}



Now have SX and SY as screen coord for Square centres.

Sorry it's so messy was coded in very short amout of time. This can be used to effectivly get 256 screen hotspots.

Same code would work for a 2D board. But then it would be easier to just use the mouse x,y values
e.g.
SX=SquareLeftCentreX+((mouse.x-SquareLeftCentreX)/SquareWidth)+(SquareWidth/2);
and similar for Y.
#7
FamousAdventurer77,
Sorry about that, there was a bug there in the very very first version but that has long since been fixed. You could try going into the Manual and changing the 'Slow Computer' flag. If that fails PM me and send me a saved game with the error. It should be mentioned that if you change the version you are playing you can't use any of your old save games, they might appear to work, but this sort of crash can be caused by that.
#8
Hints & Tips / Re: Crave
Thu 27/07/2006 10:05:28
trueseeker,
Wardrobe.
Spoiler
You need the wardrobe key from the office.
[close]

Office.
Spoiler
You have the lit cigarette!, use your X-Ray powers on the coat, near the back door.
[close]

Coat.
Spoiler
Use cigarette on coat to get office key.
[close]
#9
zooomer1990,
Pigs
Spoiler
Try and catch them when the catcher is at the left or right of the screen as it is moving slower there, also only try and catch slow moving pigs, wait til they go slow, and it's easier to catch the lowest ones first. And remember the order you caught the spotty one, as Rosie said. It's not a race, and 8 pigs is quite possible!
[close]
#10
Hints & Tips / Re: Magsic II
Tue 11/07/2006 07:59:44
Darrick,
Spoiler
You need to look at the ear, then one of the trees, yes, you can look now!
[close]
#11
Hints & Tips / Re: Bog's Adventure
Tue 11/07/2006 07:58:26
gogsjames,
Glad you're enjoying the game. You might find more helpers if you use the other Bog Thread

And hide your comments, [ h i d e ] Blah blah [ / h i d e ], but without the spaces.
#12
Hi Threepwood,
Thanks! The Bog theme is based on an old AGS-72 folk tune, that's actually Bog humming the main tune, he popped round for a cup of tea and recorded it for me!
You can always record music while the game is playing by using Audacity or any sound recording programme.
Crave music? Hmm I might do that but I'm awfully busy for now.
If you want peace, then turn the music off ;)
#13
Jops,
That's been there for a while, any I've fixed it. By the way you can always get your speech back, by visiting the pigs.
#14
Hints & Tips / Re: Magsic
Thu 22/06/2006 07:25:22
Sholson,
Spoiler
With the egg it's easier if you repeated interact (anywhere on it) at a steady pace, then slowly increase the speed, but try to keep an regular,consistant speed of clicks, rapid bursts wont work well!. It only a takes me a few seconds to break it this way. As soon as the crack starts to grow, maintain that speed or a bit faster if you can, to break it. It's not really all that fast. If it's still too hard, try using two fingers, one from each hand on the mouse button, alternating fingers. Hope this helps.
[close]
#15
Sounds like some of your character sprites are not 32-bit. For example the defult Roger is 256-palette and therefore can't be used.
#16
Hints & Tips / Re: Crave
Tue 20/06/2006 21:57:40
Stumped,
Spoiler
Click on any of the bushes in the wood to the right of the castle
[close]
#17
Guest,
Thanks for pointing that out, something very strange was going on there. Anyway I've fixed it, please re-download.
#18
Hints & Tips / Re: Bog's Adventure
Sun 11/06/2006 14:10:12
paolo,
Spoiler
You can grab Puggle's tail.
[close]
#19
Hints & Tips / Re: Zugzwang
Fri 09/06/2006 19:47:56
Good point! I'll fix that right away.
#20
Hints & Tips / Re: Zugzwang
Fri 09/06/2006 18:34:51
Mac,
Spoiler
A Queen sacrifice.
[close]
SMF spam blocked by CleanTalk