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

#61
Yeah copy-and-past the code from your game.

In case it's a black screen freeze up, then such behaviour is most common for trying to change player character's room to the current (same) one in the "before fade-in" event -- then you may effectively get an infinite loop:

room changes, before fade-in runs, room changes, before fade-in runs, room changes, etc...
#62
Yep, many "C++"-style languages allow you to declare variables almost anywhere you need one which makes it more flexible to describe things in the current context.

As for Basic's "not necessary to declare a variable before using it", it mostly works for really simple routines with short variable names where otherwise variable declarations would take more space than the code itself, making things unwieldy than necessary. For more complex codes, however, it is really a must for a language to require all variable identifiers to be defined to prevent potential errors in code's logic. For example:

Code: ags

For i = 1 to 7

    ' most likely a logic mistake here, 
    ' DaysOfWeekCount and DayOfWeekCount are two different variables

    DaysOfWeekCount = DayOfWeekCount + 1

Next i


That's why there is an "option explicit" setting in MS Visual Basic, for instance, to make it check for undeclared names.
#63
Quote from: TheMagician on Tue 11/12/2007 23:51:45Just for the sake of completeness (if anybody is trying to use this code as well) you need to deactivate "Enforce new-style strings" in the general game settings to use the type string used in Scorpiorus' code.

Ah yeah indeed, sorry for not having mentioned that bit. I'm glad you got it compiled anyway :)
#64
As SSH suggested in the past, another, quite messy yet working method would be to set up a temporary "string" variable and pass it instead:

Code: ags

string temp;
StrCopy( temp, "PlayBackground" );
DMRoutine( temp );


You can probably write a wrapper for each function that expects "string" as parameter.

Or write a converting function to return "string":

Code: ags

string buffer;
string to_string( const string text )
{
    StrCopy( buffer, text );
    return buffer;
}

...

DMRoutine( to_string("PlayBackground") );


Just avoid using the last method when passing to function defined in the script and not a plugin as it can potentially mess things up if not handled properly.
#65
Ah hehe, I in fact tried one link to go there but it led me to a 404 page so I assumed the site is down.
I now found the right one though: http://www.freewebs.com/skimbleshanks/ :)

And yeah the problem is surely in having "EGO" instead of referencing the current player character with the GetPlayerCharacter() command.
#66
You can have the repeatedly execute event in the room as well:

Follow: Room Interactions :: Repeatedly execute :: Run script

Code: ags

bool plmoving = false;

#sectionstart room_*  // DO NOT EDIT OR REMOVE THIS LINE
function room_*() {
  // script for Room: Repeatedly execute

    if (player.Moving) plmoving=true;
    else if (plmoving) {
        plmoving=false;
        // character just stopped moving
        DoStuff( );
    }
}
#sectionend room_*  // DO NOT EDIT OR REMOVE THIS LINE
#67
Ah ok so it is not ALARCOST :)

But which one exactly are you using? There is no anything with "Broken Sword" as a name:

http://www.americangirlscouts.org/agsresources/Templates.html
#68
Hmm, do you mean that inventory bar comes with the template, or did you add it yourself? I just can't seem to find anything like that in the ALARCOST template, could you tell us where you downloaded it from?

By the way, the problem may be with the way inventory clicks are handled in on_mouse_click, could you post the contents of that function?
#69
This is a script module and as such should work on any platform supported :)
#70
Quote from: Grim Reaper on Fri 07/12/2007 20:40:23Items upear in the inventory bar when picked up...

Hmm, what do mean by "inventory bar" exactly?

As I see, the template in question comes with the built-in inventory dialog (invoked with the AGS' InventoryScreen( ) command) with its inventory item clicks handled by AGS automatically. So it should therefore work for any player character.

Or maybe you use your own custom inventory GUI?

Or are you indeed referring to that ICONBAR menu (Sierra-style) at the top of the screen with one of its buttons showing the currently selected inventory item, as we've been assuming so far?
#71
Hello and welcome to the forums! :)

As for your question, create a new GUI in the GUI Editor. Next click the "Add GUI Text Box" button and "draw" a textbox within the GUI area. Give this newly created textbox a script name. Double-click the textbox to add a function into the main global script to handle user input; add some code to test it in there:


function textbox-script-name-here_Activate(GUIControl *control) {

    // do the following when the player pressed the Enter key while
    // the textbox's GUI is being shown.


    Display( "You have just typed-in: %s", control.AsTextBox.Text );
}


See if it helps you to start getting it worked out.
#72
Ah good to know you are getting sorted it out!

And I indeed seem to misread it yeah, having it in only one room makes things easier to handle.

:)
#73
Well such things are typically achieved via iterating through all of the controlled characters in a "while" loop:

Code: ags

int id = 0;
while ( id < 5 ) // do for characters with numbers 0, 1, 2, 3 and 4
{
    int random_x = Random( Room.Width-1 );     // generate random room x coordinate
    int random_y = Random( Room.Height-1 );    // generate random room y coordinate

    character[ id ].Walk( random_x, random_y, eNoBlock, eAnywhere );    // make each walk to a random position
    
    id ++;    // proceed to the next character
}


See if it helps you to sort it out.

With the Character Control module you can set up a chain of actions to perform and then use the same method as above to make them all execute the previously defined chain of actions.
#74
When you say you've put it in repeatedly_execute, is it in the main global script or in a room script?

Try something like this:

in the main global script !
Code: ags

function repeatedly_execute( ) {

    if (AreThingsOverlapping( EGO, CARRO ))
    {
        Display( "They are overlapping! Press Alt-X to exit the game." );
    }

}


See if the message is displayed at all.
#75
So have you had any success on making it work?

It is of course possible to make it that the player could drop/put objects anywhere in any room but is it really a necessary feature to have to benefit game-playability?

Basically, because each room in AGS is a standalone entity with its hotspots/walkbehinds/perspective/etc you'd need to define a set of locations in each room for each inventory item to put, and that seems quite a lot of work to do.

You could probably make it less hassling by having certain locations where a variety of inventory items can be put in, but that would require you to classify the items (so a certain location will accept any item of a given class) which means extra coding as well as extra effort to specify a type for each inventory item. Depending on an overall complexity of the game world this task may be not very trivial to accomplish.
#76
So an external(separate) script/programme needs to be written by someone, to read through the game's source code to find "&1204"-style lines and replace them with "&1204+character_name" ones depending on the character's script name before "Say(...)". After that the modified source code should be imported back into the game so that a translation source could be generated containing "&1204+character_name"-style lines to indicate who is a speaker of each message. If translated text from the Excel document is structured in such a way that it is possible to identify who speaks which line, then again another programme could be written to automatically substitute Excel document's entries for "&1204+character_name" lines in the translation source.

Of course that person to write a programme should have access to the game's source code to try and make a reliable enough parsing/translating tool.
#77
Quote from: Samwise on Tue 04/12/2007 13:57:18Is there some way to "run" over the entire script, adding 2 last digits to each text line, according to the character saying it?

It is the right approach you want to take. Basically, it is possible to write a specialized program that would read the source code and substitute lines accordingly:

character[NISM].Say("&1204");   --->  character[NISM].Say("&1204<<NISM>>");

There is a Dumping text to file feature in the AGS Editor to easily export the textual data from your game into a text file to be processed later.

Depending on how the translation in Excel is formatted it might be possible to then read and analyze it along with the generated translation source file to create the resulting translation source!
#78
subspark, it's already possible to change sprite numbers in the editor (since AGS v2.56 as I see):

Sprite Manager :: Right click over a sprite :: Change sprite number...

It should of course be used with care.
#79
Yep, if the game is set to 320x200 it may look like that.

Try selecting a base resolution that fits your background:

Main menu :: Game :: Change game resolution...

Choose 640x480 there.

By the way, the very same dialog also appears when you create a new game.
#80
Hmm, quite possible I can imagine; it may probably have something to do with the fact that in dialogs the engine is stopped (no game frames are running) but the user input is constantly polled to update its state.
Anyway, it's just a guess from my side...

By the way, games invoking plugin functions (both: returning-something and state-changing) may also cause troubles for replay unless these plugin functions are handled properly from within the plugin itself (API should then provide means to handle the situation, ie. is_in_replay_mode), and that's yet another hassle to deal with, unfortunately.
SMF spam blocked by CleanTalk