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

Messages - strazer

#1281
QuoteAlso, should definitions go before the game start function, and is it nessesary to end them in a similar way to how ags automatically ends its functions e.g. #sectionend.

If you mean custom functions, they have to be placed before the code where they are called. They don't have to be enclosed by #section definitions.
#1282
Yet another plugin conversion: Here's my OtherRoom script module for AGS v2.7, inspired by the OtherRoom plugin by Steve McCrea.

This script module simplifies the process of enabling/disabling various things in rooms other than the one the player is currently in. This is especially handy for beginners.

Features:

* Turn on, off and toggle hotspots and regions in other rooms
* Turn on and off walkable areas in other rooms
* Turn on, off, fade, toggle and position objects in other rooms
* Get current status of things in other rooms

Advantages to the OtherRoom plugin:

+ Cross-platform compatibility
+ Additional commands (object fading, get current status)
+ Extensible & customizable

I still consider it a beta version since there may still be things I overlooked.
As with the CharacterControl module, I'm essentially looking for beta-testers, so please let me know if you find any problems.

Download here (Should work with AGS v2.70, v2.71 and v2.72)

This download includes the script module and documentation.

Changelog:

Version 0.85 (2006-04-19)

* Quick fix to make it work with AGS v2.72 in "strict" mode

Version 0.84 (2005-08-18)

* Fixed bug when room changed via Character.SetAsPlayer() (Thanks Bernie!)

Version 0.83 (2005-05-09)

Major rewrite: (Thanks SteveMcCrea!)

* Added functions to return the states of things in rooms already visited
* Toggling now takes previous actions into account instead of overwriting them
* States are saved when leaving and restored when entering rooms
   (handy for non-state saving rooms 300-999)

Versions 0.81 & 0.82 (2005-05-06)

* Fixed two silly mistakes in a last-minute addition to the module

Version 0.80 (2005-05-05)

* First public release
#1283
1) If you change room 35's script, save the room, then reload it, do you see the changed code in the room script? If so, there's probably some code somewhere else (global on_event, repeatedly_execute(_always)?) where the overlay is created.

2) Do you have by any chance some views that are also called PHONE or HANDY? Try renaming them.

Another thought: Are your game files maybe write-protected so AGS can't overwrite them? Maybe you have copied the files from a CD to the hard drive?
#1284
No worries, I'm always happy to help. :)
#1285
Ah, right, of course the use inv mode is disabled when no inventory item is active, so (using AGS v2.7 code):

Code: ags

  if (mouse.Mode == 2) // if in interact mode
    mouse.Mode = 5; // switch to pick up mode
  else if (mouse.Mode == 5) // if in pick up mode
    mouse.Mode = 3; // switch to talk mode
  else if ((mouse.Mode == 3) && (player.ActiveInventory == null)) // if in talk mode and no inv item is active
    mouse.Mode = 0; // switch to walk mode
  }
  else if (mouse.Mode == 4) { // if in use inv mode
    mouse.Mode = 0; // switch to walk mode
  }
  else mouse.SelectNextMode();


You can replace the numbers with the enums generated by your cursor mode names to make it more readable.
#1286
I thought you didn't want that:

Quotewalk, look, use, take, talk

Do you mean use=use inv?
Or should the use inv mode be after the talk mode?

If so, just change
Code: ags

  else if (GetCursorMode() == 3) // if in talk mode
    SetCursorMode(0); // switch to walk mode

to
Code: ags

  else if (GetCursorMode() == 4) // if in use inv mode
    SetCursorMode(0); // switch to walk mode
#1287
You could replace
  SetNextCursorMode();
with
Code: ags

  if (GetCursorMode() == 2) // if in interact mode
    SetCursorMode(5); // switch to pick up mode
  else if (GetCursorMode() == 5) // if in pick up mode
    SetCursorMode(3); // switch to talk mode
  else if (GetCursorMode() == 3) // if in talk mode
    SetCursorMode(0); // switch to walk mode
  else SetNextCursorMode();

for example.
Remember to check "Standard cursor mode" for the pick up cursor.
#1288
Not directly, no. The game is completely paused while the dialog options are displayed.

There's a link to a workaround in the tracker entry Scummbuddy posted.
#1289
If you're still interested in storing/retrieving variables from save slots, here is a way to do it:

Code: ags

// global script

//...

function myGetArgument(string source, int argumentno, string destination) {

  StrCopy(destination, ""); // initialize argument string

  short foundarguments;
  short charposition;
  while (charposition <= StrLen(source)) { // loop until end of source string

    char letter = StrGetCharAt(source, charposition); // get letter from source string

    if ((letter == '/') || (letter == 0)) { // if end of argument reached
      foundarguments++; // increase number of found arguments
      if (foundarguments == argumentno) return 1; // if desired argument found, return success and quit function
      else if (letter == 0) { // if desired argument NOT found
        StrCopy(destination, source); // return whole source string as argument (for example)
        return 0; // return failure and quit function
      }
      else StrCopy(destination, ""); // continue with next argument
    }
    else StrFormat(destination, "%s%c", destination, letter); // if end of argument NOT reached, append letter

    charposition++; // loop to next letter
  }

}

//...


Code: ags

// main script header

//...

import function myGetArgument(string source, int argumentno, string destination);

//...


To save data (example):

Code: ags

  //...

  string buffer;
  StrFormat(buffer, "%s/%d/%d", "Warehouse", timeplayed, score); // arguments must be seperated by a /
  SaveGameSlot(SAVESLOTNUMBER, buffer);

  //...


To retrieve data (example):

Code: ags

  //...

  string buffer;
  GetSaveSlotDescription(SAVESLOTNUMBER, buffer); // get save slot description

  string argument;

  myGetArgument(buffer, 1, argument); // get first argument from save slot description
  string saveslotname;
  StrCopy(saveslotname, argument);

  myGetArgument(buffer, 2, argument); // get second argument from save slot description
  int timeplayed = StringToInt(argument);

  myGetArgument(buffer, 3, argument); // get third argument from save slot description
  int score = StringToInt(argument);

  //...


Keep in mind you can only save up to 200 letters per save slot description.
#1291
This is my CharacterControl script module for AGS v2.71/2.72.

To quote the CCS plugin by Scorpiorus:

"Imagine you have a lot of characters in the game and want them to perform different tasks at the same time. Yep, a tons of scripting seems unavoidable. However, another way out is to use CCS which provides easy command control system so you define all needed character commands and then just call the execution function. The most powerful is the MOVE command as it works room-independently!"

I really like the idea, but as a Linux user I can't use plugins and I like to do things natively whenever possible. So I wrote the entire thing from scratch as a script module.

Features:

* NPCs can walk around in other rooms, talk, animate etc. _in the background_
* Compatible with CCS plugin command strings
(That may change at any time so you're encouraged to use this module's commands.)

Advantages to the CCS plugin:

+ Cross-platform compatibility
+ Additional and extended, more flexible control commands
+ No need for a dedicated blank view
+ Extensible & customizable

Note that this is still a BETA version.
I have only a simple test game to test this with so I need other users to report any bugs they may encounter.

Download here (Requires AGS v2.71 or higher!)
This download includes the script module(s), documentation and a small demo game.

Edit:

Check this post by monkey_05_06 for an AGS 3+ compatible version
#1292
P4 2,4GHz, 1GB RAM
#1293
Beginners' Technical Questions / Re: 2 scores
Wed 04/05/2005 02:20:28
Almost everything is possible with AGS, you have to be more specific what you want, how you want it and where you want it.

Here's an example (AGS 2.7 code):

Code: ags

  //...

  int player1score = 10;
  int player2score = 20;

  string scores;
  StrFormat(scores, "Player 1: %d - Player 2: %d", player1score, player2score);
  thelabelname.SetText(scores);

  ///...
#1295
Beginners' Technical Questions / Re: Keycodes?
Tue 03/05/2005 23:12:18
Manual -> Reference -> ASCII code table:

65..90  -  'A' .. 'Z'

A = 65
D = 68
S = 83
W = 87
#1296
QuoteHaving copied over the game files into the folder with the new version

What files have you copied? You may have overwritten parts of AGS.
You don't need to copy your game to the AGS folder, you can store the game and AGS seperately.
#1297
You could convert the value to a string and save it in the save slot description when using the SaveGameSlot function.
#1298
The video files reside in a sub-directory of the folder the game is in.
AFAIK no absolute paths are allowed. No security risk I can see.
#1299
Advanced Technical Forum / Re: v2.7 mouse.x
Tue 03/05/2005 18:07:56
MoveCharacterBlocking(EGO, 100, 150) is a short version of

Code: ags

MoveCharacter(EGO, 100, 150);
while(character[EGO].walking) Wait(1);


thus because of the Wait the game runs in the background and the mouse coordinates are updated.

Quote
I've tested both builds and the mouse.x is changing in 2.7.

As it should be.

Btw, unlike AGS v2.62, in AGS v2.7 the mouse coordinates are updated before each call to repeatedly_execute_always:

Quote from: Pumaman on Sat 13/11/2004 21:02:00
* The mouse.x/y variables are now updated for rep_exec_always.
#1300
Advanced Technical Forum / Re: v2.7 mouse.x
Tue 03/05/2005 17:44:30
Hm, I think while the script runs the mouse coordinates should not be updated unless you let the game advance some game loops by using the Wait function.

Can you please post an example script?
SMF spam blocked by CleanTalk