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

#1
I think you're gonna have to programme it individually for each room.

And set a global bool variable for when the event is going.

Global Variable: MonsterFollowing = false;

Code: ags


function pickup_object()
{
   player.addinventory(iItem);
   monster.visible = true;       /// or however you plan for the monster to appear
   monster.followcharacter(cEgo);
   MonsterFollowing = true;
}

function leaves_right()
{
   player.changeroom(2, x, y);
   if (MonsterFollow == true)monster.changeroom(2, x, y);
}


Code: ags

 /// in Room 2

function enters_room()
{
   if (MonsterFollow == true)monster.followcharacter(cEgo);
}     



Then remember to reset MonsterFollow = false when the whole thing is over.

There may be a more elegant way, but that's how I'd do it with my current AGS knowledge.
#2
Quote from: Mandle on Fri 27/02/2015 05:35:22
I can promise you that a room change is not necessary

Oh yeah I definitely agree with that.

I'm just explaining how I personally got round it.

I think my issue was that my game involved pretty much the entire thing going through RepExec in every room, so it was hard to single out where a problem may have been occurring.

Anyway, my workaround worked so...  :tongue: . Now go kill some space cats.
#3
I had a similar problem in the game I just made. It also involved RepExec, and I absolutely couldn't make the event happen until I'd changed rooms.

My solution involved changing rooms and then changing back again instantaneously so it wasn't even noticeable.

However this is only possible if you set the room-change animation to instantaneous, instead of fade-in-fade-out.

My solution looked a bit like this:


In Global Variables create a bool with an apt name.
Let's call ours:
Code: ags

// Global Variables. (Not actually a script window. It's the Global Variables window. I presume you know what I mean).

bool AnnoyingNecessaryRoomChange = false;



Ok so you now have a bool, initialised as 'false', in the Global Variables window.

Now, onto the code.

Code: ags

  // in first room. 

function room_AfterFadeIn()
{

if ((cego.ActiveInventory == icutticket) && (cego.Room == 4)){     // so this the code that you say will only run once after a room change.
  obus.Visible=true;
  aBusarrive.Play();//play engine sound//
  obus.Move(60, 450, 2, eBlock, eAnywhere);
  aBusidle.Play(0, eRepeat);//play engine sound//

}
    // try adding this to the room script.
    //
    //
 
function The_function_where_your_character_finds_the_bus_ticket()
{
    cEgo.AddInventory(icutticket);
    AnnoyingNecessaryRoomChange = true;   
    SetNextScreenTransition(eTransitionInstant);
    player.ChangeRoom(2)
}



Code: ags

   // in Room 2 (actually you could change to pretty much any room. Change to a really basic, unimportant room without start-up events in. Just to be safe)

function Room_Load()
{
     if (AnnoyingNecessaryRoomChange == true){
         AnnoyingNecessaryRoomChange = false;
        SetNextScreenTransition(eTransitionInstant);
        player.ChangeRoom(4);
     }
}


This should flick you over to the other room, then instantly flick you back again so the animation will start.

The 'AnnoyingRoomChange' bool will be set to false after the event has happened, so you enter the other room normally after that.

#4
Made another game... and it's not an adventure game!

Space Bird Missile Cats

Defend the universe from the never-ending horde of space cats and their evil, deadly weapons!

Who can get the highest score...?  :wink:







Let me know if the download link doesn't work.
As with my previous game, I'm still in China so might have had upload problems.
I managed to get it into MegaUpload, but I've never used that website before so I don't know if I've found the correct link for file sharing.

DOWNLOAD

It's been another 'quick' one, bit of a training thing. Only took 5 days and I learned/practised a fair few programming techniques  :smiley:
Spoiler
Yes I know the high score table could have been placed into a single .dat file but it was a learn-as-you-go thing and I really didn't want to destroy my code by going back to try and fix it. So I apologise in advance for the 20 separate high score files you'll see in the game folder...
[close]

I think this'll be my last for a while. If I make another, it'll be a proper attempt at something big and bold.

Enjoy!
#5
Quote from: Crimson Wizard on Wed 25/02/2015 12:49:34

No, the script is just commands to the engine.

Ahhh ok. Right I get it. Thanks :smiley:
#6
Quote from: Crimson Wizard on Wed 25/02/2015 12:32:59
This feature is just not implemented into AGS yet.

Ahh right ok, that makes sense.

Is it possible to use the AGS script editor to design your own full-screen toggle from scratch?

Sorry if that's a dumb question. I'm still pretty new to the software so I just see as a C++ style platform with a fairly vast scope of potential. I don't really know what limitations there may or may not be.
#7
Oh christ I've just remembered this is exactly what I did already!!! I know about loops and used them extensively for most of the high score table.

I'm a total idiot for forgetting though.

I changed it to the 'long' method because I thought surely this isn't right, as there was something loosely related to the High Score table which wasn't functioning properly, so I put the entries into separate files to see if I could remedy it that way.

Needless to say, it didn't help.

However please don't feel that your reply was a waste of time. I had actually decided that my original method was the root of my other problems, but now you've confirmed that this method is correct, so thanks for that.
#8
Is there definitely not?

Surely it must be possible to somehow tell your computer to scale it back down and stick it in a window.

Hell, I just tested 'Alt+Tab' on my game with the intention of right-clicking on the program's  taskbar tab to see if there were any 'window size' options, and instead everything completely screwed up, the screen was crushed to half-width and the 16-bits of colour were reduced to about 4!

It looked pretty cool so here's a screenshot.

My main point is that the video settings were altered in-game, albeit by accident. So maybe it's possible to do it on purpose?

Feel free to shoot down my optimism, but hey a straight 'no' is a fairly sparse answer to be going from!



#9
I'm making an arcade-style game with AGS.

I have a high score table and it works.

However it took a huge amount of code and I'm certain there must be an easier way to do it.

It's a 'top ten' thing and it saves the scores so that when you reopen the game they're still there.
Hence I used arrays to hold and distribute the scores.

However I then found that I couldn't read file data back into the arrays.
I was fine writing the arrays to the file, but I couldn't read them back out again.
So I had to change it, so each score is sent to its own file and then retrieved individually like this:

Code: ags

function Get_Scores() // This function reads the scores from file then distributes them to array elements accordingly.
{
  File *HighScore1 = File.Open("HighScore1.dat",eFileRead);
  scores[0] = HighScore1.ReadInt();
  HighScore1.Close();
  File *HighScore1name = File.Open("HighScore1name.dat",eFileRead);
  names[0] = HighScore1name.ReadStringBack();
  HighScore1name.Close();
  
  File *HighScore2 = File.Open("HighScore2.dat",eFileRead);
  scores[1] = HighScore2.ReadInt();
  HighScore2.Close();
  File *HighScore2name = File.Open("HighScore2name.dat",eFileRead);
  names[1] = HighScore2name.ReadStringBack();
  HighScore2name.Close();
  
// etc etc etc up to 'HighScore10'



As you can see, I needed a separate section of script for every single value of 'name' and 'score'. So 10 chunks in total.

In the manual and in forum searches I couldn't find anything.
The manual says 'ReadInt' is for reading a single integer back into place, and 'ReadStringBack' is for reading a single string back in. No mention of reading array values from a file.

Did I miss something, or do something wrong, or is my long solution the only way?

Thanks. :smiley:
#10
Guys.

You're all just posting pictures of the same stye of toilet with different aesthetic designs.

So here I am now to take this thread up a level.

I hereby give you Chinese old-style public toilets:









Yes those partitioned areas are for shitting, and no they don't have doors.

As you can see, some of them just have a single trough which runs the length of the room, through every 'cubicle'. The flushing mechanism is automatic, so every 30 seconds or so, a big channel of water is let out from the cistern and all the poo is flooded away at once. Sometimes you'll see another person's poo wash by underneath you.

My university campus has toilets a little bit like the 3rd picture, the only difference being that the partitioning is better so you do get 'some' privacy. Not much though. Still no doors.
#11
Thanks to this 8 year old thread being dragged up, I've now downloaded the game and am trying it out.

I don't know if I've just got it set wrong, but for me the first room is very dark, with a lot of things to click on in the darkness (the cross-hair goes red), yet I can't interact with anything in any way, apart from when I select the one available inventory item and try it on everything and he says the same thing again and again, "That wouldn't be very good, would it?"

I was interested to try this game but it seems I can't do anything with it!

The intro sequence is very captivating and impressive, however.

Also there are some shocking spelling mistakes in the script. Had to be said.
#12
Quote from: shaguar on Fri 20/02/2015 01:47:40
Hi
Great visual setting and game logix so far.
I got the "Roger" Version of the game.
Is there any difference in the gameplay between this and your updated version ?

Nope, the puzzles etc are the same so gameplay is unchanged. I just changed the look of the character a bit, and added a map to the inventory, and added an opening menu to the game.

I fixed two game crash bugs in it too. You might not stumble across them anyway as they were quite obscure in the first place.

Also, on the old version, on a certain level where you need to give some things to a certain group of people, there's a thing you pick up an I'd missed one bit of code so it turns out you can pick up that thing as many times as you want and could have tens or hundreds of this item in your inventory, if you feel like it.  Not that it'll change the game, but it is a bug. I fixed that in the updated version too.

Oh and one quite handy change is that I changed the dialog font so it's larger and easier to read.
#13
Quote from: Mandle on Thu 19/02/2015 23:23:57


DUDE...you said something before about how you hoped the last scene did not offend anybody politically...

I don't want to get you paranoid, but if it involves making fun of Chinese political figures/situations then this could be a reason why your link is being censored.

Take care not to get framed as a political dissident by the Chinese government. They don't have a huge sense of humour from what I've heard...

Hmmm, I'm gonna chance it and say it's highly likely they won't be able to complete the game anyway as the level of English-speaking ability in China is surprisingly low in most areas. Furthermore, on the upload website there's no mention of what the last level involves, so I doubt anyone important will have seen the file among the hundreds of thousands that get posted every day and thought, "Hm! I should complete this whole game to make sure it's ok!". And, it's Chinese new year so anyone and everyone is at home with their families.

The final boss thing isn't really that bad at all, however if a non-English player doesn't really comprehend the dialogue and the plot, they might take it the wrong way.

However, to be on the safe side I think I'll delete all the attachments haha.

Anyway it's up on DropBox now :smiley:
#14
Awwww no! You're seeing this, aren't you:



I think we can thank Chinese internet censorship for this! :angry:

It works from my computer and has worked for others when I sent them the link.

My best guess is that it's been accessed by too many IP addresses so the Chinese government are saying, 'Woah, that's file distribution, not an email attachment', and have not allowed any new IPs to connect.

How very, very annoying. I'll work around it and let you know when it's on DropBox.

Apologies :sad:
#15
Quote from: Cassiebsg on Thu 19/02/2015 15:30:42
Ahm... How does one download? Can't see a link to click on when I get to that dwl page. :(

Is there not a blue 'Download' button in the middle?

It sometimes comes up in Chinese, in which case it'll be a blue button saying '下载'

I'll soon have it available on DropBox again, as soon as it's up I'll change the link to that. This Chinese one should be just fine for now though.
#16
Ok. Updated and it's ready. Final version.

DOWNLOAD.

The download link in the opening post has been corrected too so both should take you to the correct version.
#17
Quote from: Mandle on Thu 19/02/2015 02:33:10
Looks very interesting! And yeah, the Roger sprite kind of jarred me a bit when I saw it, but I will be checking this one out for sure. Maybe if someone with animation skills plays the game and likes it enough you will get offers to redo the main character sprite for you? Here's hoping!

Wait wait wait!

I'm in the process of upgrading a few bits. Namely the character sprite - it's still gonna look like Roger but I've managed changed his hair and clothing. Not much, but at least it's something.

Also I added a couple of other bits to polish it off, e.g. an opening menu when the game starts so it doesn't just dive straight into the first level. Also I've added a map to give the game a sense of progress, seeing as it's supposed to feel like you're going all over China.

I'll have it uploaded in the next hour or so, hopefully.

On a positive note - I shared the game on another forum and somebody did manage to complete it, so at least I know the puzzles are doable.:smiley:
#18
Quote from: Cassiebsg on Sat 14/02/2015 09:15:15
Hi and welcome. :)

Did you change the resolution of the game?
The default sprites are scaled for a 320x200 res. game. If you changed your game to run at 640x400 for instance, when you import your sprites back in they will scale for a 640x400 and not for the original 320x200... so they will look 2x as small... Is that what happened?

:shocked:

And now I finally understand what you meant when you said this........:embarrassed: (laugh)
#19
I found how to fix the issue.

As I said, when importing the sprites back into the game, they were coming in too small.

Today I noticed, in the sprites panel, when you click on a sprite, the properties window tells you its resolution. All my game sprites were at "640x400/640x480", but when importing them back in, they'd been put to "320x200/320x240" by default.

So I just went through each sprite and changed its resolution property to "640x400/640x480".

Jobe done!!!

My character isn't Roger any more :smiley:
#20
Quote from: Snarky on Tue 17/02/2015 16:14:51
Bitty?

You need to turn OFF the "resample" checkbox

Aaahhhhhhh, that did it.

However there's still something gone wrong somewhere. I just imported the new sprites in and when the character moves, it's very jittery and the clearly some sprites have different dimensions because the size of the character appears to flicker from small to big at certain points as he walks. How very odd! The 'bitty' aspect was fixed though, so that's good and it'll be useful for resizing inventory sprites etc in the future.

Either way, I need to confess I became impatient and finalised the game with the default red-sleeved character. I guess I've lost a touch of originality, but my real pride is in having programmed it and written the story, rather than the way the player looks. Maybe in the future I'll design my own sprites from scratch. Not any time soon though - it's an art form I'm yet to even dream of trying!

Anyway, game done, happy happy!
SMF spam blocked by CleanTalk