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

#2821
Quote from: KhrisMUC on Thu 19/04/2007 21:48:34
Although it probably doesn't matter, I'd rather use AGS's manual for reference ;)
http://www.adventuregamestudio.co.uk/manual/Operators.htm

By the way: Have I been correct in my beliefs that AGS uses Java as its script language. I have a shallow experience in Java, and AGS script seems (at least for its "if" sentences) to be the same. Or are there differences? Should I keep studying Java and AGS separate, or combine them?
#2822
Quote from: KhrisMUC on Thu 19/04/2007 15:04:02
- or is done by ||

I'll have to remember that. My most basic programming goes back to Pascal, that I think used "OR", and that's stuck on me. I'll have to dig up the proper java counterparts somewhere, and print them out.
#2823
HAA!!!

Khris, you have just made my day!

Am I correct in believing that adding a
Code: ags

if(mouse.y <= INVHEIGHT && player.Room != X or player.Room != Y)

would make it possible to add more rooms to the list? This way Icould be sure that the inventory wont pop out accidentally during the game's intro or outro.
#2824
Cant test this out yet, but if I'm reading the code right here (doubtful but posible) wouldn't this make the inventory not work in the entire game, whereas I only need to turn it off in a certain room?

If I'm wrong and you have a moment to spend, would you mind clarifying a bit on what this actually does, so I can learn a bit about the GUI:s build and perhaps get some basics to make my own similiar ones in the future.

Thanks
#2825
Using the "Beneath a Steel Sky (template 1.1).agt" template.

GUI script:

Code: ags

  if (interface == BASSINV)
  {
    if(game.num_inv_items <= game.num_inv_displayed)	// show all items
    {
      game.top_inv_item = 0;
    }
    else	// have more items than are displayed
    {
      if (button == 2)	// right
      {
        game.top_inv_item += 5;
        if(game.top_inv_item > game.num_inv_items - game.num_inv_displayed)
          game.top_inv_item = game.num_inv_items - game.num_inv_displayed;
      }
      else if (button == 1)	// left
      {
        game.top_inv_item -= 5;
        if(game.top_inv_item < 0)
          game.top_inv_item = 0;
      }
    }
  }


With my limited ideas on how to use the "gBassinv.Visible = false;" I tried using it in the room script basically. If I'm wrong, any advise would be appreciated.

If you need any more info just ask, but be specific too. I have no idea on how to make GUI:s yet, as I only saw hope for making a game when I found an easy to use template for the GUI.
#2826
Looked up a few threads that seemed like they were about the same thing, found nothing I could get to work.

Deal's this. I'm using a BASS game template as the basis of my game, and as the mouse cursor is moved to the top of the screen, the inventory pops up.

Problem: I have a main menu screen, where it would be very nice if the inventory stayed hidden, no matter what.

Any ideas on how to make the inventory stop popping up? Is there some way to disable the GUI, and enable it again later?

Tampered around with "gBassinv.Visible = false; " but no effect was visible.
#2827
Quote from: KhrisMUC on Tue 17/04/2007 12:10:42
Sounds definitely like it would work although this is more of a game design-related question than a technical one.

Yeah, kinda offtopic, but I just wanted to ask if it sounded like it would work.

Besides, in this thread there's a ton of good stuff that I'll use, and If I come up with anything new, I'll be posting here too.
#2828
I've been thinking about having a chaser in my games...

Would the following sound like it would work (I wont type the code, 'cause I cant remember it without having AGS open in front of me)?

Two regions in the middle of a corridor. When the player steps off region 1 (left) onto the region 2(right), the character giving chase is moved immediately to the left end of the corridor, and be given a script to go to the same coordinates as the player.

This way I would not need to script any ways for the chaser (welder) to FIND the room the player is in, as the script only kicks in when the player is in a certain location. This would also make it impossible for the chaser to appear too close to the player character, and kill him off right there and then, without a possibility of escape. This way the chaser will also always appeat to be BEHIND the player, and not apperar annoyingly in FRONT of the player, like the welder did in 5 day and 7 days.

I'll try to create this within a few days, and see what happens.
#2829
Yeah, I've been noticing more and more of these nes style commands, and I've started digging them up (but I still wont bother going back and changing them all... nonononono!) so I'll be using purely the new ones in the future.

Easier than I first thought!

The game is getting closer and closer to being done! Only about five more rooms need to be made (easy as I have ready bases made for myself now), and some soundwork (mostly ripping off half life 2 sounds etc) and the theres the voice acting part.

I hope I'll be able to post you guys a finished version of this game in a FEW month's time, unless I get stuck somewhere in the future, but then I'll just return here to bother you guys!  ;)
#2830
The "old style commands" as you called them...

I've learned most of my scripting by using the ready commands you can create through clicking 'em, and it always shows you how the same thing can be made in scripting, so I've copied that.

You're asking me to relearn this stuff AGAIN in the same month ive learned the once! This equals: sorry, but no can do, at least yet. I'll keep learning as I go, so what I find is what I learn. ^^

And the offset thing worked out nicely. Lets hope that I run out of new ideas soon, so that I wont have to ask you how to get them to work any more.

Thank you, again.
#2831
ok, this problem I cannot even describe properly. I've updated the game at http://protoni.huittinen.fi/~tkahkone/Compiled.rar and the problem can be seen in the second room you can access. If I use the elevator control there, the character walks onto the elevator, and the elevator should take him down to the lower level, BUT as you can see, tha animation is off.

the script used for interacting with the elevator control is the following, and seems to need some kind of way to define a new location for the player, that is a bit lower so that the animation gets to the right place, before running the animation.

Code: ags
character[0].Walk(166, 130, eBlock);
SetCharacterView(0, 16);
AnimateCharacter(0, 0, 2, false);


#2832
HAAA!!!

Thank you!!!

*Bows down to the ground and sings in joy*

You people have, once again, saved my day AND my game!
#2833
I just realized another problem. In the current situation, the variable changes as the player steps OFF the region, but this also happen as he neters the door (there is another region behind the door, which causes the room change), so as the player is moved to the next room, the variable is again set so that the door opens itself, taking me back to square one.
#2834
I've tried working on the advise you gave me, Ashen, but I keep getting a parse error. This is the firs global variable I've created, so I put the whole script here, in case you can find out what it keeps complaining about. I've been changing bits and pieces of this for the last hour and something, and am gettin a little bit frustrated. ^^ This might, again, be just something I missed 'cause I lack experience, but heck!


//This is the room script for the door
#sectionstart region1_a  // DO NOT EDIT OR REMOVE THIS LINE
function region1_a() {
  // script for Region 1: Player walks onto region

if (doorsopen == false) {
SetObjectView(0, 3);
AnimateObject(0, 1, 3, false);
// this opens the door
//the next line has an error(?)
doorsopen == true;
}
}
#sectionend region1_a  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart region1_b  // DO NOT EDIT OR REMOVE THIS LINE
function region1_b() {
  // script for Region 1: Player walks off region
if (doorsopen == true) {
SetObjectView(0, 4);
AnimateObject(0, 1, 3, false);
// this closes the door
doorsopen == false;

}

//This is the global script used to create the bool
bool doorsopen;
export doorsopen;

Elsewhere in the game I have door that are opened bu pushing a switch, and I have the doors remain open as you enter/exit the door, but now the script is on a region near the door, as you can see. This poses a totally different challenge, as in the current situation, when the player enters the next room, he is already standing on the region that opens the door, and triggering the door opening animation. I cant disable the region and activate it later, because it would not close the door then, as the player get further away from the door.

Hope you're still following me here.
#2835
No biggie, but this is annoying me:

If you download the version I linked earlier, you'll see whats happening to the doors when you enter them. As you enter the next room, the door animates, and opens again behind you, even though you opened it earlier on the other side.

Any tips on how to get rid of this?

I simply have the doors animate when player steps into a region set in front of the door:

object[0].SetView(3);
object[0].Animate(1, 3);

Thanks'a'again!
#2836
Quote from: Pumaman on Sat 24/03/2007 17:45:41
Just as a side note, I'd strongly recommend against using numbered objects and characters like you've been doing:

object[0].SetView()
character[2].Walk()
etc

It's very difficult to read the code, since you don't know what object 0 is or which character 2 is. Give the objects and characters a script name in the editor, then you can do:

oDoor.SetView()
cDavid.Walk()
etc

which is much easier to read.



This may be easier to read by someone else, but I'm used to using short abbreviations and numbers in the codem and having their meanings written down in a separate .txt file.

Thanks for the tip though, and I might give it a try in the next part, but this first part will be made as it has been started.
#2837
This is no question, but I wanted those interested to see what they've helped me create here.

http://protoni.huittinen.fi/~tkahkone/Compiled.rar

The version behind the link is, as you probably guessed, far from complete, as it lacks voice acting, most sounds, most music, most rooms, and most of everything.

A friend of mine (a great drawer) has promised to help create better animations, that will be used as base for the final characters.

A proper intro will be added too, when I get there.

Thank you all, for helping me out.
#2838
Hahaha!

Thanks for the perfect readymade code! I owe you one big time!
#2839
Ok, call me an asshole for not getting this, but I just dont get the manual on this part at all.

I'm using the BASS base on my game, so I have an inventory already made. When I click on an item in the inventory, the cursor begomes the item, check.

How do I define how the same hotspots react to the use of this item on them?

As in: when I pick a gun from the inventory, and then click on another character, how do I get the shooting to actually happen? (No, I'm not asking about how to assign the views and loops here. Just to be clear.)

UseInventory on character/hotspot? Probably, but what kind of scripts do I define there, and how do I define which inventory item the hotspot reacts to?
#2840
Ok, I'll take some time to read the manuals.

I'll admit it, I get bored reading manuals, and I just want to get creating and learn as I go, thats why I keep asking this stuff.

Thanks again for all the help.
SMF spam blocked by CleanTalk