Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: another noob question about items  (Read 3515 times)

0 Members and 1 Guest are viewing this topic.

Dan-D

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 89
    • View Profile
another noob question about items
« on: June 19, 2008, 05:12:22 PM »

Sorry for bothering You (again) but i can't make an item to hide. Here's the script. As usual it's seems ok to me ???
Code: [Select]
#include "scripts\base.inc"

var pipe = Scene.GetNode("pipe");
var glob = Scene.GetNode("glob_pipe");
var alfa = 255;
pipe.Active = false;
global StateScene1_valve;


////////////////////////////////////////////////////////////////////////////////
on "LeftClick"
{
  StateScene1_valve.pipeTaken = true;
  Game.Interactive = false;
  Game.TakeItem("pipe");
  pipe.Active = false;
  //Scene.PlaySound("sounds\producttkn.ogg");
  for (alfa=254; alfa>1; alfa=alfa-20)
{
pipe.AlphaColor = MakeRGBA(255,255,255,alfa);
Sleep(50);
}
  pipe.Active = false;
  Game.Interactive = true;
  Game.InventoryGlob(glob);


 
}
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: another noob question about items
« Reply #1 on: June 19, 2008, 05:33:17 PM »

What is it supposed to do and what does it do in reality? I suppose you're trying fade the pipe entity out, however you deactivate it before the fading.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Dan-D

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 89
    • View Profile
Re: another noob question about items
« Reply #2 on: June 19, 2008, 06:27:45 PM »

Well all i need to do is hide after it been picked up. The pipe item appears in the inventory but not hiding in the scene
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: another noob question about items
« Reply #3 on: June 20, 2008, 07:03:25 AM »

Well, as far as I can tell, it should work. Providing "pipe" is a valid name of a scene entity.
Also, you can assign scene entities to inventory items directly. In SceneEdit, when editing properties of an entity, theres a field for entering item name. If you fill it, the entity will hide automatically once the item is taken.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Dan-D

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 89
    • View Profile
Re: another noob question about items
« Reply #4 on: June 20, 2008, 12:34:29 PM »

Oh I got it. Thanks!
Logged
 

Page created in 0.041 seconds with 20 queries.