AGS 2.61 Pre-final Edition

Started by Pumaman, Sat 28/02/2004 23:04:11

Previous topic - Next topic

edmundito

#120
Quote from: SSH on Tue 27/04/2004 09:09:27
No-one seems to have noticed the editor plug=in new feature! This looks great. Finally we can do all those things that CJ is too lazy busy to implement...!

EDIT:

Quote
"Next, still with the class selected, look down the properties list for "Instancing". This is initially set to "2 - PublicNotCreatable", which means that other applications can't create the object. We need to change it to "5 - MultiUse", so that the AGS Editor can load the plugin."

This step of the tutorial is impossible with the free VB5 download... any ideas anyone?

Also, any plans to add more than the dialog system to this API, CJ?



If I could figure where this is with visual studio.net 2002 you could actually make stuff with C#... AGS would truly become AGS.net! OMG OMG OMG.... :P

Edit: Oh! It's Public!  :o

Edit 2:
I actually figured out how to code it with C#, even though I don't know C# nor remember much of visual basic. But the code actually compiles, and I'm sure I did it partially right because C# is as picky as Java (we all know why)

Anyway, here's what I get:

---------------------------
AGS Editor Warning
---------------------------
A plugin 'AGS_TestPluginCS.dll' was found in the editor folder, but it did not support the required interfaces.
---------------------------
OK  
---------------------------

I think it may have to do with the whole multiuse thing. I should look into it some more, but maybe I should sleep! Sleep it is :P

Edit 3: I found the problem:
"Visual Basic 6.0 ActiveX documents are not supported in Visual Basic .NET. You can still interoperate with ActiveX documents from your Visual Basic .NET Web applications, but development should be maintained in Visual Basic 6.0."

Meaning it won't work for the others like C#/J#...bah!
The Tween Module now supports AGS 3.6.0!

Isegrim

Got a bug record (or maybe I'm just too stupid):

Can it be that RawDrawImageResized works only with 256col sprites? when I try it with a true col one, it's all weird, whereas the 256col attempt looks fine... (no matter what color depth the actual game has!)
If this is intentional, it should be documented in the manual, I think...
This post was generated automatically and therefore bears no signature.

strazer

What do you mean, it's all weird? Like, it's not displaying at all or it looks strange?
I've tested it an hour ago and it worked fine with my true color sprites.

Phemar


I think this is a bug, but not sure: I'm using sierra style speech. Sometimes it displays the speech at the top of the screen, and sometimes it don't, instead it display it like Lucas-Arts style...

...Uhh...

Scorpiorus

If the character doesn't have a talking view assigned then the lucas-arts speech style will be used.

Phemar


Nay, of course it has a talking view...thay all got talking views, don't you know? Well, you probably didn't...I think it only does that with DisplaySpeechBackground, but not sure...

Rui 'Trovatore' Pires

From the manual -

QuoteDisplaySpeechBackground
DisplaySpeechBackground (CHARID, string message)

Similar to DisplaySpeech, except that this function returns immediately and the game continues while the character is talking. This allows you to have characters talking in the background while the player does other things. Note that the character's talking animation is not played if this function is used.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Isegrim

About my "Bug report": I tried the RawDrawing before a completely blank background. No BG image, no RawClearScreen. That gave a stange color-inversed and interlaced look.
Clearing the screen or using a BG image solves the problem...
This post was generated automatically and therefore bears no signature.

Pumaman

Quote from: SSH on Tue 27/04/2004 09:09:27
This step of the tutorial is impossible with the free VB5 download... any ideas anyone?

Hmm I didn't realise that. Try using a UserControl rather than a Class Module, and put all the code in there instead. Though this gives you an unwanted GUI component, I believe the User Controls automatically have the correct Instancing.

QuoteAlso, any plans to add more than the dialog system to this API, CJ?

As I said in the original post, if people find this useful then I'd be happy to add more. It takes a fair bit of time to add the interfaces, so I'd rather only do it if people are going to use it. :)

QuoteI'm so rusty with VB. Could you give me a hand with this. It should be along these lines:

Dim a As AGSDialogTopic

a = editor.Dialogs.NewTopic()
a.newOption ("option 1")

which doesn't work. The following does:

With VB, you have to use "Set" for objects. If it's not an object and you use Set it crashes; if it is an object and you don't use Set it crashes.
This is one of the stupidist and least intuitive things ever about VB - it knows whether the variable is an object or not, so why not take care of it automatically? Sigh.

And talking of stupid VB syntax, you can only use brackets in a function call if it returns a value. If it doesn't and you use brackets, it will usually crash.

Anyway, to make your code work:

Dim a As AGSDialogTopic

Set a = editor.Dialogs.NewTopic()
a.NewOption "option 1"

QuoteCan it be that RawDrawImageResized works only with 256col sprites? when I try it with a true col one, it's all weird, whereas the 256col attempt looks fine... (no matter what color depth the actual game has!)

This is probably a colour depth mismatch. RawDrawImageResized only works if the source image and the destination are the same colour depth. From your later post, I presume the cause was that the empty room you were using initially had a blank 256-col background.

ca0mgr

Ahhh, the set command. Uch. Thanks. I've tried but failed. The syntax is soooo... uch. it's counterproductive. I spend more time trying to figure out syntax that should be straightforward with any other language. How is VB still here?

Any examples of file handling would be a great help. I want to load strings and integers and such. I have a preliminary version, but it's hard and slow to test.

Is this the right way?

dim value as string
Open "file.txt" For Input As #1
input #1,value
close #1

Pumaman

Hehe, agreed about the VB syntax. Fortunately they have sorted most of it out with VB .NET (eg. the Set thing is gone, the brackets thing is gone - it's a lot better), but that doesn't help us here much :)

Anyway, binary file read is slightly different:

Dim i as Integer
Dim l as Long

Open "filename.dat" for Binary As #1
Get #1, , i   ' read 2 bytes into i
Get #1, , l   ' read 4 bytes into l
Close #1

Basically, "Get" reads as many bytes as the length of the data type you read in (Integer=16-bit, Long=32-bit). You can also create a custom Type (ie. struct/class) and read that in in one go.

edmundito

Yo,

If anyone is experienced enough with VB.net and wants to convert the code given by Pumaman to that, send me  a message because I'm unable to figure that out.

Love,

netmonkey
The Tween Module now supports AGS 3.6.0!

Pumaman

I just had a play with VB .net and I have managed to create a working AGS plugin with it.

The only snag is, it won't work with the beta 6 AGS Editor (I've had to modify the editor a bit so that it recognises .net plugins). Therefore, in the next beta you should be able to do it.

edmundito

Quote from: Pumaman on Fri 30/04/2004 21:46:17
I just had a play with VB .net and I have managed to create a working AGS plugin with it.

The only snag is, it won't work with the beta 6 AGS Editor (I've had to modify the editor a bit so that it recognises .net plugins). Therefore, in the next beta you should be able to do it.

Yay! *makes out with Pumaman*
The Tween Module now supports AGS 3.6.0!

Robert Eric

#134
Quote
Dim i as Integer
Dim l as Long

Open "filename.dat" for Binary As #1
Get #1, , iÃ,  Ã, ' read 2 bytes into i
Get #1, , lÃ,  Ã, ' read 4 bytes into l
Close #1

Dim i as Integer
Dim l as Long

FileOpen(1, "blargh.txt", OpenMode.Binary, OpenAccess.Read)
FileGet(1, i)
FileGet(1, l)
FileClose(1)

There is also the streamreader/writer way.Ã,  VB.Net has a bunch of new features that you should check out if you don't want to end up doing QuickBasic style programming.

And I'm pretty sure that an integer holds 4 bytes, while a long holds 8.Ã,  A short (word) holds 2 bytes.

Or maybe it's just in VB.Net.

Edit: I'm a pretty good VB.Net programmer, if anyone needs me.
Ã, Ã, 

Pumaman

#135
Robert Eric: yep, it's different in .net. In VB6, Integer = 2 bytes and Long = 4 bytes; in VB .net, Integer = 4 bytes and Long = 8 bytes.

Anyway, RC1 is now up which supports .net plugins. It's messy though, and I really wouldn't recommend using them. If you have a copy of VB6, use that instead.

Anyway, I've added a note to the bottom of the COM Plugins page on how to make a .net plugin work.

strazer

#136
In my game, there is a mouse in the room and when the player clicks on it, EGO tries to catch it, but the mouse gets away all the time. If you click anywhere else, EGO stops chasing the mouse. After 4 tries he stops himself and says, "It's too quick for me.".

With the new RC 1, if I tell my player character stop following the mouse with FollowCharacter(EGO, -1);, the game quits with the error message:

(Room 1 script line 25)
Error: FollowCharacterEx: you cannot tell the player character to follow a character in another room

Additionally, if, during the chase, EGO happens to step on a region requesting a room change, the game now quits with

Error: A room change has been requested, but the player character is currently following another character who is not in the new room. Either stop the player from following before he leaves the room, or move the shepherd character to the new room as well.

as you wrote in your release note. However, I really think that's inappropriate.

I'd rather have EGO either ignore the NewRoom command completely or perform the room change and quit following the mouse automatically.
I don't think it's necessary to quit the game with an error message?

Edit: Oh yeah, and the additions rock, GP_FRAMEIMAGE especially. Thank you!
Any chance I could check for and RawDraw flipped frames?

Pumaman

Quote from: strazer on Mon 03/05/2004 17:55:13
With the new RC 1, if I tell my player character stop following the mouse with FollowCharacter(EGO, -1);, the game quits with the error message:

Er oops, sorry about that. I'll fix it for the next version.

QuoteI really think that's inappropriate.

I'd rather have EGO either ignore the NewRoom command completely or perform the room change and quit following the mouse automatically.
I don't think it's necessary to quit the game with an error message?

Well, if he ignored the NewRoom command we'd get people posting "BUG!!! NEWROOM IS BROKEN!!" so I thought that wasn't a good idea. Stopping the following automatically is another possibility - but I think the error message is the best way, since then you are alerted to the problem, and you have to decide what action you want to take. If it just stopped the following I can imagine there'd be people wondering why their following had suddenly broken.

QuoteAny chance I could check for and RawDraw flipped frames?

Well, that'd need some sort of GP_ISFRAMEFLIPPED as well as a RawDrawImageFlipped, so I'll add them to my list. Or would a RawDrawViewFrame(x,y,view,loop,frame) be better?

strazer

#138
But imagine my mouse could be in any of the rooms, then I would have to check before EVERY NewRoom(EGO, x) command in my game if my character is following the mouse or not (is that even possible?), and only then transport the mouse to the new room in advance.

To me, it makes perfect sense that the following is aborted if the sheperd is not put in the new room in advance.
Well, it's your call.

Edit:

QuoteWell, that'd need some sort of GP_ISFRAMEFLIPPED as well as a RawDrawImageFlipped, so I'll add them to my list. Or would a RawDrawViewFrame(x,y,view,loop,frame) be better?

RawDrawViewFrame is a great idea, that would solve all my problems and is future-proof if you decide to implement vertical flips someday (I'm not asking for it here!).
Personally I wouldn't need the other functions then. Thank you! :)

SSH

#139
strazer: So make a function called NewRoomF that does the check and just find/replace!

Here's the two possible actions, of course, there would probably need to be "Ex" versions of each. It would be a bit simpler if CJ made the following state visible via global var or function
int following; // would need array if we have m,ulitple player chars

function MyFollowChar (int lamb, int chartofollow) {
  following = chartofollow;
  FollowCharacter(lamb, chartofollow);
}

function NewRoomF (int room) {
  if (following>=0) {
    if (stop_on_newroom) {
      following = -1;
      FollowCharacter(GetP{layerCharacter(), -1);
    } else {
      character[following].room = room;
      NewRoom(room);
    }
  } else {
    NewRoom(room);
  }
}


and just so Pumaman knows what I'd like to see in the editor plugin API:

  • Script Editor plugin that lets me semi-automatically-add an import to the script header
  • Script editor plugin that lets me add a #define and commented-out import to get the completer fooled, while editing a different file
  • plugin that automatically generates room #defines based on room name
  • plugin that can add a bunch of run-script interactions very quickly to a hotspot/object/inv item/char
  • plugin that is activated by a right-click and handles Marks in the room editor (using #defines, probably)

probably a bunch more...
12

SMF spam blocked by CleanTalk