Please login or register.

Login with username, password and session length
Advanced search  

News:

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

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.

Topics - Catacomber

Pages: 1 2 [3] 4 5
31
Technical forum / Kill off an enemy with spell
« on: February 10, 2009, 06:21:35 AM »
I have set up an object (sprite) in a scene.  It's a monster and I want to kill it with a spell.

I have no problem getting rid it if I use this script on the monster--you fight it to death.

Code: WME Script
  1.  
  2. #include "scripts\base.inc"
  3.  
  4. ehealth = hud.GetControl("ehealth")//health of monster--reduced by increments of 10
  5. health = hud.GetControl("health");   //your health--reduced by increments of 5
  6.  
  7. on "LeftClick"
  8.  
  9. if(ehealth.Text == 10)
  10. {
  11. this.Active = false;
  12. this.Visible = false;
  13. ehealth.Text = 0;
  14. }
  15. else
  16. if (!(ehealth.Text == 0))
  17. {
  18. hud.SubtractHealth(5);
  19. hud.SubtractEH(10);
  20. }
  21. else
  22. {hud.SubtractHealth(5);
  23. }
  24.  
  25.  

Works fine.


But I have a spell system I'd like to work with and rather than kill off the monster by clicking on it, I'd rather click on the spell to get rid of the monster.

The spell system is in a window and when I click on the spell in the window--although it seems to be coded alright--nothing happens -- I get an error about my GetControl script for the window that holds the spells but my script to access that seems OK. 

If I put the same script on the object I want to begone, everything works fine--I'm a little bit puzzled. 

My spells are in a window that's separate from the window that has all the info about the player's and monster's health.  I'ts called up when you click on a button called spells in the window that has the info about the player's and monster's health.

32
Technical forum / Disable "Save" button
« on: February 04, 2009, 07:20:38 PM »
Is it possible to disable the "Save" button in a screen, for just that one screen, so a player cannot save there? 

33
Technical forum / Music Timer
« on: January 26, 2009, 05:21:57 PM »
This is a lazy question because I don't have the opportunity right now to check the documentation and I'm not sure the answer is there.  Any help is appreciated.

Is it possible to have music run in a scene for a specified amount of time and then move the player to a new scene when the music is over?

34
Technical forum / Video
« on: January 04, 2009, 07:58:02 PM »
Is it possible to use a small Mov, or MP4 or WMV video file in Wintermute?

35
Technical forum / How address a container entity
« on: December 24, 2008, 06:35:09 PM »
I know how to load and access a normal button, static and nested window and am experimenting now with container entities held by a window.

How do you address (access) a container entity held in a window?

After I insert a container entity in a window and link it to a sprite, if I try to load the window it's in in game.script this way (there's a global contwin; in base.inc--contwin is the name of the window; container is the name of the container; ent is the name of the sprite entity that the container holds):

Code: WME Script
  1. contwin = Game.LoadWindow("scenes\contwin.window");
  2. contwin.Visible = true;
  3. var c = contwin.GetControl("container");
  4. var ent = contwin.GetEntity("ent");
  5.  

I get a black screen and freeze.

Also to refer to the sprite entity held in the container, do you have to put its path or just its name?

And lastly--can you put a container entity that holds a sprite inside a static and access it--then how would you access that?

Any help is appreciated.  :  )

36
Game design / Displaying tasks/quests on beginning a new game
« on: December 14, 2008, 07:55:02 AM »
A little poll.  : )

37
Technical forum / Scrolling Text that would stay under an image
« on: December 12, 2008, 06:16:36 PM »
I have an image that takes up the upper part of a scene--I'd like to have scrolling text beneath the image that doesn't scroll up over the image.

I used the Credits script in the demo to get the text scrolling nicely over the scene but now I want to restrict it to the bottom, so that none of the text scrolls up over the image.  Any help is appreciated.


38
Technical forum / Memory Leaks
« on: December 12, 2008, 03:40:03 AM »
What is some advice from the pros to avoid memory leaks?  I know this can be a serious problem.  :)  I think it might be of interest generally.

39
Technical forum / Text on screen when a new scene loads
« on: December 11, 2008, 03:51:14 AM »
I'd like to have a simple message show up on screen when a scene loads without anyone having to touch anything.  :  )

F.e. "Agent Kolobok whispers from your backpack, It's snowing in the tunnels, Boss, we must be close to the weather spell thief." 

Can I do this without creating a window for the text to appear in?  I tried Game.Msg and actor.Talk and AddText (without creating a window, which I know is probably not going to work) and none of those worked, just a script error.

If I have to create and destroy a window it's OK. But was wondering if I really have to do that.  : )


40
EDITED TYPO--
I have a "gold" system and a "health" system to add/subtract player's gold and health.

Methods are defined in game.script up at the very top:

Code: WME Script
  1. global MoneyAmount = 0;
  2. method AddMoney(AddAmount)
  3. {
  4.   if(MoneyAmount==null) MoneyAmount = 0;
  5.   if(AddAmount==null) AddAmount = 0;
  6.  
  7.   MoneyAmount = MoneyAmount + AddAmount;
  8.   global overlay = Game.LoadWindow("scenes\Kolobok\overlay.window");
  9.   var MoneyDisplay = overlay.GetControl("money");
  10.   MoneyDisplay.Text = ToString(MoneyAmount);
  11. }
  12.  
  13. global HealthAmount ="";
  14. method SubtractHealth(SubtractAmount)
  15. {
  16.   if(HealthAmount==null) HealthAmount = 100;
  17.   if(SubtractAmount==null) SubtractAmount = 0;
  18.  
  19.   HealthAmount = HealthAmount - SubtractAmount;
  20.   global overlay = Game.LoadWindow("scenes\Kolobok\overlay.window");
  21.   var HealthDisplay = overlay.GetControl("health");
  22.   HealthDisplay.Text = ToString(HealthAmount);
  23. }
  24.  

-----
On a window in a scene, I have script:

Code: WME Script
  1. #include "scripts\base.inc"
  2. var touched = 0;
  3. on "LeftClick"
  4. {
  5. if (touched==0)
  6. {Game.Msg("It is a dirty window but you find some gold.");
  7. Game.AddMoney(5);
  8. touched = 1;
  9. }
  10. else
  11. {
  12. if (touched==1)
  13. {Game.Msg("It is just a dirty window.");
  14. }
  15. }
  16. }
  17.  
  18.  

On a vase in same scene I have script:

Code: WME Script
  1. #include "scripts\base.inc"
  2. var bite = 0;
  3. on "LeftClick"
  4. {
  5. if (bite==0)
  6. {Game.Msg("Exploring the vase, you feel a sharp pain in your hand as a scorpion bites you and scuttles out of the vase.");
  7. Game.SubtractHealth(5);
  8. bite = 1;
  9. }
  10. else
  11. {
  12. if (bite==1)
  13. {Game.Msg("The vase is empty.");
  14. }
  15. }
  16. }
  17.  

It doesn't work as it should.

The display in the text box in the window starts out 0 for the gold and 100 for the health, which is fine.

If I click on the window, the gold amount changes to 5.

If I click on the vase, the health decreases by 5 to 95 which is fine BUT THE GOLD GOES BACK TO 0.
If I reload the scene to start over--
Same thing if I click on the vase first, the health decreases by 5 to 95.
Then if I click on the window, the gold increases by 5 to 5 BUT the health goes back to 100.

I think I'm passing [null] here at some point somehow when I shouldn't be. 

My spirits are down because I woefully have to redo my dialogue box using the regular response system, so any help would cheer me up.  :(

41
Technical forum / Removing an entity from the scene
« on: December 06, 2008, 06:57:58 PM »
I have an entity loaded in the ini script of a scene.  As soon as he's finished doing his job (talking and giving the player something), I want to get rid of him.  But I get the error that the reference to him is undefined.

I get that error a lot and sometimes I can get rid of it and sometimes not.

In this case, since he's not a scene node, I don't know how to refer to him.

The way I refer to him when he's loaded is:

global kolobok = Scene.LoadEntity("entities\kolobok\kolobok.entity");
kolobok.SkipTo(630, 316);

If I refer to him that way when I'm trying to get rid of him, I just load another copy of him.  : |

It would be really helpful if someone could post some sort of standard way of defining a global something.

For example to define a layer I know it's
var layer = Scene.GetLayer("whatitis");

and for a scene node

var node = Scene.GetNode("whatitis");

if I'm in a window I know how to get the controls to define them as a variable
but if I'm outside that window, I'm lost as to how to refer (call) (access) those contols from a different window

This is almost 90% of my problems right now.  : )

42
Technical forum / Detach and Attach Script
« on: December 06, 2008, 08:59:16 AM »
I have a window for dialogues when you left click on an npc that shows their picture, name and dialogues.

I need to update that every time you click on a new npc so it shows the new npc's name little pic and its own dialogues.

I have a window that lays out the picture and buttons but what I'm trying to do is to detach the last script attached to the window that represents the old npc's dialogue and attach the new one that is the new npc's dialogue.  Don't know if the new script has to be in the same file as the old one.

Here is what the window looks like when you left click on the original ncp:



Here is my script originally attached to the original npc that calls this dialogue window:

#include "scripts\base.inc"
global Statekolobok;
on "LeftClick"
{
  var Box = Game.LoadWindow("scenes\Kolobok\Box.window");
    Box.Visible = true;
  }


Here is my script attached to that window that I want to use forever in the game and just make little changes to it on each npc : ) :

#include "scripts\base.inc"
 on "Buttop1"
{
var a = this.GetControl("Buttop2");
a.Text = "Ready for action. Here take this key.";
var key = Scene.GetNode("key");
actor.TakeItem("key");
}

 on "Buttop3"
{
var b = this.GetControl("Buttop2");
b.Text = "Princess Vasilisa's Book of Weather Spells is missing. That could mean mischief in the wrong hands. Let me hop in your back pack and let's go.";
actor.TakeItem("kolo");
}

on "Goodbye"
{   
var e = this.GetControl("Buttop2");
e.ParentNotify = false;
e.Text = "";
  this.Close();
}

Here is my script on the new npc.  

#include "scripts\base.inc"
global Statekolobok;
on "LeftClick"
{
  var Box = Game.LoadWindow("scenes\Kolobok\Box.window");
    Box.Visible = true;
Box.DetachScript.Box.script;
Box.AttachScript.Box2.script;
  }


The Box 2 script is just the new dialogues.

I get an error message that the game can't load Box2 script.

Do I have to make a new talk window and its accompanying script for each npc?  : (

43
Technical forum / Game Message Display
« on: December 06, 2008, 08:32:56 AM »
Where do you change the font that displays the text when you call "Game.Msg"?  I can't seem to find that.

44
Technical forum / Particles
« on: December 05, 2008, 08:49:28 PM »
All the artwork in my project is either made by me or friend(s) or purchased but I'd like to use the particles script and the snow png and drop right png from the wme particle demo.  Am I permitted to do that if I give credit at the end? And who do I give credit to?  Is there a Wintermute symbol I can insert into the game somewhere--f.e. made with the Wintermute engine [symbol]?

The project I've been working on is just a demo to work out things I want to do but am just about ready to start on a real game project and trying to get organized.

45
Technical forum / Increase or Decrease Gold Counter
« on: December 04, 2008, 07:48:42 PM »
I have a window with a small button containing a picture of a stack of gold and a button next to that to display the amount of gold the player has---this would change from time to time as the player finds or loses gold.

The name of the button that holds the amount (0, 1, 2, 3 etc) of gold the player has is Goldwin.

In the game.script file, I put

if(gold==null) gold = 0;

to start at 0

While I ask a lot of questions, this will taper off and I hope my questions are useful to other people.

 
in base.inc.

I put global Goldwin;

On left click on an object, where player would find a piece of gold f.e., I have script:

#include "scripts\base.inc"

on "LeftClick"
{
Game.Msg("Hello, World");
global GoldWin = Overlay.GetWidget("GoldWin");
GoldWin.Text=5;
}

The Game.Msg is just to let me know the object is reacting--no other reason.

Overlay is the name of the window containing the button GoldWin that is the Gold Counter.

The 0 doesn't change to 5 and this method wouldn't work correctly anyway because I have to add or subtract from the total as the game progresses.

Don't think GoldWin.Text = GoldWin +5;

would work as I don't think that text slot is sensitive to addition or subraction of a number there

Any solutions are appreciated.

Pages: 1 2 [3] 4 5

Page created in 0.037 seconds with 21 queries.