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

#1
Is there a way to make a object visible at a random place?
Once again I have trouble with NoBlock I think, the room is like this: player is in a cellar. There are rats running around. If the player kicks a rat and the rat close enough the rat dies.

So I have the rat (the first of them) as a character and I want a object to appear where the rat is as it dies. If that’s not possible or too hard for a novice like me I guess I just give the player the rat in the inventory but I thought I ask here first.

Here is my code:
Code: ags

// main global script file
function cRat_1_Mode8()
{
  if ((cRat_1.x - cRose.x < 200) && (cRat_1.x - cRose.x > -200) && (cRat_1.y - cRose.y < 120) && (cRat_1.y - cRose.y > -120)) {
      cRose.Say("hit");
      //object[1].Move(cRat_1.x, cRat_1.y, 5, eNoBlock, eWalkableAreas);
      //cRat_1.Transparency=100;
      //object[1].Visible=true;
      Ratisdead=true;
  }
  else{
    cRose.Say("Miss");
  }
}


Code: ags

// room script file
int beeninroom;
bool closeenoughtofight;
bool deadrathere;

function room_Load()
{
  gHealth.Visible=true;
  deadrathere=false;
}

function room_RepExec()
{
  if(deadrathere==false)
  {
    if (character[2].Moving!=1)
    {
    character[2].Walk(Random(320),Random(200));
    oDeadrat.Move(cRat_1.x, cRat_1.y, 50, eNoBlock, eWalkableAreas);
    }
  }
  if ((cRose.IsCollidingWithChar(cRat_1) == 1)&&(deadrathere==false))
  {
    cRose.Say("Oach!");
    health-=1;
  }
  if (Ratisdead==true)
  {
      cRat_1.Transparency=100;
      //oDeadrat.Move(cRat_1.x, cRat_1.y, 5, eNoBlock, eWalkableAreas);
      //oDeadrat.StopMoving();
      //Wait(100);
      deadrathere=true;
      cRat_1.Clickable=false;
      oDeadrat.Visible=true;
      //cRat_1.Solid=false;
  }
#2
Ok I have searched for the answer to this simple question but in vain, please help.
I want an object to move to a point while animating, then stop. After a cut screen (not done yet), I want the object to change view and move off screen.
But I can’t get the object to change view. It starts in view 0 or in view 1.
What do I wrong?

Code: ags

function room_AfterFadeIn()
{
  Wait(10);
  oHorseHouse.SetView(8, 1, 1);
  oHorseHouse.Animate(1, 10, eOnce, eNoBlock, eForwards);
  
  oHorseHouse.Move(334, 343, 1, eNoBlock, eAnywhere);
  //object[1].StopAnimating();
  //oHorseHouse.SetView(8, 0, 1);
  oHorseHouse.Animate(0, 10, eRepeat, eNoBlock, eForwards);
  //oHorseHouse.Move(66, 329, 1, eNoBlock, eAnywhere);
}


As you see I have tried different things but to no success

If I put a stop animate or change view it doesn’t animate at all or change view at once.
I thought the script happens line after line?  ???
#3
I trying to make a save/load gui in a blank game but I can’t get the save name to appear on the list.
I tried the wiki version and I tried copy the default one but I can’t get it to work. I tried searching here but the most versions are for older versions of AGS.
My version is 3.2.1.
This is my code


Code: ags

function btnSaveGame_OnClick(GUIControl *control, MouseButton button)
{
    int totalSaves = lstSaveGames.ItemCount;//number of saves on list
  String saveName = txtSaveName.Text; //holds value of txtSaveName textbox
  //Check for a save name.If none tell them to enter one, else go on
  if(saveName=="")
  {
    Display("Please enter a name for your save.");
    return;
  }
  //if there is no saved games yet, just save it
  if(lstSaveGames.SelectedIndex ==-1)
  {
    gSaveGame.Visible=false;
    SaveGameSlot(totalSaves+1,  saveName);
  }
  else
  {
    int checkSave=0; //runs through the list and checks for double entries
    while (checkSave!=totalSaves)
    {
      if(saveName == lstSaveGames.Items[checkSave]) //one matches, so overwrite it.
      {
        //if so overwite the selscted game
        gSaveGame.Visible=false;
        SaveGameSlot(savegameindex[checkSave],saveName);
        return;
      }
      checkSave++;
    }
    //if we've made it here, there is no match so just save it to a new slot.
    if(totalSaves <20)
    {
      gSaveGame.Visible=false;
      SaveGameSlot(totalSaves+1,saveName);
    }
    else
    {
      Display("The maximum number of saved games has been reached; overwrite or delete some old ones.");
    }
}
}


Hope someone can help or I guess I have to start over i a default game.  :-[
#4
Critics' Lounge / Girl hero
Wed 25/05/2011 13:00:15
Hello
Please help me improve on this. I just can’t draw people.  :P



There is supposed to be a purse on her hip and I thinking of adding a sword too.
The shoes looks all wrong.  :(
#5
Hi I hope I’m posting this in the right place but I’m wondering if this is possible to do?

I like the function of the Verbcoin, that you can have different verb but just three buttons but I’m not a fan of the style.
What I would like to do is have gui like the 9-verb/Scumm but just have three button: a eye, a mouth and a hand. And a label for displaying action text.

Sceen:
Ego is in a room with a window.
Player selects the eye icon. When the mouse is over the window the first time action label displays “look at window”. Player clicks window: display”it’s a window”.

Second time the player hold the mouse over the window (the eye icon still selected) display ”look through the window”. Player clicks window (second time), display “outside the window you see only water”


So is this possible to do (if you are a beginner at scripting) and any idea of what things I should be looking for in forum and manual?
I think I should look up mouse.mode but what more?
Thanks for any help!
#6
Completed Game Announcements / Rufus story
Sun 24/04/2011 12:00:42
Story:
"Long time ago, when dinosaurs roam the world and your parents where young there lived a little hairy man called Rufus.
When the weather suddenly toke a cold windy turn he decided that enough was enough and crawling into his cave with a warm mammoth blanket and a large supply of beer.
Then one morning boredom and the urge to pee drew him to take a peek outside and he found out that the world had gone warm again so he went for a walk and found out that he was on a... island?!?
And then this story begins..."

Game:
You play as Rufus a newly defrosted caveman who has woken up on a desert island. Now he’s trying to find out where he’s friends are and how to survive.

This is my third game on AGS and the first to make the download page, I hope you like it and don’t find too many bugs.  ;D

(The game is called Rufus after a cartoon my father used to draw for us when we were small, my brother and I)







Download here:
http://www.adventuregamestudio.co.uk/games.php?action=detail&id=1423
#7
Hi
How does “function room_FirstLoad()” work in a room with StateSaving = false?
I having problem with journal module and I think my problem is that I don’t fully understand that function.
Is it first_load everytime the player enter room (for example) 301?

Close this please. Wiki say that everything gets reset.
#8
Sorry to bother you all again but I cant get this to work.
It works fine for the two thing but the I want him to say that hes got enough bambo but it never gets to that part?  ???

Code: ags

function hBambo_AnyClick()
{
  //LOOK AT
  if(UsedAction(eGA_LookAt)) {
    player.Say("Some bamboo is growing over there");  
  }
  
  // Push
  else if(UsedAction(eGA_Push)) {
    player.Say("it just bends");
  }
  // Pull
  else if(UsedAction(eGA_Pull)) {
    //player.Say("Oh hey");
    if(player.InventoryQuantity[iBamboo.ID]==0&&player.InventoryQuantity[iSpindle.ID]==0)
    {
      player.AddInventory(iBamboo);
      }
      else if(player.InventoryQuantity[iBamboo.ID]==1||player.InventoryQuantity[iSpindle.ID]==1)
      {
        player.AddInventory(iBamboo2);
      }
      else if (player.InventoryQuantity[iBamboo.ID]==1&&player.InventoryQuantity[iBamboo2.ID]==1)
      {
        player.Say("I got enough right now");
      }
  }  
  // PICKUP
  else if(UsedAction(eGA_PickUp)) {
    player.Say("Its not laying around on the ground");  
  }
  
  // don't forget this
  else Unhandled();
}

#9
After all great games recently I feel kind of nervous to post here but I´m pride over my little game so here it goes anyway.
This is my third game on AGS and I think this one is gonna make it to the download page after it is finish.

You play as Rufus a newly defrosted caveman who has woken up on a desert island. Now he’s trying to find out where he is and how to survive.

(The game is called Rufus after a cartoon my father used to draw for us when we were small, my brother and I)

- graphics 90%
- puzzles 70%
- scripting 50%
- music/sound 20%







#10
Hi
I would like an npg to go to another room and perform a different action depended on the amount the player give him of a inventory item in the first room.
Any ideas how to do this?

Can I create an inventory for the npg and check InventoryQuantity? I don’t really need to see the inventory.

Or maybe I should use an int instead?

Something like if player has given 1 banana, int Banana count = 1 (check in room2) cApe change view(1). Else if int bananacount =2 , cApe change view (2)?
#11
Help
I want the player to pick up something and I want the player to walk there to pick it up. But he can only pick it up if he can reach it.
What I’m I doing wrong here:  ???

Code: ags

function oCoconut_AnyClick()
{
  //LOOK AT
  if(UsedAction(eGA_LookAt)) {
    player.Say("It's a coconut");
    
  }
  // USE
  else if(UsedAction(eGA_Use)) {
    player.Say("I'd rather pick it up.");
  }
  // Push
  else if(UsedAction(eGA_Push)) {
    Unhandled();
  }
  // Pull
  else if(UsedAction(eGA_Pull)) {
    Unhandled();
  }  
  // PICKUP
  else if(UsedAction(eGA_PickUp)) {
          if(Object.GetAtScreenXY(525, 419)==oCoconut)
      {
        player.Say("Jummy");
        cEgo.Walk(525, 419, eNoBlock, eWalkableAreas);
    
        Hunger-=10;
     }
     else
     {
      player.Say("help");
      }
  }
  //USE INV
  else if(UsedAction(eGA_UseInv)) {
    Unhandled();
  }
  // don't forget this
  else Unhandled();
}


I also have this in the room:
Code: ags

function room_Load()
{
  short waveX = oWave.X;
  short waveY = oWave.Y;
  float duration = 3.0;
  oWave2.Transparency=20;
  oWave.IgnoreScaling = false;
  oWave.TweenPosition(duration,85, 639, eLinearTween, eRepeatTween);
  oWave2.TweenPosition(duration, 483, 411, eLinearTween, eRepeatTween);
  oCoconut.TweenPosition(10.0, 513, 384, eEaseOutTween,  eReverseRepeatTween);
  
    
}
#12
Hi
I have a character (cboar2) behind a rock and I don’t want the player to know it’s there before he finds it. But if you have the mouse over the rock the action label tells you it’s there.
What to do?
This is my code:

Code: ags

function room_RepExec()
{
bool found;
int x, y;
  if(BoarOut==0)
  {
    cBoar2.Transparency=100;
  }
  else if(BoarOut==1)
  {
    cBoar2.Transparency=0;
  }
  if(!cBoar2.Moving){
  while(!found){
    x=Random(Room.Width);
    y=Random(Room.Height);
    if(Region.GetAtRoomXY(x,y)==region[2])found=true;

  }
  cBoar2.Walk(x, y, eNoBlock, eAnywhere);
}
}
#13
Hi I am trying to make like a whack-a-mole game in my game. The player is trying to catch a crab. I really want it to appear random to but haven’t gotten so far jet.
This is my problem, after the player catch the crab it is still visible on the screen?
This is my code:
Code: ags

function room_RepExec()
{
  if (clock>0) {
    clock++;
  }
  if (clock==20){
    oCrab3.Transparency=0;
    object[2].Move(360, 230, 10, eNoBlock, eAnywhere);
    object[0].Move(324, 300, 10, eNoBlock, eAnywhere);
    //character[2].y = 287;
  }
    else if (clock==400) {
      oCrab3.Transparency=100;
      object[2].Move(140, 230, 10, eNoBlock, eAnywhere);
      oCrab2.Transparency=0;
      object[1].Move(448, 287, 10, eNoBlock, eAnywhere);
      
      //character[3].x = 448;
      //character[3].y = 287;
      
  }
    else if (clock==600) {
      oCrab2.Transparency=100;
      object[1].Move(500, 300, 10, eNoBlock, eAnywhere);
      oCrab1.Transparency=0;
      object[0].Move(224, 128, 10, eNoBlock, eAnywhere);
      
      //character[2].x = 224;
      //character[2].y = 128;
      
  }
    else if (clock==800){
      oCrab1.Transparency=100;
      oCrab2.Transparency=100;
      oCrab3.Transparency=100;
      clock=1;
    
  }
  
  
}


It must be because the game check the visible in the game repeat but I must have there or?
I use 9verb and AGS 3.2

this is the code on the crab:

Code: ags

function oCrab1_AnyClick()
{
  // LOOK AT
  if(UsedAction(eGA_LookAt)) {
    player.Say("Its a crab with catching claws");
  }
  // OPEN
  else if (UsedAction(eGA_Open)) {
    Unhandled();
  }  
  // CLOSE
  else if (UsedAction(eGA_Close)) {
    Unhandled();
  }  
  // USE
  else if(UsedAction(eGA_Use)) {
    Unhandled();
  }
  // Push
  else if(UsedAction(eGA_Push)) {
    Unhandled();
  }
  // Pull
  else if(UsedAction(eGA_Pull)) {
    Unhandled();
  }  
  // PICKUP
  else if(UsedAction(eGA_PickUp)) {
    player.Say("Finelly");
    oCrab1.Visible=false;
    cEgo.AddInventory(iCrab);
  }
  //USE INV
  else if(UsedAction(eGA_UseInv)) {
    Unhandled();
  }
  // don't forget this
  else Unhandled();
}

#14
Hello
I need help with Global variables, please. This is the first I have made.

I have made a global variable named Hunger (int) with a value of 100.

In function room_RepExec() I got this code:

Code: ags

function room_RepExec()
{
  if(Hunger>150)
  cEgo.LockView(3);
  cEgo.Animate(0, 5, eOnce, eBlock);
  Hunger-=50;
  cEgo.UnlockView();
}


Now I want the player to do a animating if his hunger is greater than 100 and the stop. But as soon as the game starts the player starts walking and hunger is counting down.
If I put:

Code: ags

function room_RepExec()
{
  if(Hunger<150)
  cEgo.LockView(3);
  cEgo.Animate(0, 5, eOnce, eBlock);
  Hunger-=50;
  cEgo.UnlockView();
}


… the player does the animating endlessly and hunger is counting down. What do I wrong?

#15
General Discussion / Which language to learn?
Mon 20/09/2010 12:52:33
I have had an idea for a game for a long time. Now I have come to understand that I can’t do it without learning some programming.
But I don’t know which I should choose?

I understand that this game I thinking of will take a long time to make and that it probably never will be finish but that’s ok, I just don’t want to start with one language only to figure out that I can’t make it with that one.

To give you an idea; I’m thinking of a virtual world game. I want time to past in the game affecting the world: crops growing, people to have hunger and thirst, day and night. Think the Settlers, Sims and Civilization.
Someone will probably say that why don’t I go and play Runescape but that one like many of those games are really just about fighting and I want a game about growing and making things. And it would be fun to make it myself.

My brother works with flash and he think I should learn that as he can help me with it but as far as I have seen there is no game like the one I want to make with flash (?)

It would also be fun if it could be a game you could play over the internet.

Anyone care to point me in the right direction, please?
#16
Completed Game Announcements / Last Order
Tue 04/05/2010 10:02:03
Hi
Now is my second game ready. It’s just a small game for some people I know at my local pub but I hope that some of you will like it too.
Please leave comments if you play it so that I can improve on my game making until next time, thanks.

The story: You are on your way home and you are dying for one last pint before you go home. Just as you are going through the door you hear the last order bell ring, will you get one in time?



Link to download:

Last Order.rar

#17
Once again I come to you all with a easy problem that I can’t solve. :-[

In my game the player starts with 3 things. When he has loosed all items the game is over.
But I gets this: Error: type mismatch: cannot convert ‘InventoryItem*’ to ‘int’

This is what I have tried:
Code: ags


function room_RepExec()
if ((player.InventoryQuantity[iRuberband_1]==0)&&(player.InventoryQuantity[iRubberband_2]==0)&&(player.InventoryQuantity[iRubberband_3]==0))
 {
   player.ChangeRoom(8, 0, 0);
 }



When that didn’t work I put in
Code: ags
 
// main global script file

int player.InventoryQuantity[3];


but that didn’t help. :(


#18
AGS Games in Production / Last Order
Sat 03/04/2010 11:52:19
Hi!  :)
My second game is almost ready. This time is for a pub that I like to go to and the people there.
The finished game will have photos of different people over the figures that you see here.
It really just a one room game so it is very small. 

STORY:
The bell has rung for the last order and all you want is a beer. Will you get one in time?






Story 100%
Puzzles 90% 
Characters 80%
Scripting 80%
Music 100% (from Freesound (http://www.freesound.org))
Dialogs: 0%

(if anyone would like to try it out as a beta tester please let me know, that would be great!)
#19
I’m so sorry but once again I need help, please.   :-[

I want the player to change room if he can get to the hotspot but there is a object in the way that he has to move first. I get the moving part right but player don’t change room and only says the else part.

At the top of the room scrip I got
Code: ags

bool ChairIsFree;


then I got this but only the else message keeps popping up:

Code: ags

function hChair_Interact()// hand cursor
{
  if (ChairIsFree){
      oDrunk.Graphic=13;
      Display("you grab the chair real fast!");
      player.ChangeRoom(5, 200, 200);
  }
  else{
    cEgo.Say("For a Dunk guy he move rather fast!");
  }


So I tried this but the same thing happen

Code: ags

function hChair_Interact()// hand cursor
{
    if ((ChairIsFree==true)&&(oDrunk.Visible==false)){
      Display("you grab the chair real fast!");
      player.ChangeRoom(5, 200, 200);
    }
    else{
    cEgo.Say("For a dunk guy he move rader fast!");
    }
  
  
}


I know I should know this by now but I just cant get it to work  :'(
#20
I don’t want to open a new topic for this, please look at post 6 for my problem, thanks!


Hi
I’m got an idea for a small game for a friend but the more I look at it the harder it seems. So I’m wondering if someone could be kind a point me in the right direction from the start.  ;)

Game idea is like this:
Player has to get from one end of the room to the other where there is a hotspot to go the next room (end of game).
To “open” (activate) the hotspot he need to remove the obstacle in the way by shooting bullets at the start of the room. The player only got 3 bullet and 3 lives. If he hits a NPC he loses a bullet and a life. After he has hit the hotspot he only got a limit of time to move to the spot. In the middle of the room there is NPC: s moving, if the player collides with NPC: s he loses a life and has to start over again.
There is also a NPC moving behind the hotspot.

So I’m thinking like this:
Some kind of gui for heath (lives)
A timer for hotspot
Characters for the moving NPC: s in the middle, Object or Character for NPC moving in the background, random event, region for moving area.
Player starts with 3 bullet in inventory, use bullet on hotspot for shooting, if/else statement for missing or hitting the hotspot.

The more I think of this, maybe I should use an object for the obstacle (oDoor) then I can use animate object?

All ideas are greatly appreciated.
SMF spam blocked by CleanTalk