Quote from: Oldschool_Wolf on Thu 27/06/2013 18:32:51I know, she taught you everything you know.
My niece has more fighting skill!
-----------------------------------------------
Your mother wears army boots!
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 MenuQuote from: Oldschool_Wolf on Thu 27/06/2013 18:32:51I know, she taught you everything you know.
My niece has more fighting skill!
QuoteAn option like "Zoom 2x" in the winsetup.exe might do wonders (or changing the screen resolution itself).Is this a suggestion? AGS currently has this - unless you're playing an older AGS game which only has the 640x400 or 640x480 zoom.
function speech_render(SpeechRenderingInfo *info) {
gSpeech.Visible = true;
lSpeechLabel.Text = info.Text;
// play sound
if (info.Audio != null) { // I haven't worked with Audio in a long time, so the following code may be wrong
info.Audio.Play();
while (info.Audio.IsPlaying) Wait(1); // of course not forgetting about skipping text if audio is playing, I got lazy to type it
} else WaitMouseKey(info.Delay);
gSpeech.Visible = false;
}
Quote from: Crimson Wizard on Wed 26/06/2013 23:49:01Oh wow. Learn something new about AGS everyday. You've done your homework.
Also, it is not my invention, this is the replacement for "game.skip_speech_specific_key" variable.
function speech_render(SpeechRenderingInfo *info) {
// show your own GUI, Overlay, etc, giving a custom way of drawing the speech text to screen
// having access to this stuff:
// info.Text to access the text being Said <-- the text passed with the Say function
// info.AudioFile <-- the audofile passed with the Say function
// info.Delay <-- the delay that AGS would've had if it were using its own function
// etc
}
Quote from: MiteWiseacreLives! on Wed 26/06/2013 15:29:05
I've used the object[ID] to apply settings to a large number of objects etc during runtime, kind of like Billbis is describing. Not so handy with script names, unless I am overlooking a method.
Quote from: Crimson Wizard on Wed 26/06/2013 15:45:12Nope. I meant exactly what I said. Accessing "Objects" by a strict ID is a terribly, terribly poor coding practice ("Objects" being GUIs, Characters, Objects, Hotspots, Regions, WalkableAreas, etc). They should be accessible via an ArrayList (which of course is the same thing, but you shouldn't have Character.ID to find what index it is in the ArrayList).
Indeed, working with ranges of elements is important possibility, and its not going anywhere.
Although I am not sure if Ryan meant accessing elements of array; I thought he means accessing Object.ID property.
// Character variables created in the accessible "Game" script
Character cHenry = new Character("Henry", 100, 150, 5); // Name: Henry, X: 100, Y: 150, Room: 5
Character cSally = new Character("Sally", 110, 160, 6); // Name: Sally, X: 110, Y: 160, Room: 6
Character cFrank = new Character("Frank", 120, 170, 7); // Name: Henry, X: 120, Y: 170, Room: 7
// Characters being added to the AGS character ArrayList
Game.Characters.Add(cHenry);
Game.Characters.Add(cSally);
Game.Characters.Add(cFrank);
// Getting the index of cSally - if you ever needed it, which you shouldn't in most cases
int sallyIndex = Game.Characters.IndexOf(cSally);
// iterating through the Characters ArrayList
foreach (Character c in Game.Characters) {
c.Visible = false;
}
// iterating through the Character ArrayList as it is now
int i;
while (i < Game.Characters.Length) {
Game.Characters[i].Visible = false;
i++;
}
Quote from: Crimson Wizard on Wed 26/06/2013 10:31:56I'm really not sure why being able to access the "Object" ID was ever implemented in AGS. Likely due to the limitations of AGS script and then trying to stick with the whole backwards compatibility - which in my opinion is only hindering all radical improvements of the editor.
But using explicit ID may be replaced with script name, which is far more safe.
if (mouse.Mode == eModeUseinv)
{
// I don't know how this module was scripted, so as a fail-safe, I put: player.ActiveInventory != null
if (player.ActiveInventory != null && game.inv_activated != player.ActiveInventory.ID) inventory[game.inv_activated].RunInteraction(mouse.Mode);
}
if (mouse.Mode == eModeUseinv)
{
if (player.ActiveInventory != null && game.inv_activated == player.ActiveInventory.ID)
{
player.ActiveInventory == null; // deselect inventory item if you click the same item on itself
mouse.Mode = eModePointer;
}
else inventory[game.inv_activated].RunInteraction(mouse.Mode);
}
Quote from: Crimson Wizard on Wed 26/06/2013 08:20:41And then you have this:
There is no need to call Game.GetLocationName here, because you already know that it is "game.inv_activated" item id, therefore you can use inventory[game.inv_activated].Name; but further, you don't really need to compare Names, you can just compare pointers:
QuoteCode: ags // if player has active item in hand, use it no matter what (we may get "unhandled event" here) if (mouse.Mode == eModeUseinv) { if (player.ActiveInventory.Name != Game.GetLocationName(mouse.x, mouse.y)) inventory[game.inv_activated].RunInteraction(eModeUseinv); }
if (mouse.Mode == eModeUseinv)
{
InventoryItem *item = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
if (item != null && player.ActiveInventory != item) inventory[game.inv_activated].RunInteraction(eModeUseinv);
else if (GetLocationType(mouse.x,mouse.y) != eLocationNothing) ProcessClick(mouse.x, mouse.y, eModeUseinv);
}
if (inventory[game.inv_activated].IsInteractionAvailable(eModeUseinv) == 1)
if (inventory[game.inv_activated].IsInteractionAvailable(eModeUseinv))
// OR
if (inventory[game.inv_activated].IsInteractionAvailable(eModeUseinv) == true)
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.149 seconds with 15 queries.