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

#1
At last answer us, say if you will upload it or not please.
#2
The link is dead, can you please reupload it?

Thanks.
#3
Thank you Khris, you are the best.
#4
Thanks for the responses, I'll take a look to the post and the "extender functions" in the manual and, if at last, can't make it the solution provided by Khris works fine, so add a few lines of code to the script is not a great problem.
#5
Thanks Cassiebsg but, how can I make this?
#6
Well lets see if I can explain myself a little bit more, my English is not as good as I would like... Google helps, but not to much  :embarrassed:

Quote from: Haggis on Sun 08/12/2019 17:45:45
EDIT - to add clarity to the above - you would create a view for each speech animation, then prior to the dialogue starting you would generate a random number, which would set the character speech view to one of your various speech views.

Yes Haggis, I have the "standard" animation for the character when he talks, but I want change the animation depends the situation or who he is talking to.
I have created 2 new views with the second and the third animation. The normal animation is the first in my first post, so when my character talks with other the animation plays correctly.


Code: ags

cCharacter.Walk(12, 84, eBlock, eWalkableAreas);
cCharacter.Say("Hello, who are you?");


But in certain situations or depending on who you are talking to, I want to change the animation of speaking to one of the other two, so  I add before my character talks this:
Code: ags

cCharacter.Walk(12, 84, eBlock, eWalkableAreas);
cCharacter.ChangeView(2); //for the second animation or 3 for the third animation
cCharacter.Say("Hello, who are you?");


The problem is that AGS still talk with the animation defined in Character SpeechView. If I use the Character.LockView() and Character.Animate() functions to change the animation, depends on the parameters I use in Character.Animate() makes one thing or another.
Code: ags

cCharacter.Walk(12, 84, eBlock, eWalkableAreas);
cCharacter.Lock(2); //for the second animation or 3 for the third animation
cCharacter.Animate(2, 0, 5, eBlock, eForwards); // with this first play the animation and then speak
cCharacter.Animate(2, 0, 5, eNoBlock, eForwards); // with this play the first frame of the animation, stop it, and then speak
cCharacter.Say("Hello, who are you?");
cCharacter.UnlockView(); //returns to NormalView


If you need any more information please ask for it and I will try to provide it.
Thanks.

#7
Hello Everyone,

It's there posible to have more than a view to do the same action?
I know that AGS have ChangeView() and LockView() functions, but when I try to change the view and use Character.say() AGS always play the standard view defined for Talk.
What I try to do is this.

Say with standard animation                                Say with a second animation                               Say with a third animation
                                                                                                                

Thanks in advance.
#8
Ok, thats it... thank you Crimson Wizard and eri0o.
#9
Hello (once again)

I'm having any problems with the "If" and "else" statements. I think I'm not using them correctly and I'm going mad. I have this codes:

Code in GlobalScript.asc
Code: ags
 
function cMiniSpider_AnyClick()
{ 
  // WALK TO
  if (UsedAction(eMA_WalkTo)) {
    Go();
  }
  // TALK TO
  else if (UsedAction(eGA_TalkTo)) {
    if (cSpider.Room == 30){
      cSpider.Say("Hola.");
      cMiniSpider.Say("Hola, señor.");
      cSpider.Say("Soy una araña.");
      cMiniSpider.Say("Lo se, yo tambien pero mas pequeña.");
    }
  
    if (cSpider.Room == 40){
      cSpider.Say("¿Sabes por donde hay que seguir? ");
      cMiniSpider.Say("No.");
    }
  
    if (cSpider.Room == 90){
      cSpider.Say("¿Te resulta familiar este lago?");
      cMiniSpider.Say("Si, ya estamos muy cerca.");
    }

    else
      Unhandled();
  }
}


Code in guiscript.asc
Code: ags

function Unhandled(int door_script) {
  // unhandled USE INV
  else if (UsedAction(eGA_UseInv)) player.Say("No puedo usarlo con eso.");   

  // unhandled TALK TO
    else if (UsedAction(eGA_TalkTo)) {
      if (type==2) player.Say("No tengo nada que decirle ahora mismo.");
      else player.Say("No tengo nada que decir.");
    }
}


The problem is that when I start talking everything is going fine, but always ends with "No tengo nada que decirle ahora mismo.", no matter in what room are the character. I have try:
Code: ags

else
  Unhandled();

and:
Code: ags

else {
  Unhandled();
{


with the same result, says what he has to say, but alwasy ends with "No tengo nada que decirle ahora mismo."

Any idea?

Thanks in advance
#10
Quote from: Khris on Mon 11/11/2019 12:57:05
Ha, I completely missed that thanks to the flawless indentation :)

Btw, I guess those .Transparency lines are supposed to fade out the sprites but it won't work like that. As I'm sure you have noticed, the sprite simply turns invisible immediately. You'll want a loop with a  Wait(1);  inside to have a visible fade (and use a custom function for that in order to avoid tons of duplicate code).

Yes you're right, it turns invisible immediately. I'll try Wait(1); and see what happens.

Thank you.
#11
Quote from: CaptainD on Mon 11/11/2019 10:31:18
The problem might be that you don't have the ELSE function (lines 17-26) encapsulated with {}.

Ok thats it, now works fine.

Thank you.
#12
I have add the line "Display("I've been here before"); in the first part of the room_LeaveTop function.
When players enter firts time in the room don't display nothing, when player enter for second time in the room shows "I've been here before" but still get the error message.
The line mentioned in the error message is line 20 of first snippet.

Thanks
#13
Hello again

As I said in my first post, I have been using AGS for only a few days and, although most of the problems presented to me I have been able to solve them with the help and documentation, there are things I do not know how to solve them.
In my game there is a mini-spider that follows the player through the rooms, but in certain rooms I would like to stay in it and the player could move between rooms without the mini-spider following.
When both spiders enter a room the code works perfectly, but when it does only the player I am not able to return to the room where the mini-spider is without giving me an error.
I leave the code I use in the two rooms to see if anyone can help me.

Code to room 10
Code: ags

function room_FirstLoad()
{
  cSpider.Walk(278, 133, eBlock, eWalkableAreas);
  cMiniSpider.EnterRoom(10, 330, 135, eDirectionLeft);
  cMiniSpiderWalk(251, 138, eBlock, eAnywhere);
}

function room_LeaveTop()
{
  if (HasPlayerBeenInRoom(11)) {
    cSpider.Transparency=30;
    cSpider.Transparency=60;
    cSpider.Transparency=100;
    cSpider.ChangeRoom(11, 10, 117, eDirectionRight);
  }
  else
    cSpider.Transparency=30;
    cSpider.Transparency=60;
    cSpider.Transparency=100;
    cMiniSpider.Walk(164, 92, eBlock, eWalkableAreas);
    cMiniSpider.Transparency=30;
    cMiniSpider.Transparency=60;
    cMiniSpider.Transparency=100;
    cSpider.ChangeRoom(11, 10, 117, eDirectionRight);
}


Code to room 11
Code: ags

function room_FirstLoad()
{
  cSpider.Transparency=0;
  cSpider.Walk(16, 117, eBlock, eAnywhere);
}

function room_AfterFadeIn()
{
  cMiniSpider.Transparency=0;
  cMiniSpider.EnterRoom(11, 0, 117, eDirectionRight);
  cMiniSpider.Walk(76, 122, eBlock, eAnywhere);
}


When the player goes back to room 10 it makes it alone, the MinISpider stays in room 11, but when I try to go back to room 11 the game crash and give this error "MoveCharacter: character is not in current room"
Its like the HasBeenPlayerInRoom function are not working correctly because player has really been in room 11.

Thanks in advance.
#14
Ok, I think I have it.

The problem was that the sprite was not wide enough to reproduce the entire animation correctly. I have made a new sprite wider than the previous one and it works well.
However, a new problem arose, since the new sprite is wider than the previous one and wider than the normal sprite, when the animation began it moved 30 pixels to the left, but I solved it by instantly moving the spider those 30 pixels towards right and so I have solved it.
Maybe it is not be the best way to do it, but for me it's fine.
The final code is this, I put it in case someone else could serve.

Thanks to all who have help me, specially to Khris.

Code: ags

if(UsedAction(eGA_UseInv)) {
    if (cSpider.ActiveInventory == iSpiderWeb) {
      cSpider.Walk(113, 132,  eBlock, eWalkableAreas);
      cSpider.LockView(27);
      cSpider.x+=30;  // To match the walk sprite
      cSpider.Animate(2, 5, eOnce, eBlock, eForwards);
      cSpider.UnlockView(); 
    }
}


#15
Ok, here is the final result

With the "animate" code, of course with the cSpider.x +=50 line added.



With the "walk" code


How can I upload my sprites so you can see it?
#16
Thanks for all your responses.
The movement I try to reproduce is this, of course with and spider, not Indy, but the main concept is this.
I'll try to upload my own animation with the codes that I put in the first post so you can see the result.
As well the sprites Khris asked for it.

#17
Thank you Khris for your reply.

Ok, thats solve the problem of the final position, but the animation still plays in the same place, so when it finish the spider simply disappear from the start point and appear in the destination point.
#18
Hello everyone

I have started with AGS a few days ago and I have a problem with one of my character movement. I've been trying to creat a game with and spider that swing over a serie of branches but I'm having problems with the movement.
The spider has his specific view to swing, but, or it makes the movement two, or three times, or when he stop stay at the same place where he started.

This is what I'm trying so far:

Code: ags

if(UsedAction(eGA_UseInv)) {
    if (cSpider.ActiveInventory == iSpiderWeb) {
      cSpider.Walk(113, 132,  eBlock, eWalkableAreas);
      cSpider.LockView(27);
      cSpider.Animate(2, 5, eOnce, eBlock, eForwards);
      cSpider.UnlockView(); 
    }
}

This will make the move but when he finished the spider is in the same place.


Code: ags

if(UsedAction(eGA_UseInv)) {
    if (cSpider.ActiveInventory == iSpiderWeb) {
      cSpider.Walk(113, 132,  eBlock, eWalkableAreas);
      cSpider.ChangeView(27);
      cSpider.Walk(220, 122, , eBlock, eAnywhere);
    }
}

This will move the character forward to his new position, but make the swing movement two or three times depending how far he gets.

I think there is the same movement using by Lucasarts in Fate Of Atlantis when Indy flys with his whip over a hole or something.
Any help will be highly appreciated.
Thanks in advance and sorry for my bad english, I'm from Spain.
SMF spam blocked by CleanTalk