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

#2021
I've know AGS to crash after it has been open a long time, so it can sometimes just be worth quitting and reloading to avoid these kind of problems. Its very hard to track down such bugs, though.
#2022
Also, if you want to make your code more re-usable, you can use System.ViewportHeight instead of 240, System.ViewportWidth instead of 320, gMap.Width, gMap.Height and Room.Width
and Room.Height to get the total size of your room.

Code: ags

  destx=(((mouse.x-gMap.X)*Room.Width)/gMap.Width)-System.ViewportWidth;
  desty=(((mouse.y-gMap.Y)*Room.Height)/gMap.Height)-System.ViewportHeight;

#2023
The problem may be that if you keep adding speedx to xpos (similarly with y) then it may never actually reach destx. So you need to, each cycle, compare the difference and if the difference is less than speedx, just set xpos to destx, otherwise do the addition. Also, why not just use negative speeds instead of all those ifs?



Code: ags

diffx = destx-GetViewportX();
diffy = desty-GetViewportY(); 

int speedx = (diffx/10); //Set speed so larger distances are
int speedy = (diffy/10); //covered in the same time ie. scrolls faster

Wait(1);

xpos+=diffx%10; // Make sure we end up exactly on the spot
ypos+=diffy%10; 

while ((ypos != desty) || (xpos != destx)) {
  SetViewport(xpos, ypos);
  Wait(1);
  ypos+=speedy;
  xpos+=speedx;
}

#2024
In most modules I have written, I usually set pointers to null after I have deleted the Dynamic Sprite or Overlay ro whatever, so that I only have to do one check. But of course, you can't path a null pointer...
#2025
HPUX ROX U ALL
#2026
I don't think we need to be so dogmatic about this. I'll keep an eye on the votes, and if the problem starts to be seen, I can:

a) Contact those doing it and ask them if they really played any other games, etc.
b) Remove those voters who can't give a good answer

And Erin doesn't need to hack the voting page. Judging by previous reposnses, she just needs to post some pics in the Long Overdue thread and she'll have millions of adoring fans ready to do her bidding anyway ;)

Also, I think the www.adventuregamestudio.co.uk thing means that the games pages are wrokign again, so go add your games!
#2027
Try the AGDI forums: http://www.agdiforums.com/forum/viewtopic.php1078

Quote from: arethaAnd then I renamed 1.vf1 and 2.vf2 and game runs fine.  These files were the issue on KQ1 aswell.

Quote from: AGC2If we do another release of the game, I'll remove those .vf1 and .vf2 files from the game directory. They are not really necessary anymore.

However, in KQ2VGA you should not touch the 3.vf3 file at all. If you delete/rename the other two, it will still work fine, but 3.vf3 is required for the mirror cutscene to play, so you should leave that one fully intact.
#2028
It kind of emphasises the need for a module section in the "games" database...
#2029
Quote from: monkey_05_06 on Tue 07/11/2006 03:28:39
But if you want you can coin the phrase "workaround" instead of "solution." That's what I use. I would never refer to my b0rked module as a "solution." :D

If you're not part of the solution, you're part of the precipitate, as my chemistry teacher used to say...

#2030
Quote from: monkey_05_06 on Tue 07/11/2006 06:17:02
Helm is such a sociopath. He makes me laugh.

An episodic sociopathic capriniae? The mind boggles!
#2031
More practical than "Script Link Failed:  Runtime error:  unresolved import 'SKMG::PlayGame^10'" ;) :P
#2032
No, that won't work, Mikko, as the variable is still local to the function.

Nachtpoet: edit the global script. Right at the top of the global script, put your "int counter;" line
then also remove the counter=0 line from the inventory interaction function.

That should do the trick.
#2033
Even better would be:
Code: ags

//At the top of global script

int Health[AGS_MAX_CHARACTERS]; //creates health variables for everyone

//At game_start section

int i=0;
while (i<AGS_MAX_CHARACTERS){
Health[i]=100; //All Health variables come 100 at the begining
i++;
}


#2034
Personally, I think it is better to have those paramters as properties of your object rather than have  huge argument lists, anyway. It makes the code waaay more readable to have:

Code: ags

SKMG.xbar_left=10;
SKMG.xbar_right=100;
SKMG.ybar_up=20;
SKMG.ybar_down=200;
SKMG.NumberOfRows=4;
SKMG.Speed=5;
SKMG.Varience=13;
SKMG.Max=98;
SKMG.StopAt=97;
SKMG.SlideDirection=up
SKMG.PlayGame();


than..

Code: ags

SKMG.PlayGame(10, 100, 20, 200, 4, 5, 13, 98, 97, up);

#2035
Becuase you initialise the variable to 0 every time you run the script. The variable needs to be outside the interaction function.

Or.... you could use my MultiResponse module which makes doing it sooo much easier...
#2036
Well, I tried to get CJ to commit to fixing the voting page at Bonfirittens this weekend, but his response was "I'm too drunk just now to thing about that". This was after two cans of Carling...  ::)

Anyway, I will keep up the pressure and hopefully all will be hunky dory soon.

#2037
General Discussion / Re: Don't forget to vote!
Mon 06/11/2006 16:45:41
Since Greece has compulsory voting, and the US and UK don't I don't think you can really compare their attitudes to voting. I don't think you can say that people who don't vote can't complain, as it depends on whether they would vote for "none of the above" if that was an option (as I believe it is in Russia).

In a two-party system, such as the de facto in the UK and US, it is quite easy to see someone's reasons not to vote for either choice. And a vote for any other parties is known to be wasted...

In the UK, all the parties canvassing, focus groups, campaign money etc. is concentrated on marginal seats. I have never had a politician of any ilk come to me and ask my opinion. Sometimes I have voted and sometimes I have better things to do.
#2038
Try making a room repeatedly_execute and call the function in there
#2039
General Discussion / Re: Democratic Socialism
Mon 06/11/2006 11:59:36
I would guess it was more likely a Spanish school, since that where Nacho lives...

A problem with state control of things is that the state screws things up. Look at any UK government IT project and you'll see what a hash is made of it. And building projects, and many other things. Competition and private enterprise are good for general efficiency.

The problem with pure unregulated capitalism is that the rich can exploit the poor, so there needs to be some redistribution of wealth.

The centre of politics is the place where things realyy work in the long term, and thank goodness that British politics now has 3 parties with nearly indistinguishable policies.
#2040
In past 5 years:

- had 2 children
- been to Canada
- met CJ
- seen a big pile of salt in Sunderland
- changed jobs twice
- written about 14 games
- written about 300 modules
- been to Spain a lot
- got slightly less bad at speaking Spanish
- taught my wife to drive

SMF spam blocked by CleanTalk