Menu

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.

Show posts Menu

Topics - Lazarus

#1
Firstly a big thank you to Ashen with helping me with this module.

Fading Objects, Characters & Gui's Non Blocking.

FadingThingsNonBlocking.zip Current version 2.29

Requirements:-  AGS 2.70 +

This Module is for fading objects, characters & Gui's Non Blocking function, in that you don't have to wait for these functions to finish before something else happens.
So you can fade in or out an object while messages are spoken for example.
-----------------------------------------------------------------------
This module allows for upto and including 50 different Objects, 300 different Characters and 50 different Gui's to be faded in/out simultaneously or staggered with the timer control. (Per Room)

This is reset PER ROOM.

At the moment the current ags limits are:
20  objects per room
300  characters
50  GUIs
-----------------------------------------------------------------------

This module uses the script O-names for all the commands.
-----------------------------------------------------------------------

Command examples:-
Code: ags

FadeObjectIn_NoBlock(oWax, 0, 0);
FadeObjectIn_NoBlock(oWax, 0, 0, 250);
FadeObjectOut_NoBlock(oWax, 100, 0);

FadeCharacterIn_Noblock (cEgo, 0, 0); 
FadeCharacterIn_Noblock (cEgo, 0, 0, 0, 100, 150); 
FadeCharacterOut_Noblock (cEgo, 100, 0);

FadeGuiOut_NoBlock(gMaingui, 100, 0);
FadeGuiIn_NoBlock(gMaingui, 0, 0, 250);

-----------------------------------------------------------------------
Objects & Gui's with a transparency of 100 will be turned off automatically
NPC Characters with a transparency of 100 will be moved to Room (-1). But NOT the player Character.
-----------------------------------------------------------------------

VALUE = Transparency: -
Fade Objects, Characters & Gui's In/Out by value which can be any value between 0 and 100.
0 = visible
Any number between = ghosting
100 = invisible
-----------------------------------------------------------------------

SPEED: -
Setting the speed of fading.
-20 = Even Faster etc..
 -1 = Fast etc..
  0 = normal
  1 = slow
  2 = slower
  3 = even slower etc..
-----------------------------------------------------------------------

TIMER:-
Timer is like a fuse on a bomb in that say you entered the figure 250, this will count down to 0 (zero) and then execute the command.
Entering the number 0 (zero) will execute straight away. (You cannot enter minus figures).

Also if you don't need the timer but want to use the new coordinates then just enter 0 (zero) for the timer.
-----------------------------------------------------------------------

OBJECTS: -
Objects now don't need to be ticked visible and have transparency set to 100 before use.
Instead you can leave the objects unticked so they are turned off, and then just use the FadeObjectIn function
as turning an object on is dealt within the function.

The FadeObjectOut function now turns objects OFF automatically if transparency = 100.

Commands:-
FadeObjectIn_NoBlock(oWax, 0, 0, 250);
Will fade the object Wax in, totally visble,speed normal with a 250 timer delay.
-----------------------------------------------------------------------

CHARACTERS: -
If characters are already starting in room 5 for example you will have to set that characters transparency
in that room, using a run-script under (Before Fadein) e.g.

character[EGO].Transparency =100; // Invisible
or
cEgo.Transparency = 100; // Invisible

Or you can have that character to start in room (-1) or from another room and just use the FadeCharacterIn function
and all transparencies are dealt with e.g.

Commands:-
FadeCharacterIn_Noblock (cEgo, 0, 0);
This will fadein character EGO totally visible using normal speed.

Also you can set where if needed new X and Y positions of a character when fading in,
this is an optional command, so you don't need to set these if you want to use the previous coordinates.
e.g.

FadeCharacterIn_Noblock (cEgo, 0, 0, 0, 100, 150);

If you want to use the new coordinates, BUT not the Timer then you must enter a number
for the Timer function like 0 (zero) for immediate executions.

This will fadein character EGO totally visible using normal speed, zero Timer and place the character
at the new given co-ordinates.

Now also if NPC characters are totally invisible (100) they are moved automatically to Room (-1).
-----------------------------------------------------------------------

GUI's
Added the ability to fade in/out gui's

Commands:-
FadeGuiOut_NoBlock(gMaingui, 100, 0);
Will fade out the gui totally invisible with normal speed.

FadeGuiIn_NoBlock(gMaingui, 0, 0, 250);
Will fade in the gui totally visible using normal speed with a delay.

-----------------------------------------------------------------------
-----------------------------------------------------------------------

Version History:
2.29 Changed Max Characters to 300 per room.

2.28 Fixed game pausing while skip cutscene is used, lowered define values of
       Objects,Characters and Gui's per room to speed up module.

2.27 Fixed typo error at line #168. (Thanks Scorpiorus).

2.26 Added support of fading in/out of GUI's.

2.25 Changed module name to "FadingThingsNonBlocking".

2.24 Bug Fix - Able to constantly repeate fade in/out of Objects
                     and Characters under room repeatedly execute.

2.23 Bug Fix - Characters and Objects now fade into current room
                     properly with Timer function.

2.22 Characters can now use optional new coordinates when
       fading in or use orignial coordinates.

2.21 Objects with a transparency of 100 will be turned off
       automatically.

2.20 NPC Characters with a transparency of 100 will be moved to
       room(-1). But NOT the player Character.

2.19 Characters are now able to be faded in from another room
       to player room. No need to set transparency before hand.

2.18 Objects can now be turned on within fade in function.
       No need to set transparency before hand.

2.17  Bug Fix - Fading in/out works when game is being skipped,
                      for example by the enter key.

2.16 Too many things to list.
#2
This module will be replacing my previous module called "Fading Objects & Characters" as I've now updated it.

This module will now Fade in/out Objects, Characters and Gui's

FadingThings.zip
Current version:- 2.25

Requirements:- AGS 2.70 +

This module uses the script O-names for all the commands.

This Module is for fading Objects, Characters & Gui's with a blocking function, in that you have to wait for these functions to finish before something else happens.

Commands:-
Code: ags

FadeObjectOut(oWax, 100, 1);
FadeObjectIn(oWax, 0, 1);

FadeCharacterIn (cEgo, 0, 1); 
FadeCharacterIn (cEgo, 0, 1, 100, 150); 
FadeCharacterOut (cEgo, 100, 1); 

FadeGuiOut(gMaingui, 100, 1);
FadeGuiIn(gMaingui, 0, 1);


TRANSPARENCY: -
Fade Objects, Gui's & Characters In/Out by value which can be any value between 0 and 100.
0 = visible
50 = ghost
100 = invisible

SPEED: -
Set speed of Fading can be set from 1 upwards, setting 0 (Zero) or minus numbers will default to one.
-10 = Defaults to 1
   0 = Defaults to 1
   1 = normal
   2 = slow
   3 = slower etc..
-----------------------------------------------------------------------
Objects & Gui's with a transparency of 100 will be turned off automatically
NPC Characters with a transparency of 100 will be moved to room(-1). But NOT the player Character.

*Edit*
With regards to the player Character if it's transparency = 100
they will stay in the current room totally invisible.

-----------------------------------------------------------------------

OBJECTS: -
Objects now don't need to be ticked visible and have transparency set to 100 before use.
Instead you can leave the objects unticked so they are turned off, and then just use the FadeObjectIn function as turning an object on is dealt within the function.

FadeObjectOut(oWax, 100, 1);
Will fade out the object totally invisible with normal speed.

FadeObjectIn(oWax, 0, 1);
Will fade in the object totally visible using normal speed.
-----------------------------------------------------------------------

CHARACTERS: -
If characters are starting in room 5 for example you will have to set that characters transparency in that room, using a run-script under (Before Fadein) e.g.

character[EGO].Transparency =100; // Invisible

Or you can have that character to start in room (-1) and just use the FadeCharacterIn function and all transparencies are dealt with e.g.

Commands:-
FadeCharacterIn (cEgo, 0, 1);
This will fadein character EGO totally visible using normal speed.

Also you can set where if needed the X and Y position of a character when fading in, this is an optional command, so you don't need to set these if you want to use the previous coordinates.
e.g.

FadeCharacterIn (cEgo, 0, 1, 100, 150);

This will fadein character EGO totally visible using normal speed and place the character at the new given co-ordinates.
-----------------------------------------------------------------------

GUI's
Added the ability to fade in/out gui's

Commands:-
FadeGuiOut(gMaingui, 100, 1);
Will fade out the gui totally invisible with normal speed.

FadeGuiIn(gMaingui, 0, 1);
Will fade in the gui totally visible using normal speed.
-----------------------------------------------------------------------
-----------------------------------------------------------------------

Version History:

2.25 Added check so zero or negative numbers for Speed defaults to one.

2.24 Renamed module from "Fading Objects & Characters" to "FadingThings".

2.23 Added functions for fading Gui's in/out.
#3
Hi
I've been adding to my fading module and was wondering
if it was possible to be able to fade in/out inventory items?

I've had a go, but I keep getting
"Transparency is not a public member of inventoryitem"

Here's my last attempt
Code: ags

struct FadeThing {Ã,  Ã, // Setting up a struct.
Ã,  int Transparency;Ã,  //
};

FadeThing Item;
InventoryItem *FadeII; 


function FadeInventoryItemOut (InventoryItem *II, int Value, int Speed) {

 FadeII = II;

 Item.Transparency = FadeII.Transparency;

Ã,  while (Item.Transparency < Value) {
Ã,  Ã, Item.Transparency ++;Ã,  Ã, 
Ã,  Ã, Wait (Speed);
Ã,  Ã, }
Ã,  if (Item.Transparency == 100) {Ã,  // Removes Item if Transparency = 100
Ã,  Ã,  Ã,  player.LoseInventory(FadeII);
Ã,  Ã, }
 }


Any ideas would be grateful.

#4
The first module is:Face Right2

FaceRight2.zip


Requirements:-  AGS 2.70 +

This idea was taken from one of the demo games, which I no longer have.
So I am unable to remember who the author was.

This module allows you to turn characters so they face a certain direction without using coordinates.

Examples:-
Code: ags

Face(cEgo, Left);
Face(cEgo, Up);
Face(cEgo, Right);
Face(cEgo, Down);

Face(cRoger, Left);
Face(cRoger, Up);
Face(cRoger, Right);
Face(cRoger, Down);


#5
Beginners' Technical Questions / Using Arrays
Thu 13/04/2006 10:32:54
Hi I got this function that I want to turn into arrays, but don't know how.
Code: ags
int transparent2, fadespeed2, fadecounter2, fadelimit2, fadeout = 0; // Fade Out

//----------------------------------------------------------------
Object *fadeobj2; // Fade Out
//----------------------------------------------------------------

function FadeObjectOut (Object *objectpoint,int value,int speed) {
Ã,  if (fadeout) return 1; //aborts if fadeout is currently being executed
Ã,  fadeobj2 = objectpoint;
Ã,  transparent2 = fadeobj2.Transparency;
Ã,  fadeout = 1;
Ã,  fadespeed2 = speed;
Ã,  fadecounter2 = speed;
Ã,  fadelimit2 = value;
} // function end

//----------------------------------------------------------------
function repeatedly_execute_always() {

// fade object out
Ã,  if (fadeout) {
Ã,  Ã, if (transparent2 < fadelimit2) {
Ã,  Ã,  Ã,  fadecounter2 --;
Ã,  Ã,  Ã,  if (fadecounter2 < 0) {
Ã,  Ã,  Ã,  Ã,  fadecounter2 = fadespeed2;
Ã,  Ã,  Ã,  Ã,  transparent2 ++;
Ã,  Ã,  Ã,  Ã,  fadeobj2.Transparency = transparent2;
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  } else fadeout = 0;
Ã,  Ã,  }
//----------------------------------------------------------------

//----------------------------------------------------------------

function on_event (EventType event, int data) {
Ã,  if (event == eEventLeaveRoom && fadeout) {
Ã,  fadeout = 0;Ã,  //reset, so won't crash in next room
Ã,  fadeobj2.Transparency = 0;
Ã,  }

//----------------------------------------------------------------

} // function on_event end


I can set the first bit:
Code: ags
int transparent2[10], fadespeed2[10], fadecounter2[10], fadelimit2[10], fadeout = 0; // Fade Out
//----------------------------------------------------------------

Object *fadeobj2[10]; // Fade Out
//----------------------------------------------------------------


But how do you assign each array element, so when a figure is added it fills the first array, but when a second is added it then fills the second element and so on?

any ideas would be grateful
#6
Hi at present I'm using:
Code: ags
 if (button == eMouseLeftInv) {
Ã,  Ã,  Ã, InventoryItem *item = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
Ã,  Ã,  if (player.ActiveInventory == null) { 
Ã,  Ã,  Ã,  if ((StrComp(verb, vGive) != 0) && (StrComp(verb, vUse) != 0)) {
Ã,  Ã,  Ã,  Ã,  if (item != null)
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  item.RunInteraction(mouse.Mode);
Ã,  Ã,  Ã,  Ã, }
Ã,  Ã,  Ã,  Ã, else {
Ã,  Ã,  Ã,  Ã,  Ã,  if (StrComp(verb, vUse) == 0)
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  if (item.IsInteractionAvailable(eModeInteract) == 1) {
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  item.RunInteraction(mouse.Mode);
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  return;
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, }
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, player.ActiveInventory = item;
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, mouse.Mode = eModeUseInv;
Ã,  Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  Ã,  }
Ã,  Ã,  Ã,  Ã, else {
Ã,  Ã,  Ã,  Ã,  Ã, if (item != null)
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, item.RunInteraction(mouse.Mode);
			Ã,  Ã,  }
 } // function end


The problem I have is that when using an inventory item it doesn't return back to the walkto mode after use, you have to then click again somewhere else to return back to the walk mode.

Is there a way so this happens after the interaction has happened?

Thanks in advance
#7
Advanced Technical Forum / status line setup
Wed 08/03/2006 10:05:28
I'm in the process of making a new template and I'm having problems with defining between the use and give inventory items, in that I can get one or the other to work but not both.
here's what I have so far:
Code: ags
function SetActionText(){Ã,  
Ã,  string text;
Ã,  if (mouse.Mode==eModeWalkto) StrCopy(text, "Walk to ");
Ã,  else if (mouse.Mode==eModeLookat) StrCopy(text, "Look at ");
Ã,  else if (mouse.Mode==eModePickup) StrCopy(text, "Pick up ");
Ã,  else if (mouse.Mode==eModeInteract) StrCopy(text, "Use ");
Ã,  else if (mouse.Mode==eModeTalkto) StrCopy(text, "Talk to ");
Ã,  
Ã,  else if (mouse.Mode==eModePull) StrCopy(text, "Pull ");
Ã,  else if (mouse.Mode==eModePush) StrCopy(text, "Push ");
Ã,  else if (mouse.Mode==eModeOpen) StrCopy(text, "Open ");
Ã,  else if (mouse.Mode==eModeClose) StrCopy(text, "Close ");
Ã,  
Ã,  else if (mouse.Mode==eModeGive) {
Ã,  Ã, mouse.Mode = eModeUseInv;
Ã,  Ã,  string invname;
Ã,  Ã,  StrCopy(text, "Give ");
Ã,  Ã,  player.ActiveInventory.GetName(invname); 
Ã,  Ã,  StrCat(text, invname);
Ã,  Ã,  StrCat(text, " to ");
Ã,  }
//Ã,  else if (mouse.Mode==eModeUseInv){// If using an inventory item on something
Ã,  else if (mouse.Mode==eModeInteract){
Ã,  Ã, mouse.Mode = eModeUseInv;
Ã,  Ã,  string invname;
Ã,  Ã,  StrCopy(text, "Use ");
Ã,  Ã,  player.ActiveInventory.GetName(invname); 
Ã,  Ã,  StrCat(text, invname);
Ã,  Ã,  StrCat(text, " with ");
Ã,  }

Ã,  Ã,  StrCat(text, "@OVERHOTSPOT@");
		
Ã,  Ã,  gActionStatus.SetText(text);
}


Any help would be grateful

Also while I think about it I can't seem to get these

Code: ags
Ã,  else if (mouse.Mode==eModePull) StrCopy(text, "Pull ");
Ã,  else if (mouse.Mode==eModePush) StrCopy(text, "Push ");
Ã,  else if (mouse.Mode==eModeOpen) StrCopy(text, "Open ");
Ã,  else if (mouse.Mode==eModeClose) StrCopy(text, "Close ");


working quite right in that they don't reset the statusline back to walk to command when used.

#8
Hi I have this function which is pretty basic where when the mouse passes over objects,hotspots and characters it highlights the buttons (changes the Look at & Talk to sprites), which works okay. But now I also want it to also highlight the buttons when the mouse is over inventory items.

heres what I have so far:
Code: ags
	function HighlightButtons() {

if (GetLocationType(mouse.x,mouse.y) == eLocationCharacter)
Ã,  gMainTalkto.NormalGraphic = 89;// Highlight Talk To

else if (GetLocationType(mouse.x,mouse.y) == eLocationHotspot)
Ã,  gMainLook.NormalGraphic = 84;// Highlight Look At

else if (GetLocationType(mouse.x,mouse.y) == eLocationObject)
Ã,  gMainLook.NormalGraphic = 84;// Highlight Look At

else if (GetLocationType(mouse.x, mouse.y) == eLocationNothing)
Ã,  gMainLook.NormalGraphic = 73;// Look At Normal
Ã,  gMainTalkto.NormalGraphic = 78;// Talk To Normal		
}


Any help would be grateful
#9
Hi
I'm having problems with setting an object properties and checking if the object image is a certain number to run the global int.

Basically the objects image number to start with is 1218 and after an interaction the image changes to 1226 which works ok,
Then I want to check if the image has changed to run another interaction when the object is visible.

I keep getting a parse error near 'object'
any help would be grateful thanks

Here's my example:

Code: ags
if	(ObjectOn(2) && (object[2].Graphic = 1226);){
Ã,  	SetGlobalInt (30, 1); 
	}
#10
Hi I'm in the process of making a new template and I'm having a problem with the "Walk to" cursor.

In the template I have set cursor 9 as the default "Walk to" as I wanted this to appear in the
object/ hotspot interaction window.

The problem I have is that the player character performs the interaction then walks over to it, is there away to change this so the player character walks to the object/hotspot first then performs the interaction?

In the Script Header I have:
Code: ags
#define eModeWalkto 0 // setting cursor 9 to use mode 0


and in "on mouse click" I have
Code: ags
else if (button==eMouseLeft) {
 ProcessClick(mouse.x, mouse.y, mouse.Mode);
  if (mouse.Mode == eModeWalkto) {
   if (IsInteractionAvailable(mouse.x,mouse.y, eModeWalkto) == 1){
    ProcessClick(mouse.x, mouse.y, eModeWalkto);
    }
  }
else ProcessClick(mouse.x, mouse.y, eModeWalkto);
	}


any help wouild be grateful

*I'm using ags 2.70 at present becuase I'm in the middle of a project*
#11
I'm trying to create a function where I can fade out characters, but I just cannot get it too work. I have created a function for objects andÃ,  that works ok, but now I am stuck with this one so any help would be grateful thanks


int transparent;

function FadeCharacterOut (int charID) {
Ã,  while (transparent <= 100) {
Ã,  SetCharacterTransparency (charID, transparent);
Ã,  transparent += 1;
Ã,  Wait (1); }
}
#12
Advanced Technical Forum / Giving NPC items?
Tue 26/07/2005 18:08:34
Hi ...

I hope I am posting this in the right place as I can't find any help on this question ..

I am at the point in my game where my character has several items collected in their inventory to give to a NPC.  These items can be obtained/given to the NPC in any order and at any point during the game.

The problem I have is where to start!

Sorry if this is a stupid question but I am lost with what I guess I need to do, which is ..

Add under the NPC a "conditional" command for each item saying to "display a message" telling the player it is an item required etc.

I don't know how to script the game so that the NPC is aware when he has all of the items to trigger a "final congratulations you have it all dialog"?

I would also like to count down how many items to go when the playing character gives the NPC an item he is after ... for instance saying "3 items to go ...", "2 items to go ..." etc.

I apologise if someone has already covered this but after trawling the forums for what seems like days I have not found the solution ..

With much hope and thanks ...
#13
I have a problem as follows:

I have a room which has 2 exits to other rooms.Ã, 

In this main room I have setup for exit number 1 (a hotspot) to become enabled when an inventory item is used and a dialog is run.Ã,  This is fine and I can leave the main room through exit 1 and come back in using this hotspot.Ã,  The exit remains enabled.

The problem I have is if I use the inventory item and the dialog is run to enable the hotspot (above) and don't go through the hotspot but instead go to exit no. 2 (which is also a hotspot into another room) and then come back to my main room then exit no. 1 (hotspot) is then disabled!

Sorry this is so confusing but I have no clue as to how to do this!

I thought it might be a conditional thing but I don't see how to do it ....
#14
I'm trying to setup my splash screen menu so when a player wants to watch the intro again they can via a button. And when this finishes they are returned back to the splash screen menu. eg...starts on room2 and finishes on room4 to go back to room1.

Here's my code so far it that helps (i'm using ags version 2.7)

//    Splash Screen
if (interface == SPLASH){
      
      if (button == 1){ // Play Intro
      StartCutscene(2);
      player.ChangeRoom (2);
Ã,  Ã,  EndCutscene();
// Allowing player to watch intro again.
// needs to stop at room 4 and return back to Splash Interface (room1)      
Ã,  Ã,  }      

      if (button == 2){ // New Game
         player.ChangeRoom (2);
// Starts from beginning (including Intro Scene)
Ã,  Ã,  }

Ã,  Ã,  if (button == 3){ //load Game
Ã,  Ã,  Ã,  GUIOff(OPTIONS);
Ã,  Ã,  Ã,  GetLucasSavegameListBox(RESTORE,1);
Ã,  Ã,  Ã,  GUIOn(RESTORE);
Ã,  Ã,  }
Ã,  Ã, 
Ã,  Ã,  if (button == 0){ // Quit Game
         QuitGame(0);
      }
   }

Thanks inadvance
SMF spam blocked by CleanTalk