Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

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

Pages: 1 2 3 [4] 5 6
46
Technical forum / Re: inventory
« on: March 19, 2005, 05:10:35 PM »
Nothing happend, it´s the same problem and it doesn´t show the item...  ???

47
Technical forum / Re: inventory
« on: March 19, 2005, 05:42:16 AM »
that´s the code:
// some variables to keep track of inventory state
#include "scripts\base.inc"
#include "scripts\keys.inc"
global InvActive = false;
global InvCurrItem = -1;
global InvCurrItemName = "";
global ClickStarted;
global ClickStartTime;
global ClickObject;


// store some of the game's attributes in global variables for convenience
Keyboard = Game.Keyboard;
Scene = Game.Scene;


// load the right-click menu
global WinMenu = Game.LoadWindow("interface\actions\actions.window");
WinMenu.Visible = false;

// load the "caption" window
var win = Game.LoadWindow("interface\system\caption.window");
global WinCaption = win.GetWidget("caption");

// load the keyboard actions menu
global WinActions = Game.LoadWindow("interface\actions.window");



global MenuObject = null;


// load our main actor
actor = Game.LoadActor3D("actors\miguel\miguel.act3d");
Game.MainObject = actor;

// run the "daemon" script
Game.AttachScript("scripts\game_daemon.script");


// which scene to load first?
Game.ChangeScene("scenes\baredificio\baredificio.scene");



////////////////////////////////////////////////////////////////////////////////
on "Keypress"
{
  // we activate/deactivate the inventory using the "I" key
  if(Keyboard.Key == "i")
  {
    InvActive = !InvActive;
   
    if(InvActive)
    {
      // no items to show
      if(Game.NumItems==0)
      {
        actor.Talk("No tengo Nada");
        InvActive = false;
        return;
      }
     
      // let the actor pull out the right item
      ShowItem();
           
    }
    else
    {
       actor.PlayAnim("inevntario");
       actor.RemoveMesh(InvCurrItemName);
       InvCurrItemName = "";
       if(Keyboard.KeyCode==VK_ESCAPE)
       {
       WinCaption.Visible = false;
       var WinMainMenu = Game.LoadWindow("interface\system\mainmenu.window");
       WinMainMenu.Center();
       WinMainMenu.GoSystemExclusive();
       Game.UnloadObject(WinMainMenu);
       }
       if(Keyboard.KeyCode==VK_PRIOR) WinActions.PrevCommand();
       else if(Keyboard.KeyCode==VK_NEXT) WinActions.NextCommand();
       else if(Keyboard.KeyCode==VK_RETURN) WinActions.ExecuteCommand();
       }
  }
  }
  // we switch items using the page-up/page-down keys
  if(InvActive)
  {
    if(Keyboard.Key== "u")
    {
      InvCurrItem = InvCurrItem - 1;
      if(InvCurrItem < 0) InvCurrItem = Game.NumItems - 1;
      ShowItem();
    }
    else if(Keyboard.Key== "j")
    {
      InvCurrItem = InvCurrItem + 1;
      if(InvCurrItem >= Game.NumItems) InvCurrItem = 0;
      ShowItem();
    }   
  }


////////////////////////////////////////////////////////////////////////////////
function ShowItem() // this function will make the actor hide the old item and pull out the new one
{
  if(InvCurrItemName!="")
  {
    actor.PlayAnim("inventario");
    actor.RemoveMesh(InvCurrItemName);
    InvCurrItemName = "";   
  }
 
  var CurrItem = Game.GetItem(InvCurrItem);
  if(CurrItem!=null)
  {
    InvCurrItemName = CurrItem.Name;
   
    // we assume the item model is stored in a MS3D file with the same name
    // we load it and attach it to actor's hand-bone
    actor.AddMesh("actors\teapot\" + InvCurrItemName, "Bip01 R Finger12");
    actor.PlayAnim("inventario");
  }
}

////////////////////////////////////////////////////////////////////////////////
on "LeftClick"
{
  // no object selected, apply click to scene
  if(Game.ActiveObject==null)
  {
    Scene.ApplyEvent("LeftClick");
    return;
  }

  // perform click start
  ClickObject = Game.ActiveObject;


  // do we need to show the verb window at all?   
  if(!ClickObject.CanHandleEvent("LookAt") &&
     !ClickObject.CanHandleEvent("Talk") &&
     !ClickObject.CanHandleEvent("Take") )
  {
     // nah, just click it
    ClickObject.ApplyEvent("LeftClick");
    ClickStarted = false;
    ClickObject = null;
  }
  else
  {
     // mark click start and remember the time
    ClickStarted = true;
    ClickStartTime = Game.CurrentTime;
  }
}

////////////////////////////////////////////////////////////////////////////////
on "LeftRelease"
{
   // 'obj' is actually the verb button the mouse was over when we released the left button
  var obj = Game.ActiveObject;
  ClickStarted = false;
 
  // we are leaving the verbs window, handle the selected verb
  if(WinMenu.Visible)
  {
     // hide the window
    WinMenu.Visible = false;
   
    // this is necessary, because we can left-click earlier than this stuff finishes
    var TempClickObj = ClickObject;
    ClickObject = null;

    // apply the verb if the object can handle it
    if(TempClickObj.CanHandleEvent(obj.Name)) TempClickObj.ApplyEvent(obj.Name);
    else
    {
      // otherwise use default event handling
      if(obj.Name=="LookAt")
      {
        actor.Talk("Looks nice.");
      }
      else if(obj.Name=="Talk")
      {
        actor.Talk("Hello...");
      }
      else if (obj.Name=="Take")
      {
         actor.Talk("I won't pick that up.");
      }
    }
  }
 
  // verbcoin is NOT visible, i.e. we go for a normal click
  else if(Game.ValidObject(ClickObject))
  {
    // did we click using an inventory item?
    if(Game.SelectedItem != null && Game.SelectedItem!=ClickObject)
    {
      var item = Game.SelectedItem;
      if(ClickObject.CanHandleEvent(item.Name)) ClickObject.ApplyEvent(item.Name);
      else
      {
        // default use handlers, same as in WME demo
        if(item.CanHandleEvent("default-use")) item.ApplyEvent("default-use");
        else if (ClickObject.CanHandleEvent("default-use")) ClickObject.ApplyEvent("default-use");
        else
        {
          ClickObject = null;
          actor.Talk("I can't use these things together.");
        }
      }
    }
    // perform normal click
    else ClickObject.ApplyEvent("LeftClick");
    ClickObject = null;
  }
}


////////////////////////////////////////////////////////////////////////////////
on "RightClick"
{
   var ActObj = Game.ActiveObject;
  if(Game.SelectedItem != null) Game.SelectedItem = null;
  else if(ActObj!=null) ActObj.ApplyEvent("RightClick");
}


on "QuitGame"
{
  // on Alt+F4 (window close)
  // load and display the quit confirmation window
  if(QuestionBox("Do you really want to quit?")) Game.QuitGame();

}




////////////////////////////////////////////////////////////////////////////////
method QuestionBox(Message, SystemExclusive)
{
   if(SystemExclusive==null) SystemExclusive = true;
   
   var Window = Game.LoadWindow("interface\system\question.window");
   Window.Center();
   Window.xMessage = Game.ExpandString(Message);
   
   if(SystemExclusive) Window.GoSystemExclusive();
   else Window.GoExclusive();
   
   var Result = Window.xResult;
   Game.UnloadObject(Window);
   
   return Result;
}

doesn´t work the man don´t show the objects, and i can´t touch keys...
any magical solutions, that you always have... ;)
thanks
  MArtín

48
Game announcements / Re: the white chamber [Due 31st March '05]
« on: March 18, 2005, 02:00:43 AM »
I really like the place´s, and i was surprised cose i´m not a fun of  anime::thumbup
Good Work and i want to see that game!!!
 Martin

49
Technical forum / Re: inventory
« on: March 08, 2005, 12:22:04 AM »
Ok thanks Mnemonic but i found some problems, first all the keyboard it´s bloked i change some keys like pg:up and down with othes cose i have the selection of the actions with those keys, and the other it´s it´s make all the moving of the inventory but doesn´t look the objects... I try a lot of combinations and didn´t work...

50
Technical forum / Re: AniProb
« on: March 02, 2005, 04:53:21 AM »
I recomend make your character in 3d studio max, with out the bones, export the character in 3ds, and then import the character on milkshape and use a bone of any premade character (for ej, of the wintermute example) and look some tutorials for assign bones and you have make a perfect character...

51
Technical forum / Re: inventory
« on: March 02, 2005, 04:47:02 AM »
not only i need the part of changing objcts...
but how can i do that... cose the thing of the animg i´m already know but how to assign a key for that, and how to know with the inventory wich animation and wich things to do... have some example with one or two objects???
thanks
 MArtin

52
Technical forum / inventory
« on: March 01, 2005, 12:56:07 AM »
ok all the time talking in 3d character...
I want to make something like Grim Fandango, so when i touch ctrl (or other key) the character scrab in a bag (animation that i make) and then all the thing of the inventory apear one at a time moving the arrows, and when i select what i want you have the object in the hand(another thing that i already know)...
please some help
 Martin

53
Technical forum / Re: alone in the dark
« on: February 23, 2005, 04:50:10 AM »
ok any help for that???
i´m so lost in scripting, i  need some example in wintermut and then i can do anything...
please i have my proyect stop
thanks
 Martin

54
Technical forum / Re: alone in the dark
« on: February 20, 2005, 03:12:21 PM »
Ok Igor that´s a good help but i can´t make it cose i´m to bad with scripting....
So i have to change my plans and make something like a shooting range in archery... any help?
i need power of the shot and distance easy to make in 3d....
thanks
 Martin

55
Technical forum / Re: alone in the dark
« on: February 19, 2005, 02:08:05 AM »
i was looking more the idea of shotting gun, or use some knife, i don´t know if somebody make something of that, some example work great with me...
(all the things in 3d, like making the scene and character are an easy part for me)
thanks
 Martín

56
Technical forum / alone in the dark
« on: February 17, 2005, 10:25:48 AM »
ok how can i make something like alone in the dark...
more like the part of shoting, the rest i know
and always in 3D
thanks
 MArtin

57
Technical forum / Re: script problem
« on: February 09, 2005, 04:32:12 AM »
ok thanks that work for that
 MArtin

58
Technical forum / Re: script problem
« on: February 08, 2005, 01:32:27 PM »
the rpoblem is that vago make an error script when it talk
something like that
22:43: Runtime error. Script 'actors\vago\vago.script', line 16
22:43:   Call to undefined method 'Talk'. Ignored.

59
Technical forum / window talk
« on: February 08, 2005, 01:30:13 AM »
I want to make a window when i have to talk with somebody.
ej:
   in the left a pic of wich is talking and in the rest of the window the speach, or the option to talk...
thanks
 MArtin

60
Technical forum / script problem
« on: February 08, 2005, 01:27:34 AM »
I want to talk between actors
I have my actor and another 3dactor called vago you can not use that

the script:
  #include "scripts\base.inc"

global Statecallejon;
global vago;
////////////////////////////////////////////////////////////////////////////////
on "Talk"
{
 
  Game.Interactive = false;
  if(!Statecallejon.TalkedTovago) actor.Talk("Hola alienigena");
  else actor.Talk("Soy yo otra ves");
  vago.Talk("Hola");
  Statecallejon.TalkedTovago = true;
  vagoDialogue();
  Game.Interactive = true;
}


////////////////////////////////////////////////////////////////////////////////
function vagoDialogue()
{
  var Responses;
  var Selected;

  var Loop = true;

  while(Loop)
  {
    Responses[0] = "¿Qué sos?";
    Responses[3] = "Es una perdida de tiempo hablar con un alienigena";

   
    Game.AddResponse(0, Responses[0]);
    Game.AddResponse(3, Responses[3]);

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

     actor.Talk(Responses[Selected]);

     if(Selected==0)
    {
      vago.Talk("Soy un Kiwutziano");
      actor.Talk("Ah si mi primo es Kiwutziano...");
      vago.Talk("No creo que sea del mismo lugar que yo");
    }
    else
    {
      vago.Talk("Lo mismo digo");
      Loop = false; // we want to end the dialogue
    }
  }
}





////////////////////////////////////////////////////////////////////////////////
on "LookAt"
{

  actor.Talk("Parece ser un alienigena amistoso");
 
}

////////////////////////////////////////////////////////////////////////////////
on "Take"
{


  actor.Talk("Creo que un conflicto intergaláctico no es la solución para tantos problemas");
}





Pages: 1 2 3 [4] 5 6

Page created in 0.064 seconds with 23 queries.