Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.


Messages - Ashen

Pages: [1] 2 3 ... 161
1
Beginners' Technical Questions / Re: robot fight
« on: 21 Dec 2007, 11:43 »
If you haven't already, a good place to begin would be getting to know the File functions and properties. If you're going to be reading/writing to text files, you're going to need them.

You can't import code from a text file directly into AGS and have it run like AGS code. However you can read a line back from the file, check if it contains a specific word (lke 'shoot', 'scan', etc) and run the approriate code from, that. I've done something similar in the AGSConsole module, you'd just need to change the functions (GetAtIndex, StrAtIndex, GetCommand) to get their input from a file instead of a TextBox. This'd mean you could develop your own syntax for programming the robots in the file, instead of sticking to an AGS-like format as in your example. RickJ's IniFile module (if it's currently working ... depends on what AGS version you're using, I think) might help here, by giving you an existing structure to work in.


What's the point of using the text files, anyway? I guess external files would allow players to customise their robots, but I think you'd be able to do that within the game as well. E.g. by having a GUI to select what order to run commands, tweak parameters, etc. You should be able to 'export' the 'bots to a text file to play on other PCs, but that file wouldn't need to be human-readable or writable, making the whole thing a little easier, IMO.

2
Quote
I didn't even know there is something like "previousroom"...

Which is why you're supposed to read the manual before posting questions.

ChangeRoom is a 'queued' coomand - it doesn't run immediately, but is executed at the end of the block of code it's called in. (This is also in the manual ;)) So, in effect, OneDollar's code and Creator's are the same, and would have the same problem. Using player.PreviousRoom is a much neater solution anyway.

3
Or, if you're not very far into your game, update to 3.0 which has no limit on Frames per Loop.

4
Meny, please read the manual. It'll save you a lot of time and frustration with the little things like this.

5
Also, GetText should direct you to the new version if you look it up in the manual.

What version are you using? While it's possible you're using the single version that Get/SetText was valid in (2.7), the rest of yur questions make it look like you just haven't read the manual.

6
Beginners' Technical Questions / Re: Quest Start help
« on: 20 Dec 2007, 09:52 »
That'd move the player to Room 16 when they make the Devil's Weapon their active Item (and without some modificaton, EVER TIME they make it active), not allow them to start the quest only if they have it in their Inventory.
ncw14, you could try reading the BFAQ: Checking if player has a certain Inventory Item.
So, wherever they pick the quest up from (talking to an NPC, etc):
Code: Adventure Game Studio
  1. if (player.InventoryQuantity[iDw.ID] == 0) {
  2.    Display("You can't start this quest without the Devil's Weapon.");
  3. }
  4. else {
  5.   // Player has DW, so start quest.
  6. }
  7.  

I hate to have three locked threads of yours on the run, in such a short time, but this really does seem to deserve it. Are you even trying to look things up in the manual/BFAQ/forums first?

7
Just as Pablo says.
You can set an individual int at declaration outside of functions (int city = 1; would work, but not int city; city = 1;), but members of an array - and other variable types, e.g. String - have to be set in a function (e.g. game_start). Check the BFAQ for more details on how/where you can set variables - although it doesn't mention arrays.

Also ints default to 0, so you'd be able to skip lines 3-5 altogether in that example.

8
Beginners' Technical Questions / Re: Finished game
« on: 19 Dec 2007, 21:27 »
What you need to include in the download is covered in the Manual, under Distributing your game.
To put it online, you'll need somewhere to host it. See the Hosting services page in the AGS Wiki, or try a forum search - this question comes up pretty often, so a forum thread might be more up to date, and will have more suggestions than the wiki.

Since this isn't a AGS Technical question, and there are already plenty of threads answering it, I'll lock this one.

9
Beginners' Technical Questions / Re: Arrow key movement
« on: 19 Dec 2007, 21:21 »
Try a forum search for 'keyboard movement', or something similar. Amongst other threads, there's the KeyboardMovement module, and a whole bunch of other suggestions.

10
Gilbot's advice is good, but I agree with Ishmael (as does the error message it's self), so I'll move this to the Tech forum.

11
Beginners' Technical Questions / Re: Givescore
« on: 19 Dec 2007, 10:22 »
Go back and read the manual entries for SetGlobalInt and GiveScore (along with everything else on variables you can find). They're two quite different functions. SetGlobalInt, as the name suggests, SETS the Global Int to whatever value you input; GiveScore on the other hand ADDS the value you input to the current score. So, the two lines you quote:
Code: Adventure Game Studio
  1. GiveScore (100);
  2. SetGlobalInt (1, 100);
  3.  
Aren't actually doing the same thing.

What are you asking? Because the obvious answer to "how do i add 20 to givescore" is GiveScore(20); - as it says in the manual. (The current score is the game.score variable, but you can't set that directly.)
The way to ADD to a Global Int would be SetGlobalInt(1, GetGlobalInt(1)+20); - which isn't in the manual, but is in the BFAQ.

12
It's not immediately obvious, but since the manual entry for Object.Move says:
Quote
It will move at speed SPEED, which uses the same scale as the character Walk Speed values in the AGS Editor.

This means that, like Walk Speed, you can use a negative value for slower than 1. I think they're equivilant to '1/x', so -2 is 1/2 the speed of 1, -3 is 1/3 the speed, etc (-1 would be 1/1 - and does seem to be the same as 1).

13
A scripted path is the only way to walk to a Walkable Area - but maybe you could use a dummy Character to automate it.

- Check if cEgo isn't standing on a Walkable Area (if (GetWalkableAreaAt(player.x-GetViewportX(), player.y - GetViewportY()) == 0)),
- If not, bring cDummy to the Room at the same coords (cDummy.ChangeRoom(player.Room, player.x, player.y);) and 'jump' them to a Walkable Area (cDummy.PlaceOnWalkableArea();).
- Walk cEgo to cDummys new location, using eAnywhere (player.Walk(cDummy.x, cDummy.y, eBlock, eAnywhere);).

Call that code from the Global on_event, and you should be good.

14
We can't really help unless you tell us the exact error message(s), and the line(s) mentioned.
"There is a parse with" doesn't really mean anything, but if you give us examples of the actual errors and code you use, we should be able to tell you where you're going wrong.

Make sure you've checked the manual, BFAQ and search the forum for working code examples before you ask, though.

15
As a related-but-not-quite RTM: PlaySoundEx is the only mention of a voice speech channel I've seen.

Quote
AGS now uses a multi-channel sound system. There are currently 8 sound channels, numbered from 0 to 7. They are used as follows:

0    Background music, used by PlayMusic
1    Ambient sounds, used by PlayAmbientSound
2    Voice speech, used when you have automatic speech in your game.
3-7    Free channels, used by PlaySound, view frame sounds and so on.

So voice speech shouldn't hijack the ambient sound channel, unless you're using some custom system for them. On first glance, I'd say it's more likely to be game.speech_music_drop as SSH suggests.

16
If that's exactly what you're doing, you're redeclaring the varaible each time - meaning it's set to 0 Plus the new score, not the old score plus the new score. Declare the variable (int scorered;) at the top of the script, and just add to it when points are scored, and it should work fine. That's just basic variable handling, nothing to do with String.Format.

Having both scores displayed should just be a case of having a line to set each, e.g.:
Code: Adventure Game Studio
  1. rscore.Text = String.Format("%d", scorered);
  2. bscore.Text = String.Format("%d", bluescore);
  3.  

You can either call that every time points are added, or stick it in repeatedly_execute to have it automaticaly update.

17
OK, I see. No, there's no way around that kind of trial and error testing, sometimes. However, if I'm understanding right, you're trying something across 140 rooms, it doesn't work so you have to make a change across 140 rooms, still doesn't work so make ANOTHER change across 140 rooms, etc. That would get pretty mind-numbing, yeah. But surely the sensible thing would be to try it in one or two rooms until you're sure it works, THEN add it to the other 138?

It kind of seems like your problem here isn't so much the way AGS handles Room functioning (although an eEventAfterFadein would be a decent addition), but just being too ambitious - not in the overall scope of the project, but in trying to do everthing at once. Pick a room, work on it, figure out what functions will be needed in other rooms and make them global, finish the room, move on to the next. There might not be any way around having to add function calls to each individual room, but by minimising the number of rooms you're working on at any one time, you minimise the number of changes you have to make until the bugs are worked out. This is another reason people usually recommend working on a small, one or two room, test game to start with, instead of leaping right into a 140+ room masterwork. Also why I have a couple dozen 'games' with just a single piece of functionality in them - to get it working without having to mess up a larger project along the way. (Not that I have any larger projects :))

18
You might be able to fake it if you disable the 'Fade In/Out' transition and script it in on_event using the FadeIn/Out fuctions (as in this thread). You can then call things before and after the fade in. Anything that's Room specific can probably be handled using CallRoomScript, and placed in the Room script using on_call instead of the default before/after fadein' interactions. (Or, use the data parameter of on_event to get the current room, and have a bunch of conditions in the Global script.)

Quote
Every day I need to make a change like this it's "here we go again, time to do the exact same thing one hundred and forty times."

Why do you need to change the function call each time? Once the call is in place (my_func();), changing the body of the function will change what happens every time it's called ... Am I missing something?

19
This might be an obvious question, but I don't see it mentioned anywhere: Have you disabled the default fade transitions? (SetScreenTransition(eTransitionInstant), or from general settings.)
It could be that the default fade and the FadeIn command don't play well togther...

(And I've noticed that anything above 2 is still a very quick fade, too.)

20
As well as Walkbehinds, you might need to change the Character's z property, so they walk down the stairs, but away from the 'camera' (which is up the screen).

SSH's Downhill module could be the one Recluse is thinking of. Even if it isn't it might still help here, handling the z-coordinate part.

Pages: [1] 2 3 ... 161