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

#1481
Take a look at the verb coin template: http://www.freewebs.com/skimbleshanks/templatesandmodules.htm

There also lots of threads about verb coins, try a forum search.
#1482
You could, for example:

- Draw everything as complete animation frames, put them in a view, then animate an object with it -> Easy
- Animate the background only, then use additional objects for the meteors and move them across the screen manually
- If you want the looping for clouds or the like, make the clouds objects and move them across the screen
#1483
Yeah, I like it so much, I made a Roger version based on Netmonkey's smiley designs:
#1484
If player has to go through door3, then door1, then door2:

Code: ags

// room script ("{}" button in Room settings pane)

int sequence; // define static variable that stores order



Code: ags

  // script for door3 (interact with hotspot/object, walk onto region, whatever you want)

  if (sequence == 0) sequence = 1; // if this is the first door chosen, set variable to 1
  else sequence = 0; // if wrong choice, reset variable

  NewRoomEx(character[GetPlayerCharacter()].room, 150, 150); // re-enter current room and position player at door3



Code: ags

  // script for door1

  if (sequence == 1) sequence = 2; // if this is the second door chosen, set variable to 2
  else sequence = 0; // if wrong choice, reset variable

  NewRoomEx(character[GetPlayerCharacter()].room, 50, 150); // re-enter current room and position player at door1



Code: ags

  // script for door2

  if (sequence == 2) NewRoom(THENEWROOM); // if this is the third door chosen, go to the next room
  else NewRoomEx(character[GetPlayerCharacter()].room, 100, 150); // if wrong choice, re-enter current room and position player at door2

  sequence = 0; // reset variable


#1485
Critics' Lounge / Re: Medieval Gate
Sun 27/03/2005 20:16:52
Very nice.

The wall seems flat, maybe you could show the side of it on the left side of the arch.
Also, I would make the background seen through the gate gradually hazier/darker to show it's farther away.

Edit: Spelling
#1486
Quote from: Pumaman on Wed 23/03/2005 19:04:31
QuoteAnother one... if you set a character's speech view to something excessively large (e.g. 320 pixels wide) using Sierra-style speech, then once the character starts speaking, the game crashes with an error message "unable to allocate -166 bytes of memory"

And another one... in the dialog editor, you can surround text with /* */ and it will be highlighted as comment. But it is still compiled (and causes errors). But lines starting with * are ignored.

Ok, thanks for the info, those two aren't too serious since the likelihood of them occurring is quite small, so I'll leave them for now.

Tracker'd:
http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=515
http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=516
#1487
Select "Characters" from the list on the left, then select your player character (probably the first one) and enter the first room's number where it says "Start in room".

Keep in mind that your room files HAVE to be named roomX.crm, where X is the number of the room. If you save under any other filename, the room will not be useable in the game. (In AGS v2.62, room 0 must be saved as intro.crm).
So if you save your first room as room12.crm, it will be room number 12. Enter this number as the starting room for your player character.
#1488
Code: ags

if (1.0 < 2.0) Display("Compiles.");


Code: ags

if ((1.0 < 2.0) && (1.0 < 2.0)) Display("Does not compile.");

Quote
Error: Operator cannot be applied to this type

Code: ags

if ((1.0 == 2.0) && (1.0 == 2.0)) Display("Compiles.");


Code: ags

if ((1 < 2) && (1.0 < 2.0)) Display("Does not compile.");

QuoteError: Type mismatch: cannot convert 'int' to 'float'

Code: ags

if ((1 == 1) && (1.0 == 1.0)) Display("Compiles.");


???
#1489
General Discussion / Re: add a game
Sat 26/03/2005 04:49:27
I think you have to register first. Guests aren't allowed to start new threads there.
#1490
Quote from: RickJ on Sat 26/03/2005 02:17:40
I don't believe the Global Script Header is included into Module Script, only the Module Header. 

Hey, you're right. Good to know. I assumed it is.

Quote from: RickJ on Sat 26/03/2005 02:17:40In my mind "Internal" seems to apply equally to both. 

You have a point. Still, I think the difference between "Internal functions" and "User functions" is more obvious.

Quote from: RickJ on Sat 26/03/2005 02:17:40
The #error directive does more or less the samething as AbortGame() but at compile time instead of at runtime.

I know. What I mean is, if only one function of your module depends on another module, but this function is not even used by the game author, IMO the dependency shouldn't be enforced.
Instead, you could do:

Code: ags

static function MyModule::DoSomeStuff() {

  #ifndef MODULE_YOURMODULE
    AbortGame("This function depends on 'YourModule'!");
  #endif

  // (the stuff)

}


The game author will know that he has to import another module the moment he tries to use the function.

Edit:

Quote#error *** Err-MyModule, can't find required module "YourModule"!

"Err-MyModule" isn't needed as the AGS error message displays the module name where the error was raised.

Edit 2:

QuoteAt the time of this writing, it is not clear to the author what scope or other charactistics enums defined in the Module Script have

Good question.
#1491
I don't host these files. They're only links.
Some files are located on CJ's servers, some are hosted by a-v-o (hence "Courtesy of a-v-o").
#1492
Global variables don't have to be initialized, they are automatically initialized to 0.
If you need another starting value, you can initialize it when defining it:

Code: ags

// global script

int isnight = 1;


To be able to access a variable defined in the global script in room scripts, you have to export it first, then import it in either the global script header (for all rooms) or just the room script of the room where you need it:

Code: ags

// global script

int isnight;
export isnight;


Then

Code: ags

// main script header

import int isnight;


or

Code: ags

// room script

import int isnight;
#1493
Consider using some script for simple things like that: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=19452.msg236907#msg236907

Using plugins makes your game not work with the DOS and Linux engines.
#1494
Nice work!

1.) Shouldn't #defines, static variables and utility functions in the module script also be prefixed with the module name as not to collide with anything the game author may have set up in the global script header?

Btw, I like "Internal functions" better than "Utility functions".

2.) If only a specific function depends on another module, we should suggest to use
  #ifndef YourModule_VERSION
    AbortGame("Can't find required module 'YourModule'!");
  #endif

And few spelling errors:

Quotestatic
member functions are recognized but the auto-complete feature of the
Script Editor.

Quote
   // Note: String variables are ->NOT<- permitted inside a
   // struct.  Use a char array instead.

Quoteoutside the bounds of any fucntion

Quotegive credit where credit is do.

Quote"Derrived from IniFile by RickJ"

Quotecopiler errprs

Quoteapporpiate error message
#1495
1.) Does the file on this page contain the manual?

2.) Try
  DisplaySpeech(EGO,"\"Hm. That doesn't seem to work.\"");
#1496
I was writing this while Ashen replied:

Make the dialog with all 4 options. Option 3 is initally off (Uncheck "Show" checkbox in dialog pane).

Then, for example in the dialog with Vader (dialog 0):

Code: ags

// dialog script for dialog 0

//...

@8 // Do you know Leia?
vader: Leia is Luke's sister.
ego: I see...
run-script 12 // call dialog_request function and pass 12 as parameter
option-off-forever 8 // turn this dialog option off
return // show dialog options again

//...


Then, edit the dialog_request function in the global script:

Code: ags

// global script

function dialog_request(int parameter) {

  if (parameter == 12) { // if function called via "run-script 12"
    SetDialogOption(1, 3, 1); // unlock dialog 1's hidden dialog option 3
  }

}


Then, in the dialog with Luke (dialog 1):

Code: ags

// dialog script for dialog 1

//...

@3 // Is it true that Princess Leia is your sister?
luke: NOOOOOOOOOOOO!
option-off-forever 3 // turn this dialog option off
return // show dialog options again

//...
#1499
You might want to look into the GetTextHeight function.

Edit:

And it's better to use a custom function instead of pasting the script everywhere.
Does this work?:

Code: ags

// main global script

function DisplayGK1Speech(int charid, string text) {
  int font = 0; // number of speech font (is there a function or variable to get this?)
  int xoffset = 2; // left border
  int yoffset = 0; // bottom border

  int ypos = (system.viewport_height - GetTextHeight(text, font, system.viewport_width - xoffset)) - yoffset;

  DisplaySpeechAt(xoffset, ypos, system.viewport_width - xoffset, charid, text);
}


Code: ags

// main script header

import function DisplayGK1Speech(int charid, string text);


Code: ags

  // script for character 0: Look at EGO

  DisplayGK1Speech(EGO, "It's me.");


But I imagine you'll eventually have problems in dialog scripts since they use the standard speech display.
#1500
For anyone else interested, I have put all links to old versions I could find on this page.
SMF spam blocked by CleanTalk