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

Pages: [1] 2 3 ... 5
1
Technical forum / Re: my first 3D actor
« on: May 27, 2008, 09:27:05 PM »
Man, it seems DirectX is both the most useful and the most neglected out of all 3D formats!

Anyways your approach of creating multiple files sounds reasonable so i'm going to try that. So basically in order to pull it off, for each file i should go find AnimationSet and add "walk", "talk", ect...?

2
Technical forum / Re: my first 3D actor
« on: May 27, 2008, 08:55:24 PM »
i created and animated the character in Maya 8.5 and exported it as .rh (Deep Exploraton native format), then i converted the rh into X and the result was disastrous, the shape was horribly deformed. The only way to to it properly was to export as LWS and then convert the LWS into X, which resulted in the model displaying and animating correctly.

3
Technical forum / Re: my first 3D actor
« on: May 27, 2008, 07:55:12 PM »
granted i fix the 3DS issue... how do i go about adding names on the X file? there is only one AnimationSet and i have no idea how to add more entries without messing up the file. I tried modifying it in Deep Exploration but no dice... there is an option to add animation sets but the changes are not saved, i even doubt it actually writes in the file.

Are there any direct x editors out there that can do this kind of job?

4
Technical forum / my first 3D actor
« on: May 27, 2008, 07:03:03 AM »
here is the deal: i have created a character and spent all day long creating animations routines for it until i got 9 loops divided as follows:

(frames range     action)
 
1-39                  stand
40-139               walk
140-189             run
190-260             pickup
268-309             punch
309-338             opendoor
350-356             sit
358-370             get up
383-410             type

The X file is flawless, i opened it in both Deep Explorations and the default X viewer. Also i have exported a basic 3ds object, a flat road with some sidewalks and decided i would try to load everything in WME.

I created a new game, i called it "Alien". I deleted Molly's folder and created a new 3D actor (Trinity). I changed Trinity's name into Alien and replaced the geometry. I changed also the reference name of the actor and changed into LoadActor3D. In the main (and still only room) i clicked on the 3D tab and added the 3DS object, which didn't show in the window, nor the actor.
In the actor definition act3D file i changed it to reflect the following:


Code: [Select]
ACTOR3DX
{
  NAME = "Alien"
  CAPTION = ""
  INTERACTIVE = TRUE
  ACTIVE = TRUE
  SCRIPT = "actors\Alien\Alien.script"
  SHADOW_IMAGE = ""
  SHADOW_SIZE = 12.0
  LIGHT_POSITION { -40, 200, -40 }
  SIMPLE_SHADOW = FALSE
;  SHADOW_COLOR { 0, 0, 0, 128 }
  SCALE = 180



  ;--- velocity
  VELOCITY = 70.0
  ANGULAR_VELOCITY = 400.0

  ;--- external data
  MODEL = "actors\Alien\Alien.x"
  FONT = "fonts\outline_white.font"
  ;CURSOR = ...

  ANIMATION
  {
    NAME="idle"
    LOOPING=TRUE

    EVENT
    {
      FRAME = 1
    }

    EVENT
    {
      FRAME = 39
    }
  }

  ANIMATION
  {
    NAME="hold"
    LOOPING=TRUE

    EVENT
    {
      FRAME = 309
    }

    EVENT
    {
      FRAME = 338
    }
  }

  ANIMATION
  {
    NAME="walk"
    LOOPING=TRUE

    EVENT
    {
      FRAME = 1
      NAME = "footstep"
    }

    EVENT
    {
      FRAME = 139
      NAME = "footstep"
    }
  }

}


When i run the game i can see the 3D actor on top of the default background image. There is no trace of the 3DS object. My actor also won't move at all. In the debug window i have the following:

Quote
11:00:22 PM:  Maximum texture size: 4096x4096
11:00:22 PM:  Engine initialized in 359 ms
11:00:22 PM: 
11:00:22 PM:  Missing image: ''
11:00:24 PM:  Error: Animation 'idle' cannot be found in the model.
11:00:24 PM:  Error: Animation 'hold' cannot be found in the model.
11:00:24 PM:  Error: Animation 'walk' cannot be found in the model.
11:00:24 PM:  WARNING: Referencing absolute path 'e:\all projects\project template\template\3ds\roadmap.geometry'. The game will NOT work on another computer.
11:00:24 PM:  WARNING: Referencing absolute path 'e:\all projects\project template\template\3ds\roadmap.3ds'. The game will NOT work on another computer.

The way i see it there is a bunch of stuff i definitely neglected to do, but i have been out of the loop for a long time so i might need to refresh my memory... any help?

5
Technical forum / Re: Out of focus?
« on: October 18, 2006, 08:37:51 AM »
Since WME, as far as i know, does not appear at a glance to support extremely complex camera tools as in high-end 3D animation packages like Maya, we must use tricks that are already embedded in the graphics.

The good news is that you decided to use photographic backgrounds for your game, which makes things easier, for you could be able (hopefully) to create a 2D actor and have the actor change its sprites into blurred ones depending how "far" or "near" he walks in respect to the horizon.

To think of it it's going to be one hell of a job (exhausting), but if you can accomplish that i'm sure it will look great.

Unfortunately this is totally untested, althought i am currently working on an isometric RPG entirely based on sprites, i am currently unable to experiment since i got my hands full with other paid work... lol

6
I have put together this whole bunch of sprites representing, isometrically, walls and props from every direction. The great thing is that i can play with them pretty much like with Lego blocks, creatting all sorts of buildings and scenes the same way as a conventional "game level editor", the only problem is that in the end i have a LOT of pieces in the scene and this becomes a problem when i want to set the walk-behind regions and collision regions...

I thought that perhaps if there was a way to set up "local" regions directly on the sprites (for example in the code contained in the .scene file) i could just lay the pieces in the scene and then open the file in the notepad and do the same thing i did with "portable" collision regions with the actor and NPCs. Before i go ahead and do it is there actually a better way to handle this?

7
Technical forum / Re: this money thing... (just a minor glitch)
« on: September 16, 2006, 04:58:02 PM »
lol i must be losing my mind! :D

Anyway i added Game.TakeItem("money"); and now everything is normal :)

8
Technical forum / this money thing... (just a minor glitch)
« on: September 14, 2006, 11:28:25 PM »
i get a script runtime error while loading the room, when i check the wme.log i get the following error:

Quote
15:26: Runtime error. Script 'scripts\game.script', line 21
15:26:   Cannot remove item 'money' from inventory

everything works thou, why do i get this error?

9
Technical forum / another question on money: negative money count problem
« on: September 11, 2006, 11:05:04 PM »
i am almost positive that i'm going to need an IF statement in the money script, but i'm not really sure how to put it together...

So for the sake of clarity here is what i added to my guard1.script in order to accept a "bribe":

Code: [Select]
on "money"
{
  actor.GoTo(Scene.MouseX, Scene.MouseY);
  actor.TurnTo(this);
  this.TurnTo(actor);
  this.Talk("I don't know what you expect out of giving me this money but thanks.");
  Game.AddMoney(-100);
}

this works in a way that the 100 dollars get subtracted whenever i pick up the money from the inventory and click them on the guard1 actor/entity

What i want to achieve is a piece of code that makes the money item disappear from the inventory as the money counter reaches zero. Obviously any amount being subtracted that leads to a negative number should end the transaction with no results and perhaps with a message like "You don't have enough money".

10
Technical forum / Re: different approach with money
« on: September 11, 2006, 10:21:55 PM »
wow, now it looks like it works!

The only thing is that after my character gets killed by the guards, the game restarts with the amount set to 300 dollars, but then when i pick up the money the count restarts from 100 dollars...

11
Technical forum / Re: different approach with money
« on: September 11, 2006, 07:54:44 PM »
nope... i gotta contraddict myself again... :(

i thought it displayed the amount because it shown the number 100, but no matter how many money items i pick up the number is still 100...

 :'(

12
Technical forum / Re: different approach with money
« on: September 11, 2006, 07:47:53 PM »
oh! i found out why!

Code: [Select]
global MoneyAmount = 0;
method AddMoney(AddAmount)
{
  MoneyAmount = MoneyAmount + AddAmount;
 
  var InvWindow = Game.GetInventoryWindow();
  var MoneyDisplay = InvWindow.GetControl("money");
  MoneyDisplay.Text = "$" + ToString(AddAmount);
}

instead of:

Code: [Select]
  MoneyDisplay.Text = "$" + ToString(MoneyAmount);
now it displays the money amount correctly :)

13
Technical forum / Re: different approach with money
« on: September 11, 2006, 07:11:26 PM »
ARGH!

spoke too soon... :P

I got all excited about seeing some text on the inventory window that i failed to notice that instead of the money amount numbbers it simply displays

$[null]

what did i do wrong now?

14
Technical forum / Re: different approach with money
« on: September 11, 2006, 07:00:56 PM »
Mnemonic you are a King among men! :D

Now it works just the way i want it! :D

15
Technical forum / Re: different approach with money
« on: September 11, 2006, 06:47:30 PM »
mmh... it doesn't seem to work for me. All it does is the usual, it adds the money sprite in the inventory and displays the amount as any other inventory item, but nothing else happens. The picture stays the same as before :(

here is the code:

inventory.def

Code: [Select]
INVENTORY_BOX
{
  ITEM_WIDTH = 60
  ITEM_HEIGHT = 60
  SPACING = 0
  SCROLL_BY = 0
  HIDE_SELECTED = TRUE

  AREA { 91, 0, 800, 122 }
  EXCLUSIVE = FALSE
;  ALWAYS_VISIBLE = TRUE

  WINDOW
  {
    X = 0
    Y = 0
    WIDTH = 800
    HEIGHT = 50
    IMAGE = "interface\inventory.png"
  }
}
  STATIC
  {
    NAME = "money"
    X = 0
    Y = 0
    WIDTH = 100
    HEIGHT = 30
    FONT = "fonts\outline_white.font"
}


money.script

Code: [Select]
#include "scripts\base.inc"
global NPC;
global money;


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



  actor.GoToObject(this);
  actor.TurnTo(this);
   
  if(!Game.IsItemTaken("money")) Game.TakeItem("money");
 
  var MoneyItem = Game.GetItem("money");
  MoneyItem.Amount = MoneyItem.Amount + 100;
  Game.AddMoney(100);
  this.Active = false;

switch(Random(1, 5))

      {
        case 1: actor.Talk("pocket the dough... don't ask."); break;
        case 2: actor.Talk("let's grab it before somebody else does..."); break;
        case 3: actor.Talk("*foot on bill*...*whistling*...now you see it... now you don't!"); break;
        case 4: actor.Talk("better in my pockets than in somebody else's"); break;
        case 5: actor.Talk("this will look nice in my collection..."); break;
      }

Game.Interactive = true;
}


game.script

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

global MoneyAmount = 0;
method AddMoney(AddAmount)
{
  MoneyAmount = MoneyAmount + AddAmount;
 
  var InvWindow = Game.GetInventoryWindow();
  var MoneyDisplay = InvWindow.GetControl("money");
  MoneyDisplay.Text = "$" + ToString(MoneyAmount);
}

// 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\menu\menu.window");
WinMenu.Visible = false;

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


global MenuObject = null;


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


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



////////////////////////////////////////////////////////////////////////////////
on "LeftClick"
{
  // what did we click?
  var ActObj = Game.ActiveObject;
  if(ActObj!=null)
  {
    // clicking an inventory item
if(ActObj.Type=="item" && ActObj.IsDisabled != true && Game.SelectedItem==null)
{
  Game.SelectedItem = ActObj;
  WinMenu.Visible = false;
}

    // using an inventory item on another object
    else if(Game.SelectedItem != null && Game.SelectedItem!=ActObj)
    {
      var Item = Game.SelectedItem;
      if(ActObj.CanHandleEvent(Item.Name)) ActObj.ApplyEvent(Item.Name);
      else if(Item.CanHandleEvent("default-use")) Item.ApplyEvent("default-use");
      else if(ActObj.CanHandleEvent("default-use")) ActObj.ApplyEvent("default-use");
      else actor.Talk("I can't use these things together.");
    }
    // just a simple click
    else ActObj.ApplyEvent("LeftClick");
  }
  // else propagate the LeftClick event to a scene
  else
  {
    Scene.ApplyEvent("LeftClick");
  }
}



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

on "RightClick"
{
  // if inventory item selected? deselect it
  if (Game.SelectedItem != null){
    Game.SelectedItem = null;
    return;
  }

  var ActObj = Game.ActiveObject;

  // is the righ-click menu visible? hide it
  if(WinMenu.Visible == true) WinMenu.Visible = false;
  else if(ActObj!=null)
  {
    // if the clicked object can handle any of the "verbs", display the right-click menu
    if(ActObj.CanHandleEvent("Take") || ActObj.CanHandleEvent("Talk") || ActObj.CanHandleEvent("LookAt"))
    {
      // store the clicked object in a global variable MenuObject
      MenuObject = Game.ActiveObject;
      var Caption = WinMenu.GetWidget("caption");
      Caption.Text = MenuObject.Caption;

      // adjust menu's position
      WinMenu.X = Game.MouseX - WinMenu.Width / 2;
      if(WinMenu.X < 0) WinMenu.X = 0;
      if(WinMenu.X+WinMenu.Width>Game.ScreenWidth) WinMenu.X = Game.ScreenWidth-WinMenu.Width;

      WinMenu.Y = Game.MouseY - WinMenu.Height / 2;
      if(WinMenu.Y<0) WinMenu.Y = 0;
      if(WinMenu.Y+WinMenu.Height>Game.ScreenHeight) WinMenu.Y = Game.ScreenHeight-WinMenu.Height;

      // and show the right-click menu
      WinMenu.Visible = true;

      // stop the actor from whatever he was going to do
      actor.Reset();
    }
    // no verbs supported, no menu is needed; just send the RightClick event to the object
    else ActObj.ApplyEvent("RightClick");
  }
}

////////////////////////////////////////////////////////////////////////////////
on "Keypress"
{
  // on Esc or F1 key
  if(Keyboard.KeyCode==VK_ESCAPE || Keyboard.KeyCode==VK_F1)
  {
    // load and display the main menu window
    WinCaption.Visible = false;
    var WinMainMenu = Game.LoadWindow("interface\system\mainmenu.window");
    WinMainMenu.Center();
    WinMainMenu.GoSystemExclusive();
    Game.UnloadObject(WinMainMenu);
  }
}


////////////////////////////////////////////////////////////////////////////////
on "QuitGame"
{
  // on Alt+F4 (window close)
  // load and display the quit confirmation window
  WinCaption.Visible = false;
  var WinQuit = Game.LoadWindow("interface\system\quit.window");
  WinQuit.Center();
  WinQuit.GoSystemExclusive();

  // and if the user selected Yes
  if(WinQuit.xResult)
  {
    // quit the game
    Game.QuitGame();
  }
  // otherwise just unload the quit window from memory
  else Game.UnloadObject(WinQuit);
}

Pages: [1] 2 3 ... 5

Page created in 0.033 seconds with 19 queries.