Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Entity inventory not saved then i live scene.  (Read 15043 times)

0 Members and 1 Guest are viewing this topic.

cremen

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 26
    • View Profile
    • Pink Town
Entity inventory not saved then i live scene.
« on: May 06, 2008, 08:15:40 PM »

Is it right behavior?

for WME_DEMO

at OldGuy.script i added code:

Code: [Select]
on "LeftClick"
{
  GoToObject();
  if( this.HasItem("Book") ){
this.DropItem("Book");
Game.TakeItem("Book");
  };
}

on "Book"
{
  GoToObject();
  Game.Interactive = false;
  Game.DropItem("Book");
  this.TakeItem("Book");
  Game.Interactive = true;
}

and then i give this guy book (Lovely WME Tutorial, i think) and after go to street, and go back... his inventory empty... is it right? (hey, OldGay, give back my book!!!)

P.S. sorry for my pure English.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Entity inventory not saved then i live scene.
« Reply #1 on: May 06, 2008, 09:56:06 PM »

Old guy in WME demo is only loaded in a single scene. When you leave the scene, the entity is destroyed and reloaded later when you revisit the scene.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

cremen

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 26
    • View Profile
    • Pink Town
Re: Entity inventory not saved then i live scene.
« Reply #2 on: May 07, 2008, 07:08:04 AM »

i.e. at other hand, i must using actor and not entity for it?
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Entity inventory not saved then i live scene.
« Reply #3 on: May 07, 2008, 07:46:19 AM »

no. in other words you have to make the entity global and not attached to Scene.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

cremen

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 26
    • View Profile
    • Pink Town
Re: Entity inventory not saved then i live scene.
« Reply #4 on: May 07, 2008, 08:31:44 AM »

ok. thanks. i'll try it.
Logged

cremen

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 26
    • View Profile
    • Pink Town
Re: Entity inventory not saved then i live scene.
« Reply #5 on: May 07, 2008, 03:03:32 PM »

ok i do it. it's work. but i found a little bug (?)

i created global variable:


Code: [Select]
global Inventories; // at base.inc


// at scene_init.script
if( Inventories["ENT_Box"] == null ){
   Inventories["ENT_Box"] = Game.CreateEntity("ENT_Box");
}

// at region
if( Inventories["ENT_Box"].HasItem("Some_Item") ){ // <- this code did't compile, syntax error... BUT!
  // do some, but..
}

// at region
var ent = Inventories["ENT_Box"];
if( ent.HasItem("Some_Item") ){ // <- this code compiled, and work...
  // do some,
}

i think it is'nt but, but i must...
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Entity inventory not saved then i live scene.
« Reply #6 on: May 10, 2008, 08:43:33 AM »

It's not a bug, it's a known limitation of the current script compiler.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.035 seconds with 21 queries.