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

#3641
Quote from: Calin Leafshade on Sun 18/11/2012 09:59:16
does After_FadeIn() actually run? I dont think thats the default name for the function so did you create it with the editor events pane? or did you just type the function in manually?
You should do this via the Rooms events panel
#3642
Minimum of 3 frames (images) per loop for an animation to run.
#3643
QuoteTo make a more permanent change, like a change of costume, you can do this instead:
And don't for get to change its idle view .

cEgo.SetIdleView(12, 30);

will change/set the character EGO's idle view to 12. The idle view will be played if the character is idle for 30 seconds.

Simply amend above to your characters player script name.


#3644
I thank you again Crimson..

(nod)

slasher



#3645
Thanks Crimson that helped a bunch.

It appears to act as it should and with less code.

I have used to add items

Code: AGS
function Bbuy1_OnClick(GUIControl *control, MouseButton button)
{
  if (Elfers < 6)
  {
 Display("You do not have enough Elfers!");
 
}
 else
{
 arrows=(arrows+1);
 Elfers=(Elfers -6);
 LarrowsQ.Text = String.Format("%d", arrows);
 Larrowsprice.Text = String.Format("%d", arrows *6);
 Lelfers.Text = String.Format("%d", Elfers);
 SetTotalCost();
 
}
}


And this to cancel last item:
Code: AGS
function Bcancel1_OnClick(GUIControl *control, MouseButton button)
{
  
  if(arrows ==0) // checks if any in basket
 {
   Display("You have no arrows to cancel.");

 }
 else
  {
  arrows=(arrows-1);
  Elfers=(Elfers +6);
  LarrowsQ.Text = String.Format("%d", arrows);
  Larrowsprice.Text = String.Format("%d", arrows *6);
 
  
}
}



Just one more bit to complete.

After clicking the check-out button and returning to room I need for all the items to be reset to 0.

Code: AGS
 cELF.Say("That will be %d Elfers please",totalcost);
 cELF.Say("If there is anything you want to sell just let me know. I give good prices!");

 arrows=0;
 baskets=0;
 knives=0;
 ropes=0;
 torch=0;
 grapple=0;


This does not seem to occur..

Can a light be shed?

cheers

EDIT: Forgot to update labels...

Code: AGS
cELF.Say("That will be %d Elfers please",totalcost);
 cELF.Say("If there is anything you want to sell just let me know. I give good prices!");

 arrows=0;
 LarrowsQ.Text = String.Format("%d", arrows);
 Larrowsprice.Text = String.Format("%d", arrows);
 baskets=0;
 LbasketsQ.Text = String.Format("%d", baskets);
 Lbasketsprice.Text = String.Format("%d", baskets);
 knivesQ=0;
 LknivesQ.Text = String.Format("%d", knives);
 Lknivesprice.Text = String.Format("%d", knives);
 ropes=0;
 LropesQ.Text = String.Format("%d", ropes);
 Lropesprice.Text = String.Format("%d", ropes);
 torch=0;
 LtorchQ.Text = String.Format("%d", torch);
 Ltorchprice.Text = String.Format("%d", torch);
 grapple=0;
 LgrappleQ.Text = String.Format("%d", grapple);
 Lgrapprice.Text = String.Format("%d", grapple);


#3646
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


#3647
Cheers Khris
#3648
Hi Khris

I see what you mean, it's being updated before the condition!

I have it declared:

Code: AGS

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


Then:

The Elfers label changes when an item is brought or cancelled but should never go over 10.
Code: AGS
 
// STOP COUNT IF OVER 10
 } 
 if (Elfers >=  10)
 {
   Elfers= 10;
 }  



Also never under 0.

Code: AGS
 
 } 
 if (Elfers <=  0)
 {
  Elfers= 0;
 }


I do have a couple of minor issues if you have the time to help Khris?

Thank you

slasher


#3649
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




#3650
That was a silly oversight on my part.

All labels are in Rep Exec Always.

Only variables are on button clicks.

All working fine now and 'Check-Out' works to:

Code: AGS
 cELF.Say("You have bought: Arrow packs %d and Basket packs: %d.",arrows, baskets);
 cELF.Say("That will be %d Elfers please",totalcost);
 arrows=0;
 baskets=0;


(nod)

Mind you, it will lead to other queries.

cheers

slasher
#3651
Hi

Quotewhy are you setting Larrowsprice.Text in the cancel button click event?
Because it's a Cancel last order and it is done via a button. Once pressed it takes away 6 elfins from the total and lowers the quantity by 1. The cancel button now stops at 0.

They should be and now are in Rep Exec Always.

A combination of what I have plus your reply seems to work.. I will have to test it as few times before I mark this topic solved.

cheers MurrayL

This is a rough draft of what I am tying to implement:



EDIT: This part of the 'SHOP' has been solved.


#3652
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


#3653
Thank you for your comments Shadow,

This game is constantly being revised and updated.

Look out for Elfie's next adventure which will be bigger and better  (nod)

Long live Elfie...

Cheers

slasher

#3654
General Discussion / Re: Uploading..where?
Sun 04/11/2012 11:43:52
Hi

I use:

MediaFire

No problems with them so far.

slasher
#3655
Hi  Shadow1000

Glad you are giving it a play.

Hint:

Spoiler

To progress you do need a magic carpet.  Also, does the dead assassin spider have something you may need later on?
[close]
#3656
Cheers guys for your comment replies

This game is under a constant revision when / where required.

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

Thanks

"Long live Elfie!"

slasher


#3657


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






#3658
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  :-[




#3659




Counting down..........................



#3660
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.



SMF spam blocked by CleanTalk