Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

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.

Messages - fabiobasile

Pages: 1 [2] 3 4 5
16
Technical forum / Re: different approach with money
« on: September 11, 2006, 10:03:06 AM »
thanks for your patience  ;D

I think slowly i'm starting to get it finally! lol

So... for instance if i wanted to use the inventory window instead of an HUD...is there a way to apply that code in a similar way or do i have to use a different approach?

It would be neat if the desired result would me this one:


with the black area being used to display the money. That would maximize the view for the player when the inventory is not in use and minimize the clutter.

I'm wondering because i find a lot easier to tinker with the inventory if i can, that way i don't have too many elements to worry about and keep the interface graphics to a minimum since i intend to pack the scene with a lot more sprites as soon as i am done with the money thing...


17
Technical forum / Re: different approach with money
« on: September 11, 2006, 04:31:46 AM »
ok, i'll go with the window thingy :-\

i have created a window and placed it in a room (i intend to use obviously always the same window in each room), but now i don't think i can work out how to grab the amount of the money and display it. I kinda figured that i should perhaps include some code that grabs the amount off items.items or maybe just include some code in items.items... (confused)... ???

18
Technical forum / different approach with money
« on: September 09, 2006, 07:51:50 PM »
i am thinking of approaching the money thing differently

Is there a way to just pick up the money item off the ground, making it disappear and just have the amount of money picked up displayed somewhere without the money item showing anymore?

19
Technical forum / Re: NPC and actor get stuck after talking
« on: August 31, 2006, 10:25:40 PM »
nevermind, i figured it out, i simply had to remove all the quotation marks from the brackets and voila'! :)

20
Technical forum / Re: NPC and actor get stuck after talking
« on: August 31, 2006, 05:15:40 PM »
I think i solved at least the problem with the actor becoming a zombie in the next game after being killed, i used the Game.UnloadObject() which works great, but the problem is that it doesn't apply to the other actors used as NPC's...

here is my deathzone.script:

Code: [Select]
#include "scripts\base.inc"

global towerguard1;
global towerguard2;
global guard1;
////////////////////////////////////////////////////////////////////////////////
on "ActorEntry"
{
  actor.Talk("CATCH ME IF YOU CAN, LOSERS!!!");
  guard1.Talk("HE'S MAKING A RUN FOR IT!! SHOOT TO KILL!!");
  towerguard1.Talk("You are so gonna die!");
  towerguard1.PlayAnim("entities\towerguard\shotul.sprite");
  towerguard2.Talk("You asked for it, mutant!!");
  towerguard2.PlayAnim("entities\towerguard\shotul.sprite");
  actor.Talk("AAARGH!!");
  actor.PlayAnim("actors/player/dead/dead.sprite");
  Game.UnloadObject(actor);
  Game.UnloadObject("guard1");
  Game.UnloadObject("oldmartin");
  Game.ChangeScene("scenes\splash\splash.scene");
}

21
Technical forum / Re: NPC and actor get stuck after talking
« on: August 31, 2006, 02:03:58 AM »
i'm pretty sure the waypoints are placed correctly, the area where the NPC's and actor move is a mostly empty square surrounded by a fence. Also the characters, both NPC's and actor have blocked areas assigned to them so they won't bump into each other and of course waypoints too that they carry with them.

I have tried to put Game.Reset(); at the beginning of every script but still i see no changes...

I keep all the actors local so i put the Game.LoadActor() in the scene_init.script of the room.

22
Technical forum / NPC and actor get stuck after talking
« on: August 30, 2006, 12:18:38 AM »
for the sake of clarity i thought better to put this in a new post, although it is somehow connected to my other thread "actors as NPC's".

Here is what happens: my actor walks towards a gate where i positioned a trigger region, as he "on enter"'s the region, the big bad nasty guard walks up to the actor with a shotgun and says "YOU DUN WANNA GO THERE BUDDY".

At that point the guard and the actor get both stuck and can't move anymore, not even if i click on something else like taking the money...

here is the code of the warning zone:

Code: [Select]
#include "scripts\base.inc"

global NPC;
global guard1;
////////////////////////////////////////////////////////////////////////////////
on "ActorEntry"
{
  actor.Talk("...whistles...*");
  guard1.TurnTo(actor);
  guard1.GoTo(actor.X,actor.Y);
  guard1.Talk("YOU DON'T WANNA GO THAT WAY, PAL");
  guard1.GoTo(1100,600); //i had to put this line in because it's the only way to break the loop and avoid the NPC and the actor to get stuck
}

Also:

Another problem is that i positioned a death zone too, beyond the warning zone, and if the actor approaches it he gets shot and dies and i get back to the splash screen where i can start over. When the actor gets shot he uses a PlayAnim to display the sprite sequence of him dropping dead to the ground. When the game returns to the menu screen and i start another game i see that the sprite of the dead actor is still there where it dropped the last time!

Mind you i did not use the options to remember positions of anything in the scene editor, so i don't know why the sprite remains where it is even once i start a new game.

here is the code for the death zone:

Code: [Select]
#include "scripts\base.inc"

global towerguard1;
global towerguard2;
global guard1;
////////////////////////////////////////////////////////////////////////////////
on "ActorEntry"
{
  actor.Talk("CATCH ME IF YOU CAN, LOSERS!!!");
  guard1.Talk("HE'S MAKING A RUN FOR IT!! SHOOT TO KILL!!");
  towerguard1.Talk("You are so gonna die!");
  towerguard1.PlayAnim("entities\towerguard\shotul.sprite");
  towerguard2.Talk("You asked for it, mutant!!");
  towerguard2.PlayAnim("entities\towerguard\shotul.sprite");
  actor.Talk("AAARGH!!");
  actor.ForceStandAnim("actors/player/dead/dead.sprite");
 
  Game.ChangeScene("scenes\splash\splash.scene");
}


23
Technical forum / Re: actors as NPC's
« on: August 27, 2006, 05:26:05 PM »
ok i think i figurerd it out :)

for some reason the guard1 gets the actor stuck in an endless loop of Talk animation, so what i did was to add an extra line to make the guard1 walk somewhere else after he's done with his lines.  :P

lol i feel more relaxed right now  ::rock

24
Technical forum / Re: actors as NPC's
« on: August 27, 2006, 05:05:19 PM »
Mnemonic you are the man!! :-)

Now it works perfectly!

Now i have inserted another NPC, i call it "guard1" coz it's going to be one of the guards, and whenever the main actor gets too close to the exit of the camp, guard 1 says "YOU DON'T WANNA GO THAT WAY, PAL..." and then walks up to where the actor is.

The problem is that after guard1 reached the actor for some reason he repeats again his line and the both of them seem to be stuck in their Talk animation forever and the main actor is unable to move. Also for some reason when that happens, guard1 is on the foreground of everything...

lol sorry man, looks like i'm monopolizing you!  ;D


here is guard1 script:

Code: [Select]
#include "scripts\base.inc"

///////////////////////////////////////////////////////////////////////////////

global StateRoom;
global guard1;
global Idle;
////////////////////////////////////////////////////////////////////////////////

on "Talk"
{
  actor.GoTo(Scene.MouseX, Scene.MouseY);
  actor.TurnTo(this);
  this.TurnTo(actor);

  Game.Interactive = false;

  // greetings
  if(!StateRoom.TalkedToNPC) actor.Talk("*stares*");
  else actor.Talk("...");
  this.Talk("what are you staring at?");

  // set the flag, so that we know we've already talked to him
  StateRoom.TalkedToNPC = true;

  // and let the dialogue begin
  NPCDialogue();

  // restore interactivity
  Game.Interactive = true;
}


////////////////////////////////////////////////////////////////////////////////

function NPCDialogue()
{
  var Responses;
  var Selected;

  var Loop = true;

  while(Loop)
  {
    // prepare the sentences
    Responses[0] = "just wondering what's up...";
    Responses[1] = "What are you doing here?";
    Responses[2] = "i hear we have a new guest around here...";
    Responses[3] = "yeah... see ya.";

    // fill the response box
    Game.AddResponse(0, Responses[0]);
    Game.AddResponse(1, Responses[1]);
    Game.AddResponse(2, Responses[2]);
    Game.AddResponse(3, Responses[3]);

    // let the player choose one
    Selected = Game.GetResponse();

    // let the actor say the selected sentence
    // (that's why I use the array for storing the sentences)
    actor.Talk(Responses[Selected]);

// this.GoTo(1000, 500);
// this.TurnTo(actor);

    // now let the guard reply depending on the selected sentence
    if(Selected==0)
    {
      this.Talk("mind your business, pal.");
      actor.Talk("...");
    }
    else if(Selected==1) this.Talk("Look i'm working here, beat it.");
    else if(Selected==2)
    {
      this.Talk("news get around quickly... yeah we got another one of those animals in the wastes around here.");
      // go to the second branch of dialogue
      NPCDialogue2();
    }
    else if(Selected==3)
    {
      this.Talk("don't make any trouble, pal, i'm watching you.");
      Loop = false; // we want to end the dialogue
    }
  }
}



////////////////////////////////////////////////////////////////////////////////

function NPCDialogue2()
{
  var Responses;
  var Selected;
  var Loop = true;

  while(Loop)
  {
    // prepare the sentences
    Responses[0] = "so...?";
    Responses[1] = "What's he's called?";
    Responses[2] = "i see..";
    Responses[3] = "mmh...";

    // fill the response box
    Game.AddResponse(0, Responses[0]);
    Game.AddResponse(1, Responses[1]);
    Game.AddResponse(2, Responses[2]);
    Game.AddResponse(3, Responses[3]);

    // let the player choose one
    Selected = Game.GetResponse();

    // let the actor say the selected sentence
    // (that's why I use the array for storing the sentences)
    actor.Talk(Responses[Selected]);

    // now let the NPC reply depending on the selected sentence
    if(Selected==0)
    {
      this.Talk("What's it it to you?.");

//this.GoTo(990, 600);
//this.TurnTo(actor);

      this.Talk("you all look alike, you damn mutants, how the hell am i supposed to know?");
      actor.Talk("*right...*");
    }
    else if(Selected==1)
    {
      this.Talk("No one is allowed near him for now, we have reason to believe he's infected.");
      actor.Talk("I see.");
    }
    else if(Selected==2)
    {
      this.Talk("i don't know.");
      this.Talk("Are we done with the questioning?");
      actor.Talk("sure...");
    }
    else if(Selected==3) Loop = false;
  }
}


////////////////////////////////////////////////////////////////////////////////
on "LookAt"
{
  actor.GoTo(Scene.MouseX, Scene.MouseY);
  actor.TurnTo(this);
  this.TurnTo(actor);
  if(!StateRoom.TalkedToguard1) actor.Talk("A guard, i wonder if he knows what's going on with the new guy.");
  else actor.Talk("One of those dumb guards.");
}

////////////////////////////////////////////////////////////////////////////////
on "Take"
{
  actor.GoTo(Scene.MouseX, Scene.MouseY);
  actor.TurnTo(this);
  this.TurnTo(actor);
  this.Talk("Try anything funny and i'll open a can of whoop on your ass.");
}

////////////////////////////////////////////////////////////////////////////////
on "LeftClick"
{
  actor.GoTo(Scene.MouseX, Scene.MouseY);
  actor.TurnTo(this);
  this.TurnTo(actor);
}



////////////////////////////////////////////////////////////////////////////////


and here is the redzone script (the region that triggers guard1's behavior):

Code: [Select]
#include "scripts\base.inc"

global NPC;
global guard1;
////////////////////////////////////////////////////////////////////////////////
on "ActorEntry"
{
  actor.Talk("...whistles...*");
  guard1.TurnTo(actor);
  guard1.GoTo(actor.X,actor.Y);
  guard1.Talk("YOU DON'T WANNA GO THAT WAY, PAL");
}

25
Technical forum / Re: actors as NPC's
« on: August 26, 2006, 10:04:37 PM »
well the scene is not very cluttered at all and there is nothing wrong with the waypoints otherwise the acor wouldn't be able to walk up to the NPC...

26
Technical forum / Re: actors as NPC's
« on: August 25, 2006, 10:31:12 PM »
turns out it still not working and nothing abnormal shows in the logs... the NPC just won't move at all when GoTo is pointing at the actor or any other entity in the scene. It only works with coordinates...

27
Technical forum / Re: actors as NPC's
« on: August 25, 2006, 04:33:11 PM »
i know it should work, which means that there must be something else in the way... whenever i use that code the NPC simply refuses to walk anywhere... i'm really confused on this one... ???

28
Technical forum / I FIGURED IT OUT!!
« on: August 25, 2006, 02:47:55 AM »
It was so easy i can't believe it...

All i had to do was to use the simplest function in WME!
Code: [Select]
  actor.GoTo(Scene.MouseX, Scene.MouseY);by implementing it into the NPC script it doesn't actually affect the NPC in anyway but it allows the actor to be tricked into walking up to the NPC, by simply walking wherever the mouse clicked!

Well of course this trick solves the problem... but i just wonder if i really HAVE to use this trick or if i can actually use the more logical principle which i tried before...

For example if i want an NPC to follow the actor around, in case for example of a party member, a combat enemy or a stalker, how do i do that? Obviously NPC.GoTo(actor); has shown ineffective...

29
Technical forum / Re: actors as NPC's
« on: August 25, 2006, 01:10:40 AM »
Ok i have reinstalled WME and it seems to be working now, i don't know for some reason it just couldn't write anything in the wme.log, but now it works.

unfoortunately actor.GoTo(this) still doesn't have any effect on the scene... :'(

30
Technical forum / Re: actors as NPC's
« on: August 25, 2006, 12:45:26 AM »
Quote
log is always created in the root of the project tree of your game. there is a file called wme.log. (providing you're not running compiled version)

I'm running always in debug mode, i compile only when i'm at a point in which everything works the way i want it... this is my wme.log:

Quote
16:41: ********** DEBUG LOG OPENED 24-08-2006 (Release Build) *****************
16:41: Wintermute Engine ver 1.6.2 work, Compiled on Jun 20 2006, 22:45:48
16:41: Platform: Windows Server 2003 Service Pack 1 (Build 3790)
16:41: DirectX version: 9.0

Also i have noticed that even by adding another simple entity to the scene using the exact same way i added the NPC actor, the result is the same. The entity works in every other way except when using actor.GoTo(this) or any other variation of it.

Pages: 1 [2] 3 4 5

Page created in 0.055 seconds with 23 queries.