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

Pages: 1 ... 10 11 [12] 13 14
166
Technical forum / Re:LoadFromFile problems
« on: February 20, 2004, 02:55:16 PM »
Well, the whole thing still didn't work. I have to do some testing...

167
Technical forum / Re:LoadFromFile problems
« on: February 18, 2004, 01:31:44 PM »
A-ha! So the contents of the container window do not disappear? (That would exmplain everything.)

168
Technical forum / Re:LoadFromFile problems
« on: February 17, 2004, 01:26:05 PM »
Well, here's the .script file for characters.script. (The other two windows are quite similar). This is a heavily edited diary script.

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

var first_slot_deletes_data;
var second_slot_deletes_data;
var third_slot_deletes_data;
var fourth_slot_deletes_data;

var id1;
var id2;
var id3;
var id4;

var IDs=new Array();
var CurrentPage = 0;
var Pages = new Array();

var Deletes=new Array();

Redraw();
var nphil=Game.LoadEntity("entities\notepad_phil\notepad_phil.entity");

////////////////////////////////////////////////////////////////////////////////
on "block1"
{

   if(discussion==true)
   {
      if(first_slot_deletes_data==false)
      {
         question=id1;
         LargeDialogueHandler();
      }
   }

}
////////////////////////////////////////////////////////////////////////////////
on "block2"
{

   if(discussion==true)
   {
      if(second_slot_deletes_data==false)
      {

         question=id2;
         LargeDialogueHandler();

      }
   }

}
////////////////////////////////////////////////////////////////////////////////
on "block3"
{

   if(discussion==true)
   {
      if(third_slot_deletes_data==false)
      {

         question=id3;
         LargeDialogueHandler();

      }
   }
}

////////////////////////////////////////////////////////////////////////////////
on "block4"
{

   if(discussion==true)
   {
      if(fourth_slot_deletes_data==false)
      {

         question=id4;
         LargeDialogueHandler();
      }
   }

}


////////////////////////////////////////////////////////////////////////////////
on "close"
{

   if(discussion==true) question=false;
   go_on="go_on";
   this.Close();

}


////////////////////////////////////////////////////////////////////////////////
on "prev"
{
   if(CurrentPage >=1) CurrentPage = CurrentPage - 1;
   Redraw();
}


////////////////////////////////////////////////////////////////////////////////
on "next"
{

   if(CurrentPage < Pages.Length-1) CurrentPage = CurrentPage + 1;
   Redraw();
}

////////////////////////////////////////////////////////////////////////////////
on "locations_button"
{

/*if(discussion==false)
{
   this.Close();
   WinLocations.GoExclusive();
}else{
go_on="locations";
this.Close();
}*/

WinCharacters.LoadFromFile("notepad\locations.window");

}

////////////////////////////////////////////////////////////////////////////////
on "events_button"
{
/*if(discussion==false)
{
   this.Close();
   WinEvents.GoExclusive();
}else{
go_on="events";
this.Close();

}*/
WinCharacters.LoadFromFile("notepad\events.window");

}






////////////////////////////////////////////////////////////////////////////////
function Redraw()
{
   // get controls
var BtnPrev = this.GetControl("prev");
var BtnNext = this.GetControl("next");
var Block1 = this.GetControl("Block1");
var Block2 = this.GetControl("Block2");
var Block3 = this.GetControl("Block3");
var Block4 = this.GetControl("Block4");
 
var Page;    

Page = Pages[CurrentPage];
id1=IDs[CurrentPage];

//FIRST BLOCK
first_slot_deletes_data=Deletes[CurrentPage];
if(first_slot_deletes_data==true)
{

   Game.Msg("Ekaa ei nayteta.");
   Block1.SetFont("fonts\phyllis-strikeout.font");

}else{

   Game.Msg("Eka nautetaan");
   Block1.SetFont("fonts\phyllis.font");

}
   
SetupBlock(Block1, Page.Text1);






//SECOND BLOCK
if(CurrentPage<Pages.Length-1)
{
   Page = Pages[CurrentPage+1];
   second_slot_deletes_data=Deletes[CurrentPage+1];

   if(second_slot_deletes_data==true)
   {

      Game.Msg("Tokaa ei nayteta.");
      Block2.SetFont("fonts\phyllis-strikeout.font");

   }else{

      Game.Msg("Toka nautetaan");
      Block2.SetFont("fonts\phyllis.font");

   }

   SetupBlock(Block2, Page.Text1);
   id2=IDs[CurrentPage+1];

}else{
   SetupBlock(Block2, "");
}

//THIRD BLOCK
if(CurrentPage<Pages.Length-2)
{
   Page=Pages[CurrentPage+2];
   third_slot_deletes_data=Deletes[CurrentPage+2];
   
   if(third_slot_deletes_data==true)
   {

      Game.Msg("Kolmatta ei nayteta.");
      Block3.SetFont("fonts\phyllis-strikeout.font");

   }else{

      Game.Msg("Kolmas nautetaan");
      Block3.SetFont("fonts\phyllis.font");

   }

   SetupBlock(Block3, Page.Text1);
   id3=IDs[CurrentPage+2];

}else{
   SetupBlock(Block3, "");
}



//FOURTH BLOCK
if(CurrentPage<Pages.Length-3)
{
   Page=Pages[CurrentPage+3];
   fourth_slot_deletes_data=Deletes[CurrentPage+3];

   if(fourth_slot_deletes_data==true)
   {

      Game.Msg("Neljatta ei nayteta.");
      Block4.SetFont("fonts\phyllis-strikeout.font");

   }else{

      Game.Msg("Neljatta nautetaan");
      Block4.SetFont("fonts\phyllis.font");

   }

   SetupBlock(Block4, Page.Text1);
   id4=IDs[CurrentPage+3];

}else{
   SetupBlock(Block4, "");
}


Game.Msg(first_slot_deletes_data);
Game.Msg(second_slot_deletes_data);
Game.Msg(third_slot_deletes_data);
Game.Msg(fourth_slot_deletes_data);


   
//button states
BtnPrev.Visible = CurrentPage > 0;
BtnNext.Visible = CurrentPage < Pages.Length - 4;
 
}



////////////////////////////////////////////////////////////////////////////////
function SetupBlock(Control, Text)
{  
     if(Text==null) Text = "";
     Control.Text = Text;
}


////////////////////////////////////////////////////////////////////////////////
method AddNote(Text1)
{  
   var NewPage;
   NewPage.Text1 = Text1.contents;
   NewPage.id=Text1.id;  
   NewPage.status=Text1.removed;


   IDs.Push(NewPage.id);
   Pages.Push(NewPage);
   
   Deletes.Push(NewPage.status);
   
   Redraw();
}

////// there's no reason to use this function, but I let it be here just in case
method SkipToPage(PageNumber)
{  
   if(PageNumber%2 != 0) PageNumber = PageNumber - 1;
   if(PageNumber>=Pages.Length) PageNumber = Pages.Length - 1;
   if(PageNumber<0) PageNumber = 0;
   
   CurrentPage = PageNumber;
   Redraw();
}


////// there's no reason to use this function, but I let it be here just in case
method SkipToEnd()
{
   SkipToPage(Pages.Length-1);
}


////////////////////////////////////////////////////////////////////////////////
/*on "Keypress"
{
  var button;

  if(Keyboard.KeyCode==VK_ESCAPE)
  {
    button = this.GetControl("close");
    button.Press();
  }
  else if(Keyboard.KeyCode==VK_LEFT || Keyboard.KeyCode==VK_PRIOR)
  {
    button = this.GetControl("prev");
    if(!button.Disabled) button.Press();
  }
  else if(Keyboard.KeyCode==VK_RIGHT || Keyboard.KeyCode==VK_NEXT)
  {
    button = this.GetControl("next");
    if(!button.Disabled) button.Press();
  }
}*/

///////////////////////////////////////////////////////////////

function LargeDialogueHandler()
{
go_on="go_on";
if(question==1
|| question==2
|| question==3
|| question==4
&& character=="OldGuy")
{
   this.Close();

}else{

   var line;
   var run=Random(1,3);

   switch(run)
   {
      case 1:
         line="Naw, I don't want to ask about that.";
         break;
      case 2:
         line="Excellent, but no.";
         break;
   default:
      line="I'd rather eat garlic than ask that question!!";

   }

   Game.Interactive=false;
   nphil.Talk(line);
   Game.Interactive=true;

}


}



///////////////////////////////////////////////////////////////

method CrossOutNote(note_number)
{

var i=0;
while(IDs[i]!=note_number)
{
   i=i+1;
}

if(IDs[i]==note_number)
{

      Deletes[i]=true;
   
   }else{
   
      Game.Msg("CrossOutNote-error has occurred.");
}


Redraw();

}

169
Technical forum / Re:LoadFromFile problems
« on: February 16, 2004, 10:31:18 AM »
Yup.

170
Technical forum / Re:LoadFromFile problems
« on: February 16, 2004, 09:07:53 AM »
OK, so lt me explain better :).

I have a bunch of window files, characters.script, events.script and locations.script - each of them also has a .window file. Now, when I click the characters-button in events or locations window, I want to load the contents of the characters window to either events or locations window. But this gives a this program has performed an illegal operation widow.

Code: [Select]
on "locations_button"
{

/*if(discussion==false)
{
   this.Close();
   WinLocations.GoExclusive();
}else{
go_on="locations";
this.Close();
}*/

WinCharacters.LoadFromFile("notepad\locations.window");


}

(the old code has been commented out)
Edit: I added the missing }

171
Technical forum / LoadFromFile problems
« on: February 15, 2004, 07:22:59 PM »
Is it so that if I want to load a window with functions with similar names and variables with similar names, it's not going to work?

172
Technical forum / Re:Slider?
« on: January 20, 2004, 03:42:19 PM »
Thanks for the help, I tried search but keyword "slider" didn't come up with anything.

173
Technical forum / Slider?
« on: January 18, 2004, 06:44:05 PM »
I'm trying to create slider for controlling music volume. I have created an entity container, but I'm unable to change the position of the slider object in the window. The script of the slider-entity, slider.script, looks like this:

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

//var scrollbutton=Game.LoadEntity("\slider\slider.entity");
//scrollbutton.Visible=true;

var scrollBtn=Window.GetEntity();


on "LeftClick"
{
scrollBtn.X=200;


Game.Msg("left_CLICK");
}

on "LeftRelease"
{


Game.Msg("left_release");


}



It says it doesn't recognize GetEntity().

The x=200 is just for testing purposes :D btw

174
Technical forum / Re:Making a notepad interface
« on: January 03, 2004, 10:08:45 AM »
Sorry, MMR, I'm under a wov of silence ;) . If everything goes well, you don't have to wait too long for a playable demo. Have you visited the teaser site? http://www.foreverdreamstudios.com/games.html

Instead of making the buttons  open a window, I made them assign a value to a global variable (which I cleverly named go_on, don't ask me why); like go_on="characters", go_on="events", go_on="locations". Then, in the dialogue script:

Code: [Select]
if(Selected==4)
{

Loop=false;
Game.Interactive = true;
WinCharacters.GoExclusive();

for(var f=0; go_on!="go_on"; f=f+1)
{
if(go_on=="characters") WinCharacters.GoExclusive();
if(go_on=="events") WinEvents.GoExclusive();
if(go_on=="locations") WinLocations.GoExclusive();
}

if(go_on=="go_on")
{
//we have selected a note, and an appropriate response will be heard

Now it's stuck in the loop, until go_on=="go_on" - whic happens if you close the window or you click on a note that begins a dialogue. Phew!

175
Technical forum / Re:Making a notepad interface
« on: January 02, 2004, 07:34:49 PM »
Never mind: the notepad interface is now fully functioning! :D

176
Technical forum / Re:Making a notepad interface
« on: January 02, 2004, 04:24:07 PM »
I have a problem with the notepad system, once again. Everything else works, but...

I have three separate windows - Locations, Events and Characters. Now, when I talk to a person, and choose [Consult Notepad], the Characters-window appears by default. In each window are buttons that open the other windows. Now, if I don't want to ask about anything in the Characters window, I should be able to choose either the Events or locations window - and this works - but because the code looks like this

Code: [Select]

if(Selected==4)
      {

Loop=false;
Game.Interactive = true;
WinCharacters.GoExclusive();

Game.Interactive=false;

if(question=="1")
{
WinCharacters.CrossOutNote(1);//removes the first note

actor.Talk("Ask about the first note");


}






if(question=="2")
{

WinCharacters.CrossOutNote(2);
actor.Talk("ask about the second note");





}


if(question=="3")
{
WinCharacters.CrossOutNote(3);
actor.Talk("ask bout the third note");

}

if(question=="4")
{

WinCharacters.CrossOutNote(4);

actor.Talk("fourth note");

}


OldGuyDialogue();//after asking, go back to dialogue


...the Locations/Events window opens AND the OldGuyDialogue() script is executed, thus displaying the dialogue choices and making the screen a mess.

I tried a different method: I created one window called Notepad, and made Characters/Loacations/Events sort of sub-windows (if real subwindows can be created, I don't know how). Within the Notepad-window I could have switched between the different sub-windows  - but this didn't work, as the only way to open a window is the GoExclusive, and when another window is opened on top of the Notepad window, it makes the controls in Notepad-window unaccessible.

In my mind a few ideas are forming, but... do you have any ideas?

177
Technical forum / Re:Antialiasing?
« on: January 02, 2004, 03:55:09 PM »
*embarrased*

You know, I just tested, and it DOES work  :o ! I probably didn't notice it before, because when you choose "enable 3D acceleration", you can't deselect "Run In Window" anymore - I had missed this completely! Thanks for the clarification :D

178
Technical forum / Antialiasing?
« on: January 01, 2004, 01:48:25 PM »
The documents mention that WME supports antialiasing. How exactly? Is there a possibility to turn it on somehow? Or have I just not noticed it, having a voodoo3 card and thus being unable to turn 3D acceleration on?

179
Technical forum / Re:Making a notepad interface
« on: December 26, 2003, 09:31:14 AM »
I just want to report you that notepad programming is going well so far. Thanks for all the support :D

180
Technical forum / Re:Making a notepad interface
« on: December 23, 2003, 02:23:14 PM »
I fixed this problem, I just had to define the windows as global. Now it works beautifully.

Pages: 1 ... 10 11 [12] 13 14

Page created in 0.046 seconds with 19 queries.