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.

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

Pages: 1 2 3 [4]
46
Technical forum / Talking region entities?
« on: December 22, 2012, 08:10:24 PM »
I´ve been trying to make a region entity Talk. (Like the audio of a tape recorder or a conversation over the phone). But, although the code seems to be fine, nothing happens. I found in the fourm that this same thread has been posted in the past. But the solution for it is now outdated. I wonder if anyone knows how to do this or if the only way would be to create an invisible actor or a transparent sprite entity.

Code: [Select]
if(StateTheOffice==null)
{
  StateTheOffice.Visited = false;
  // add scene states here
  Sleep(1000);
  actor.SkipTo(226, 435);
  actor.Active = false;
  actor.PlayAnim("actors\Ray2D\dd\talk.sprite");
  actor.Talk("Who´s disturbing my rest at this hour?");
  phone.Talk("I´m sorry Mr. Hammond, I´m desperate, my wife has been taken");
  actor.GoTo (502, 450);
  actor.Talk ("I hate to be disturbed at this time in the night, but this smells really bad.");
  actor.Talk ("So let´s find her, and see what´s behind the curtain");
  actor.Active = true;
}

47
Technical forum / Re: Learning scripting == actor.hasitem(item)
« on: December 22, 2012, 12:42:19 PM »

Ok, I made it work changing (actor.HasItem) for (Game.IsItemTaken), but still I think (actor.HasItem) should work, I don´t know why but seems like the default inventory is not storing items using the main actor object or something like that.

Thanks for the help!. The survivor guide to scripting is just what I was looking for.

48
Technical forum / Re: Learning scripting == actor.hasitem(item)
« on: December 22, 2012, 12:35:55 PM »

Hi, thanks!, I tested it but at first gave me a syntax error. I think it was because in your example you didn´t close the "on click" brackets. So I tried this:

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


on "LeftClick"

{
  actor.GoToObject(this);
 
if (actor.HasItem("gun")==true)
{
 Game.ChangeScene("scenes\OfficeHallway\OfficeHallway.scene");
}

else
{
  actor.TurnTo(DI_LEFT);
  actor.Talk("I can´t get out without my basic stuff.");
}
}


But still didn´t work, the character gives the "or else" state having the item or not.
This is the Item code so you can see that the name is ok.
Code: [Select]
ITEM
{
   CURSOR_COMBINED = TRUE
   CAPTION = "A gun"
   NAME = "gun"
   IMAGE = "items\gun_I.png"
   CURSOR = "items\gun_I.png"
   CURSOR_HOVER = "items\gun_h.png"
   SCRIPT = "items\gun.script"
}

Thanks!

49
Technical forum / Learning scripting == actor.hasitem(item)
« on: December 22, 2012, 06:23:37 AM »
Hi, I´m new in this engine and I already love it. It´s incredible how much you can do with so little.
Anyway, I´m learning the basic stuff of scripting usage and I can´t get right a simple item check. I want to check items before letting the actor leave the room. Here is the code. If anyone can tell me where I´m wrong here I would be very happy!.

Code: [Select]
on "LeftClick"

{
  actor.GoToObject(this);
 
}

if (actor.HasItem("gun"))
{
 Game.ChangeScene("scenes\OfficeHallway\OfficeHallway.scene");
}

else
{
  actor.TurnTo(DI_LEFT);
  actor.Talk("I can´t get out without my basic stuff.");
}


50
Foro técnico / Aprendiendo a scriptear = Actor.hasitem(item)
« on: December 22, 2012, 06:20:09 AM »

Hola, estoy aprendiendo lo basico del lenguaje y la sintaxis de scripting de este engine. La verdad estoy fascinado con todo lo que se puede hacer con este motor.
Pero me encuentro aun en pañales a la hora de scriptear. Estoy aprendiendo lo basico pero con la documentacion y los foros no he encontrado buenas guias. A ver si alguien me puede decir que estoy haciendo mal aqui. Quiero chequear que al hacer click en el area de salida, el juego chequee si el actor tiene determinado item y asi dejarlo salir o no a la siguiente escena.
El script seria asi:

Code: [Select]
on "LeftClick"

{
  actor.GoToObject(this);
 
}

if (actor.HasItem("gun"))
{
 Game.ChangeScene("scenes\OfficeHallway\OfficeHallway.scene");
}

else
{
  actor.TurnTo(DI_LEFT);
  actor.Talk("I can´t get out without my basic stuff.");
}


Pages: 1 2 3 [4]

Page created in 0.038 seconds with 18 queries.