Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Pages: 1 [2]  All

Author Topic: Some easy questions (newbie)  (Read 10742 times)

0 Members and 1 Guest are viewing this topic.

organican

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 74
    • View Profile
Re: Some easy questions (newbie)
« Reply #15 on: September 30, 2004, 12:23:41 AM »

I'm sorry, I can't make it work.

To try it out some more I inserted these lines in the street/scene_init.script in the WME demo:

//load our main actor
actor = Game.LoadActor("actors\new_actor\new_actor.actor");
Game.MainObject = actor;

global new_actor;
Game.InventoryObject = new_actor;

This is a new actor I added, the "add actor... generic".

Anyways, it didn't work there either. Even though I even loaded the actor whose inv I wanted to see.

Do I have to do something with the global variable? Or is it all wrong?
I could still see the book and the money (DONT show me the money...)

Here is some code from my own game:
   while(scr==2)
   {
//load our main actor
actor = Game.LoadActor("actors\spells\spells.actor");
Game.MainObject = actor;
Game.InventoryObject = spells;
this.Visible=true;
Game.InventoryVisible=true;
   Sleep(20);
   }
Sleep(20);
}
//It's in a window's script where I loop that if a certain value is so and so it will show the window with the inventory on top it.
//It works splendid. It's just that I can't change that inventory to another persons/objects so that the stuff I have there is hidden and
//replaced by some other stuff.

(I really feel like some looser here when I can't even make one easy piecey line of code to work.
And to trouble you guys so much...
Maybe I haven't learned the syntax and things like that..
This is my first "real" programming language after all.)
« Last Edit: September 30, 2004, 01:28:56 AM by organican »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Some easy questions (newbie)
« Reply #16 on: September 30, 2004, 06:48:24 AM »

Quote
global new_actor;
Game.InventoryObject = new_actor;

This will not work unless you fill the new_actor variable with something. Like:
new_actor = Game.LoadActor("some_file.actor");

I don't see that anywhere in the code you posted. So until you do that, the variable is empty (i has a "null" value stored in it), hence it cannot hold inventory items. Only valid game objects can.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

organican

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 74
    • View Profile
It wooorks!!
« Reply #17 on: September 30, 2004, 03:48:31 PM »

It f***ing works!! ;D

You're the man! ::rock

Now I can have two inventories. Or... *ten*
You're the man! It f***ing works! ( am I repeating myself here? Did I forget to tell you that you're the man?)

Anyways... I suspected you have to do something with the variable, I suspected it all along

Now there's nothing you can't do... the best games lie in the future...
Anything can happen now... it's all a straight line from now on... through the labyrith of time...
« Last Edit: September 30, 2004, 04:03:44 PM by organican »
Logged

organican

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 74
    • View Profile
More inventories, more sleepless nights for Mnemonic
« Reply #18 on: October 01, 2004, 01:19:42 AM »

OK. Some easy questions here (have we heard that one before?)

I just saw that the inventory.def is defined in the default.game file.
Is it possible to change this during run-time.

So that when I open one of my inventories (!) it will be defined as for example cool_stuff.def
and then one inventory can be a scroll bar and another a 5 * 5 squared (is that 5² ??) window.

I'm just asking cause it would be really nice!

Your previous answer, did that mean you can only show one inventory at a time. If that's so it's ok.
However, you (meaning I!) should be able to configure the inventory during playtime.
The question is, can it be done (in an easy way without way to much scripting and stuff)

Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Some easy questions (newbie)
« Reply #19 on: October 01, 2004, 06:19:39 AM »

No, unfortunately not. But I'm planning to make it possible in some future release. Same with the response box.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
Pages: 1 [2]  All
 

Page created in 0.043 seconds with 20 queries.