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

#881
I have three functions currently, they are enemy_attack(); enemy_bite(); and enemy_constrict();

In my global scipt I have the following:

function enemy_attack() {
  if (GetGlobalInt(106)==1) {
    //You are fighting a sneak
    SetObjectGraphic(1, 0);
    if (GetGlobalInt(108)==1) {
    SetGlobalInt(70, 5);
    SetGlobalInt(71, 0);
    SetGlobalInt(72, 0);
    SetGlobalInt(73, 0);
    SetGlobalInt(74, 1);
    SetGlobalInt(75, 1);
    SetGlobalInt(76, 1);
    SetGlobalInt(108, 0);
  }
    SetGlobalInt(107, Random(1));
    if (GetGlobalInt(107)==0) {
      //Sneak will use bite
      enemy_bite();
      GUIOn(BATTLE);
    }
    if (GetGlobalInt(107)==1) {
      //Sneak will use constrict
      enemy_constrict();
      GUIOn(BATTLE);
    }
}

function enemy_bite() {
  SetObjectGraphic(2, 0);
  SetGlobalInt(105, (GetGlobalInt(1))-(GetGlobalInt(76)+1));
  SetGlobalInt(1, (GetGlobalInt(1))-(GetGlobalInt(76)+1));
  DisplayMessage(546);
  SetObjectGraphic(2, 0);
}

function enemy_constrict() {
  SetObjectGraphic(2, 0);
  SetGlobalInt(105, (GetGlobalInt(1))-(GetGlobalInt(76)+2));
  SetGlobalInt(1, (GetGlobalInt(1))-(GetGlobalInt(76)+2));
  DisplayMessage(546);
  SetObjectGraphic(2, 0);
}



And in my GUI script I call the enemy attack(); like so

enemy_attack();

I have already imported all the functions in the script header, but I get this message when trying to save the game:

function enemy_bite() {
  SetObjectGraphic(2, 0);
  SetGlobalInt(105, (GetGlobalInt(1))-(GetGlobalInt(76)+1));
  SetGlobalInt(1, (GetGlobalInt(1))-(GetGlobalInt(76)+1));
  DisplayMessage(546);
  SetObjectGraphic(2, 0);
}

Error (line 30): already referenced name as import; you must define it before using it



How do I fix this?
#882
nonsense, if you set the object's baseline to the top of the sceen, and it is set as object 0, then everything will appear atop it, or if that wouldn't work (dunno I haven't actually tried it) you could have the objects default graphic set to 0 so it was transparent, then change it to the scrolling graphic when character stepped on region (again this would probably make everything dissapear during transition).  I think with CJ's next update he should add a transition function...
#883
I think you could do a room transition with an object, no?  You could change the default transition to "instant".  Then you make an object that is 320x200 or whatever your resolution is, then animate it starting with room1 graphics and scrolling into a room2.  You put said object in room1, then when player walks onto region that moves to room2, you animate the object using blocking, so when the animation is finished, the player is transported to room2.

Since the transition is instant, the only thing noticable is that the player character stays stationary.  (I'm assuming you've already made said object's baseline so character could be seen  ;D )  You could fix this by...well...I dunno maybe the character shouldn't be visable during the transition, either way you get my point.
#884
Ashen, you are amazing!  I never thought of doing something so simple (I over think things)  Thank you so much!  It works perfectly!
#885
apparently its not AGS's day either, for there is yet another error.  I replaced my import string name; with import char name[200];

Here's the error:

Parse error in expr near 'name'

geesh, I'm thinking about just assigning my character a name ~sigh~
#886
hmm....

I put:

import string name;

into my script header, but now there's a new error:

cannot import string; use char[] instead
#887
Alright, i deleted the two string name; lines and added a string name; line to the pointy tip top of the global script, but now an error comes up:

error in room script
undifined symbol 'name'

I'm still confused a little about your reply, I haven't messed with %s much, only %d
#888
Easiest thing would be to make a Main Menu room.  You can use hotspots to tell if player clicked a "button" that is really part of the background.
#889
In the First Time Player Enters Room script, I already have:

string name;
InputBox ("Your name?", name);
Display("So your name is %s", name);

In this display, "name", appears just as it should.
#890
okay, new script under interaction Talk to Character, reads:

string name;
DisplaySpeech(DAD, "Hey %s!",  name);
RunDialog(0); 

But he still says, "Hey !"
#891
Also, and a little off subject, check your walkable area and make sure its about 10 pixels thick, I think somewhere in the manual it specifies that the areas should be at least 8 pixels.  I could be wrong, but maybe that has something to do with it.
#892
I feel silly posting this, but for the life of me I can't figure it out.

I need to know how to replace %s with the buffer: name.Ã,  Here's the script:

DisplaySpeech(DAD, "Hiya %s!", name);

It calls "name" an undefined symbol.Ã, 
I've already defined "name" using an Input Box though, here's that script:

string name;
InputBox("Your name?", name);

The thing is, when DAD talks, he says "Hiya !"
It seems like it ignores my %s

What do I need to do?
#893
Advanced Technical Forum / Re: Sub Scripts?
Mon 06/06/2005 20:21:48
oh goody, thanks scotch!  That helps alot, I had considered that function before, but I wasn't sure if it returned to the place it was called.  Thanks alot!  I can do that!
#894
Advanced Technical Forum / Re: Sub Scripts?
Mon 06/06/2005 01:22:10
I'm not sure, just a place in the script that is completely unaccessable unless called upon, and can immediatly transport you back to the script that called it.
#895
hmm....sounds like a deep problem, try deleting every object affected and then replacing each (copy their scripts to somewhere else for your sake before deleting)
#896
come to think of it, I've had a problem similar to this before.  I had some walk behinds left over from another room, and when I re-did the room for another purpose, I forgot to wipe the walk-behinds, this made the objects invisable, but not unclickable.  I think, somewhere in your game options, you can reverse this, making objects visable, but not clickable.  In short, check your room for walk behinds left over or accidental, they could be your problem, but this sounds more serious than that........
#897
Sounds too confusing for me, I think you should just delete the room and ya know, start over from scratch :-\
#898
     Over the course of the school year my need for AGS was lessened by one thing, a TI-83 Calculator.  I took the time to learn the programming language used to make programs that can do the pythagorean therym, find missing angles, etc.  And I turned my calculator into a text based game centre.  I have both a basic RPG and a casino with roulette, card draw, dice, slot machines, and a "luck wheel".  About now you are asking my point, right?

     The TI allows a script function called a "Label"  It is more like a sub-script.  You type in "Goto A" and it searches your script for a line with "Lbl A"  On it.  It starts running script from the "Lbl A" line.  You can type a command, "Return" anytime after "Lbl A" and the script runner jumps to the line directly under "Goto A"

     My Point?  This allows for an all out game.  Particularly, it allows for RPG's.  Using the Labels (sub-scripts) you can quickly loop scripts for attacking, checking for HP below 0, and rewarding the player for a win.  My point is this, does AGS have any sort of sub-script system like this?  If so, I need to know how to access said system.

     All comments are appreciated.
#899
CANCELLED
#900
Critics' Lounge / Ancient Temple Background
Sat 21/05/2005 23:56:38
Drew this a while back, and I'm still not satisfied.Ã,  There's just something missing from this temple.Ã,  It's supposed to be a temple made of adobe and gold, but it just doesn't look right.



SMF spam blocked by CleanTalk