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

#101
Not really, the problems are:

1- Index +1
2- While loop is totally unecessary and dangerous.
3- RestoreGameSlot(int slot), not a string
4- ItemCount + 1, should be SelectedIndex +1

and so on, thats why I re-wrote the code so you can have a clean save/load option, it's up to you to use it, but at least you have a proper example.
#102
Your saving function is strange.

Code: ags

function Button38_OnClick(GUIControl *control, MouseButton button)
{
  if(lstSaveGamesList.SelectedIndex >= 0)
  {
    SaveGameSlot(lstSaveGamesList.SaveGameSlots[lstSaveGamesList.SelectedIndex], txtNewSaveName.Text);
    Display("Data Saved");
  }
} 


Your Load function isn't going to work either:

Code: ags

function Button39_OnClick(GUIControl *control, MouseButton button)
{
  if(lstSaveGamesList.SelectedIndex >=0)
  {
    RestoreGameSlot(lstSaveGamesList.SaveGameSlots[lstSaveGamesList.SelectedIndex]);
  }
}


This should be more simple, also when you load items into a listbox, the first item has index : 0. so if you saved at Index +1, then make sure you're loading the savegame at Index +1 as well, but you could save on slot 0.

Btw, I see you indented your code this time, and it's really easier to read, keep your code always clean like that.
#103
Quote
Setting a variable is far faster than making a comparison.

That's not always true, in this case the variable is a boolean, in assembly, the only difference between comparing and setting the value is a conditional jump which are both the fastest instructions for processors(mov,jump), having the check or directly set a variable is pretty much the same execution time. The difference could be bigger if we were talking about a string or object, comparing strings takes some time.

Edit: I think if there's room for optimisation in a code, it certainly doesn't come from this kind of detail, but rather like Khris said, from several lines of code which get executed when it's not needed. The idea behind your checks is good, but not necessary in this case imho.
#104
Critics' Lounge / Re: First post...
Fri 22/04/2011 17:53:52
Hello,

I'm not really an artist, but I can tell the roof is a bit strange. I hope you don't mind the quick edit, it's easier for me to explain it that way:



Not sure if this is the best way to fix it, but I hope you get the idea.

Otherwise it looks good to me, a few numbers on top of the doors would be nice since this is a Hotel.
#105
Completed Game Announcements / Re: Dreamagine
Fri 22/04/2011 14:56:56
I've had the same problem, I have no idea how I got it though:

Spoiler

I insisted a lot, went to the tower with the princess and tried to interact with everything again, then went back, clicked the sword and I picked it up.
[close]
#106
I can see why you think it may cause a slowdown, but the game will always execute the rendering function , so when you change NormalGraphic to 17, you're not calling the rendering function, just changing its parameter, it will be executed anyways.

If the sprites are the same size (length) then there's absolutely no difference between RenderGraphic(17) and RenderGraphic(35).
#107
"Undefined symbol" Output means you probably forgot to declare the mentioned variable. Decalaring x and y is accomplished with this line you must have forgotten in the process:

Code: ags


int x, y;



If you only use x and y inside Attack() then put these lines inside the function, otherwise outside.
#108
Yes, you don't need that check, having the processor compare values or change variable from true to false is almost the same execution speed so no real optimisation.

If you only need to hide a control, then just one line will do, I thought maybe you had to perform other actions on the control, because otherwise you wouldn't need a function in the first place, obviously ;)
#109
Ah no, I mean that you don't need an overload to accomplish what he wants, your code is totally fine and viable option, just saying overloading is used for different cases like when you need your function to accoplish the same thing with different variable types.

Like :

Code: ags

float Add(float a, float b);
int Add(int a, int b);


Here the 2 variable types are actually just one, because the Gui is the container for all controls, with a GUI variable you can access any controls.
#110
Except that in this case,  I don't see why you'd need an overloading function imho. But it's nice to see we can overload member functions :) I stand corrected.
#111
This is called overloading functions and is not possible in AGS, but you could have something like:

Code: ags

function HideAnything(GUI theGui, int control_num)
{

  if(control_num < 0)
    theGui.Visible = false;
  else if(control_num < theGui.ControlCount)
    theGui.Controls[control_num].Visible = false;

}



"control_num" is the ID property of the controls. Using -1 will hide the Gui itself, any other num will hide the corresponding gui control. Is it what you're looking for?
#112
I've run a quick test and didn't get any problem with NVidia or ATI, fullscreen D3D, by using this command with a random anime video I had (.avi), I put it in compiled folder of the game, but can be any subfolder.

Quote
PlayVideo("agstest1.avi", eVideoSkipAnyKey, 1);   //1 for fullscreen/stretch/black borders

I'm no video editing expert, but could it be that you had some weird/unusual settings in the video maker you used?
Also you seem to have only tried with YOUR video, does it work with another one you didn't create yourself?

The only other thing I can think of is an outdated DirectX version.
#113
These things happen in programming, sometimes you just forget a part of the code you wrote or you may have used a scriptname already reserved, out of range index like the sprite number or whatever.

It most probably comes from the user, I haven't had any issues with guis even after heavy mistreatment... If the problem persists and there's no precise debugger output to help you, then you could either send the game file in PM for quick debugging or report the problem as an officil bug. Anyways, happy coding!
#114
I'm wondering if you guys have the latest graphic driver for your card, and if you're using the new version of the AGS Editor. Have you tried re-importing the video? Does it play normally in full screen outside AGS (in your media player)?

Also have you tried to import another random video in d3d to see if the error comes from your video itself?
#115
This is pretty simple, when you look at the property panel on the right for your Label, you can set the "Text" field to "@OVERHOTSPOT@" without the quotes, now set the "Description" field of your hotspots/scenery to whatever you want to display when the mouse is over it. Or did I miss something, maybe you wanted to do something different or more advanced?
#116
40 is the default game speed, that's why Khris used GetGameSpeed() so that it works with whatever you want.

GetGameSpeed()*1 = 1 second
#117
"won't display..." when you add +50 hp, are you updating the Label or whatever displays the HP? I mean like:

Code: ags

PlayerHP += 50;
HPLabel.Text = PlayerHP;


So this is supposed to be a revive buff that avoids death? On top of what Khris already mentioned I think it would be good to have some functions in your code:

Code: ags

function Attack(source, target)
{

  //walk to enemy or whatever
  //animate damage and attack

  ApplyDamage(source, target);

  if( targetHP <= 0 )
  {
    if( target == player && BuffButton.Visible == true )
    {
      ApplyBuff(Player, GIVE_50_HP);
      BuffButton.Visible = false;
      HPLabel.Text = playerHP;
    }
    else
    {
      ApplyDeath(target);
    }
  }

}


This should help keeping the main code clear, and then all you have to do is split the actions into several functions like I tried to demonstrate.

Btw, scripting and coding in general relies on strong logic and strict grammar,  you can't expect "the game" to do anything but follow your commands, if it doesn't display something, then you probably didn't ask the game to do it. I hope it helps.
#118
Well you will need CJ or one of the AGS developpers to answer the question of raising the limit or even making it dynamically assigned. If you PM'ed then you will eventually get an answer.

Just in case the request isn't accepted, you can rely on people here to help you find a workaround, like the one we were discussing earlier, and make the process as painless as possible for you by providing code, suggestions etc   :-*

Just one thing, I wonder if having like 60k sprites in one exe would alter the performances compared to 30k, but regardless of the method or the difficulty involved, I think it would be nice to split the resources.

Regards

#119
Critics' Lounge / Re: Perspective Doldrums....
Wed 13/04/2011 06:25:41
Hi there,

I just wanted to point out something I noticed:

-The junction between left wall and bottom wall is a strange thin black line, it seems too thin compared to the usual space there is between bricks.

-It looks like either the wooden part of the door or the surrounding bricks are a bit off, if you draw the vertical line in the center of the door you'll see what I mean. The bricks and floor are aligned but not the door.

I like it, and the textures are nice :)

Edit(after your last post): I have noticed something else, it's just a matter of personal taste and by no means a major issue, but I think it would look better if the whole door was slightly moved to the left, because it looks like it is not centered, there's much more space on the left part of the wall than on the right.
#120
Thanks for the tips, I also want to achieve something similar, now I can use your idea for dialog text display too, but I also want to have a custom dialog option system, so I thought I had no alternative left...

But I just discovered 'DialogOptionsRenderingInfo' and a set of threaded functions can be defined to totally customize the options display/behaviour. This should work beautifully!
SMF spam blocked by CleanTalk