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.

Author Topic: Two entity questions  (Read 2472 times)

0 Members and 1 Guest are viewing this topic.

Mikael

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 127
    • View Profile
    • MDNA Games
Two entity questions
« on: April 05, 2007, 01:46:09 AM »

Let's say that I wanted a certain entity repeated in all (or at least lots) of the scenes in one game. Is there an easy way to do this?

Is there a way to get the hover effect when I place an inventory item over an entity ONLY when there is a possible action when clicking the inventory item on the entity?

Thanks again,

Mikael
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Two entity questions
« Reply #1 on: April 05, 2007, 12:25:33 PM »

Quote
Let's say that I wanted a certain entity repeated in all (or at least lots) of the scenes in one game. Is there an easy way to do this?
It is possible to create a standalone .entity file (unlike SceneEdit, you have to edit the definition by hand). Then you can load the entity at runtime either using the Game.LoadEntity() method, or Scene.LoadEntity() method.
Game.LoadEntity() loads the entity permanently, so it will appear in all game scenes unless you explicitly hide or unload it.
Scene.LoadEntity() only loads the entity into a current scene. Once you change to other scene, the entity is automatically unloaded.
It's up to you to decide which of these approaches is better suitable for your needs.
In WME demo, the "old guy" character is a standalone entity loaded from external .entity file.

Quote
Is there a way to get the hover effect when I place an inventory item over an entity ONLY when there is a possible action when clicking the inventory item on the entity?
Yes, the Game object provides a "SmartItemCursor" property. You set it like this: Game.SmartItemCursor = true; (e.g. in game.script) and it works like this:

If yous select an item called "book", the mouse pointer will only highlight if the underlying object's script contains an event handler such as:

on "book" ....
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Mikael

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 127
    • View Profile
    • MDNA Games
Re: Two entity questions
« Reply #2 on: April 05, 2007, 10:32:26 PM »

I'll get right to it.

Thanks!
Logged
 

Page created in 0.046 seconds with 20 queries.