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

#461
Hi

I need a hand regarding this shop table.

Adding and cancelling items works fine but there does seem to be a problem.

You start off with 10 Elfers (money).

I'll try and explain the problem.

It's to do with once the Elfers in the label (bottom) get down to 0 (after buying items) and let's say you decide to cancel all the items and Elfers are again at 10, when you check-out you are told you have 0 Elfers left when you should have 10! Therefore when you re open the shop you can't buy.

Could someone take a look at the scripts and pull them apart and hopefully see any problem areas with advice to correct.

Here is draft shop:


Rep Exec Always
Code: AGS
} 
  // SHOP
  
  //ARROWS
  LarrowsQ.Text = String.Format("%d", arrows);
  Larrowsprice.Text = String.Format("%d", arrows *6);
 
  //BASKETS
  LbasketsQ.Text = String.Format("%d", baskets);
  Lbasketsprice.Text = String.Format("%d", baskets *2);
 
  //KNIVES
  LknivesQ.Text = String.Format("%d", knives);
  Lknivesprice.Text = String.Format("%d", knives *4);
  
  //ROPES
  
  LropesQ.Text = String.Format("%d", ropes);
  Lropesprice.Text = String.Format("%d", ropes *5);
  
  //TORCH
   LtorchQ.Text = String.Format("%d", torch);
  Ltorchprice.Text = String.Format("%d", torch *3);
  
   //GRAPPLE
  LgrappleQ.Text = String.Format("%d", grapple);
  Lgrapprice.Text = String.Format("%d", grapple *10);
  
  //TOTAL PRICING 
  LTotalPrice.Text = String.Format("%d", arrows *6 + baskets *2 + knives *4 + ropes *5 + torch *3 + grapple *10);
  totalcost=arrows *6 + baskets *2 + knives *4 + ropes *5 + torch *3 + grapple * 10;

  Lelfers.Text = String.Format("%d", Elfers);

  
 // STOP COUNT IF OVER 10
 
 if (Elfers >= 10)
 {
   
   Elfers= 10;
   Lelfers.Text = String.Format("%d", Elfers);
 
 }  
 
 // STOP COUNT IF OVER 10 
 
  if (totalcost >=  10)
 {
  totalcost= 10;
 
 } 
 
 if (Elfers <=  0)
 {
  Elfers= 0;
 } 
 }


Baskets BUY button:

Code: AGS
function Bbuy2_OnClick(GUIControl *control, MouseButton button)
{
 if (Elfers < 2)
  {
 Display("You do not have enough Elfers!");
 
}
 else
{
  
 baskets=(baskets+1);
 Elfers=(Elfers -2);
}
}


Baskets Cancel button:

Code: AGS
function Bcancel2_OnClick(GUIControl *control, MouseButton button)
{
  basketsQ=(baskets-1);
  Elfers=(Elfers +2);

 if(baskets>0)
 {
 baskets = (baskets-1); // This could also be done with 'arrows--;' or 'arrows-=1;'
 } 
 else if (baskets <=  0)
 {
  totalcost=0;
  Elfers= -1;
 }
 }


Many thanks


#462
Beginners' Technical Questions / Label flash
Tue 06/11/2012 09:31:26
Hi

The 'SHOP' (gui) I am constructing has all the maths working correctly and I now have a small issue to clear up.

I have the label LElfers which displays The Int Elfers.

I have it stop at 10 yet it flashes a number (number can vary depending on product) very briefly before displaying 10.

Here's the bit of code for that part (Rep Exe Always):

Code: AGS
if (Elfers >=  10)
 {
   Elfers= 10;


If you can assist I thank you




#463
I'm building a 'Shop'(GUI) and the products 'Cancel' button takes the last order of a particular product away.

This works but I have hit a snag:

How can I stop 'Cancel' button showing less then 0 when repeatedly clicked?

A set of arrows cost 6 Elfers.

In Rep Exec Always:
Code: AGS

LarrowsQ.Text = String.Format("%d", arrows); // update for each time a set of arrows is added / subtracted.
Larrowsprice.Text = String.Format("%d", arrows *6); // for each time a set of arrows is added 6 Elfers is charged.


Buy Button script:
Code: AGS
function Bbuy1_OnClick(GUIControl *control, MouseButton button)
{
 arrows=(arrows+1); // When a set of arrows is bought.
 arrowsQ=(arrowsQ +6); // then added to arrowprice
}


Cancel Button script:
Code: AGS

function Bcancel1_OnClick(GUIControl *control, MouseButton button)
{
 arrows=(arrows-1);    // take away a set of arrows/
 Larrowsprice.Text = String.Format("%d", arrows -6);   // take off the price of a set of arrows.
}


Could you please lend a hand?

Thank you


#464


FULL GAME ADVENTURE OF A CULT SERIES.

My thanks to all those that helped make this game possible.

The arrival of a Witch shakes the once peaceful and joyful land of Elfenor. The Witch's minions' attack brought a grim silence to the town folk.

Both its leader and citizens were unsure of what the future would bring to them. And so, refusing to accept defeat, the bravest of the elfen community, Elfie, would step forward and try to bring an end to the Wicked Witch...



Screenies:


http://www.adventuregamestudio.co.uk/Games.aspx/Detail/1608

FEEDBACK / COMMENTS gratefully appreciated.

Thanks






#465
I have an issue with player size (scaling).

Whilst it looks perfectly fine when I play it a friend says that the character gets big when he walks across the screen. The player walks on a walkable area with same scale (50). All that happens is that the player's Transparency is altered for the walk.

LockView (59) is a small animation of normal size.

I'm at loggerheads as to why... Do you know why this could be?

Global

Code: AGS
else if(cELF.ActiveInventory==ibluejar && cELF.Room==24) 
 {
  cELF.ActiveInventory=null;
  cELF.Loop=2;
  cELF.Say("I'll take a huge gulp of this invisibility potion.");
  cELF.LockView(59);
  cELF.Animate(2, 6, eOnce, eBlock);
  cELF.UnlockView();
  aChange.Play();
  cELF.TweenTransparency(1.5, 90, eBlockTween);
  cELF.Say("I'm invisible!!");
  
  cELF.Walk(645,265, eBlock, eWalkableAreas); 
  cELF.Walk(665,265, eBlock, eAnywhere);  // so he can walk off screen.
  
  object[0].SetView(78);
  object[0].Animate(0, 4, eRepeat, eNoBlock);
  cOllie.SayAt(300, 83, 250, "Can you smell something Edgar?");
  object[0].SetView(78, 0, 0);
  
  object[1].SetView(77);
  object[1].Animate(1, 4, eRepeat, eNoBlock);
  cFace.SayAt(364, 83, 250, "Smells very much like elves!!");
  object[1].SetView(77, 1, 0);
 
  object[0].SetView(78);
  object[0].Animate(0, 4, eRepeat, eNoBlock);
  cOllie.SayAt(300, 83, 250, "I hate elves!!");
  object[0].SetView(78, 0, 0);
  
  cELF.ChangeRoom(25, -20, 248);
 }


I did not use the eWalkableAreas first as in code above so player walked on larger scaling area.

Sorry guys  :-[




#466
After combining inventory items in the inventory the mouse cursor changes to walk. How can I get it to change to the active pointer?

I can get it to change to pointer but it is not active.

cheers for all help.

This seems to work but would be better if constant then do each successful combine.
Code: AGS
function iorangejar_UseInv()
{
 if(cELF.ActiveInventory==iblackleaf && spellbook==true)
 {
  
 gInventory.Visible = true;
 mouse.Mode = eModeInteract;
 mouse.UseModeGraphic(eModePointer);
 cELF.LoseInventory(iorangejar);
 cELF.LoseInventory(iblackleaf);
 cELF.AddInventory(ibrownjar);
 Display("You now have some swell potion.");
 
 }
  else 
 {
 Display("You don't want to combine with that!");
}
}


Will leave post open for time being.



#467
Has anyone found a way to use the Starwars Scroller in 321?

cheers

#468
General Discussion / Convert avi to ogv
Fri 26/10/2012 18:05:22
Hi

Can someone assist me in how to convert normal avi videos so they are ogv?

Cheers for any help

#469
I've just had one problem solved and now I want to know why:

In my game folders (game and compiled) i have agssave's listed. I can't recall having had them their before in the past.

Game settings perhaps?

I can't seem to find a search for this scenario.

Edit: It appears I did not put folder name for saved games


#470
I'm having some issues with using inventory on player.

Can someone please have a look for me and correct?

Will you assist?

It mainly appears to be when using crystal / chalk and using brownjar crops up a bit.

I apologise if somewhat messy

Meanwhile I will keep looking over it.

Script taken off now solved



#471
COMPLETED GAMES THREAD: http://www.adventuregamestudio.co.uk/forums/index.php?topic=47062.0

E.L.F.   And soon the darkness...

A spooky tale (with spooky music) of brave elf Elfie and a demented witch.

The arrival of a Witch shakes the once peaceful and joyful land of Elfenor.

The Witch's minions' attack brought a grim silence to the town folk.

Both its leader and citizens were unsure of what the future would bring to them.

And so, refusing to accept defeat, the bravest of the elfen community, Elfie, would step forward and try to bring an end to the curse of the Wicked Witch...

Navigate through a dark and eerie cave labyrinth (don't get disorientated), get the heart of a wild Minotaur, correctly solve a floor tile puzzle, fly a magic carpet and more.....

Chapter one has been re-written and tested ok.

This game is currently under testing.

Original character animations.

No dead ends.

640 x 480
16 bit color

Only a part of the witch's longer spell room (beware the vampire bat!)


A couple of the witch's rhino guards - watch out you don't get speared!


Careful you don't end up being thrown into the moat

#472
I placed intro.ogv into the games folder and when run the game freezes and I have to taskmon.

It is supposed to open from a gui button.

avi and wma work ok.

Any ideas/remedies as to why this should be?

cheers
#473
General Discussion / setup icon image
Thu 18/10/2012 20:38:21
Hi

I've been trying to do a decent ags setup/user icon and am not happy with the results as they are somewhat blurry.
I use an online favicon generator.

What do you consider to be a good icon maker that produces decent icons?

cheers
#474
SOLVED: CHECK DOWN

Need a small hand on this script.

An animation plays eRepeat, eNoBlock.

Depending on that animations loop frame events should happen at random.

It is not Timer based.

There are 3 options at random.

Here is what I have:

Top of room script: int ran=2;

Code: AGS
function room_RepExec()
{
 
 ran++;
 ran=Random(2);

 if  (cwitchey.View==90  && cwitchey.Loop==0 && cwitchey.Frame==2) // Then 3 options if animation at frame 2
  
 if  (ran==0)
 { 
   // Do this
 }
 else if  (ran==1)
 {
  // Do this
 }  
 else if  (ran==2)
 {
   // Do this
 }
 }


So far it does frame 2, shows an option (which has a delay of 50) and then the animation stops.

I am looking at adding if frame 5 as well.

all help much appreciated

EDIT

This seems to do the trick:

Code: AGS
function room_RepExec()
{
 ran++;
 ran=Random(2);
 
 if  (cwitchey.View==90 && cwitchey.Loop==0 && cwitchey.Frame==2) 
 {
 if(ran==0)
 {
  cELF.Say("Hello 1");
  cELF.Say("Hello 1 again");
 }
 else if(ran==2)
 {
 cELF.Say("Hello 2");
 cELF.Say("Hello 2 again");
 }
  else 
 {
 cELF.Say("Hello 3");
 cELF.Say("Hello 3 again");
 }
 }
 }


I also want to declare:
if cElf >=250 give 3 options and also if <=251 give 3 options

Can you help please

EDIT EDIT EDIT This seems to have solved the case:

Code: AGS
function room_RepExec()
{
 
 ran++;
 ran=Random(2);
 
 if  (cwitchey.View==90 && cwitchey.Loop==0 && cwitchey.Frame==2 ) 
 {
 if(ran==0 && cELF.y >=251 )
 {
  cELF.Say("Hello 1");
  cELF.Say("Hello 1 again");
 }
 else if(ran==0 && cELF.y <=250 )
 {
  cELF.Say("Hello 1");
  cELF.Say("Hello 1 again");
 }
 else if(ran==1 && cELF.y >=251 )
 {
 cELF.Say("Hello 2");
 cELF.Say("Hello 2 again");
 
 }
 else if(ran==1 && cELF.y <=250 )
 {
 cELF.Say("Hello 2");
 cELF.Say("Hello 2 again");
 
 }
 else if(ran==2 && cELF.y >=251 )
 {
 cELF.Say("Hello 3");
 cELF.Say("Hello 3 again");
 
 }
 else if(ran==2 && cELF.y <=250 )
 {
 cELF.Say("Hello 3");
 cELF.Say("Hello 3 again");
 }
 }
 }
#475
I'm trying to disable a hotspot in the global after an event. I have tried giving the hotspot a name but to no avail, global will not accept. It is used if the player uses an inventory item in a certain room.

There may be another way (room rep exec if player has inventory then hotspot disabled perhaps?)

can you help

#476
Came a cross a snag.

I have an animation event start after conditions are met. During these events the mouse is disabled (invisible).
Once the event is over the mouse is returned visible.

However, keyboard movement can still be made and I need to disable any attempt to move the player.

How can I stop keyboard movements of the player until after the events and the player can again move?

Would a way be to put a condition in global if a key is pressed ie arrow L R U D and if bool false?

Or is there a in Room script I can use;

Here is the start of events:

Code: AGS
} else if (reels ==4 && loom==true && ohandle.Graphic==256)
 {
   
  oloom.SetView(14);
  oloom.Animate(0, 2, eRepeat, eNoBlock); 
  SetTimer(1, 100);
  cELF.LockView(10);
  cELF.Animate(0, 4, eRepeat, eNoBlock);
  mouse.Visible=false; // NO MOUSE WITH THIS EVENT. BACK ON AFTER EVENT WHICH IS ON TIMERS.
  usedloom=true;
  ohandle.Graphic=257;
  }
  


If you can assist I would be grateful.

------------------------------------------

EDIT: This seems to work:

Code: AGS
}
  
   // STOP PLAYER MOVING IF LOOM ANIMATING
  
  if (keycode == eKeyLeftArrow && cELF.Room==2 && object[3].Animating)
   cELF.StopMoving();
  
  if (keycode == eKeyRightArrow && cELF.Room==2 && object[3].Animating)
   cELF.StopMoving();
   
    if (keycode == eKeyUpArrow && cELF.Room==2 && object[3].Animating)
   cELF.StopMoving();
  
  if (keycode == eKeyDownArrow && cELF.Room==2 && object[3].Animating)
   cELF.StopMoving();


Still open if there is another way.




#477
I'm contemplating getting a large monitor (32" min).

what problems may I encounter running ags and games?

cheers
#478
I'm looking for a command to stop any actions with the main character whilst some GUI's are visible.

EG  When looking at a post-it GUI I do not want the main character to

There is a close button on the post-it GUI that makes it not visible so at least one mode (arrow or hand) must be available to click the close button. Once closed the game returns and the player reacts to all cursor modes.
react to any cursor modes.
In Global repeatedly_execute_always:
Code: AGS
}
 else if (gpostit.Visible==true || gspellbook.Visible==true)
 {
   // CODE TO STOP MAIN PLAYER REACTING TO ANY CURSOR MODES.
 }


When these GUI'S are closed game returns as per normal.

What is a sure fire way of doing this?

Help appreciated.

#479
Adventure Related Talk & Chat / Tap or press?
Fri 05/10/2012 21:39:18
Hi

quick question:

Key movement: Tap or Press?

slasher
#480
Real horror story....

I get this error message pop up in my display text GUI:

Unable to load game(Error: File not found]

I am already in room and can move around but the message pops up.

Any ideas as to why?

Edit edit edit What a pilchard! I forgot to remove region restore save slot having bypassed the save slot!

slasher


SMF spam blocked by CleanTalk