Author Topic: MODULE: CharacterControl v0.84b  (Read 24980 times)

MODULE: CharacterControl v0.84b
« on: 04 May 2005, 04:07 »
This is my CharacterControl script module for AGS v2.71/2.72.

To quote the CCS plugin by Scorpiorus:

"Imagine you have a lot of characters in the game and want them to perform different tasks at the same time. Yep, a tons of scripting seems unavoidable. However, another way out is to use CCS which provides easy command control system so you define all needed character commands and then just call the execution function. The most powerful is the MOVE command as it works room-independently!"

I really like the idea, but as a Linux user I can't use plugins and I like to do things natively whenever possible. So I wrote the entire thing from scratch as a script module.

Features:

 * NPCs can walk around in other rooms, talk, animate etc. _in the background_
 * Compatible with CCS plugin command strings
(That may change at any time so you're encouraged to use this module's commands.)

Advantages to the CCS plugin:

 + Cross-platform compatibility
 + Additional and extended, more flexible control commands
 + No need for a dedicated blank view
 + Extensible & customizable

Note that this is still a BETA version.
I have only a simple test game to test this with so I need other users to report any bugs they may encounter.

Download here (Requires AGS v2.71 or higher!)
This download includes the script module(s), documentation and a small demo game.

Edit:

Check this post by monkey_05_06 for an AGS 3+ compatible version
« Last Edit: 30 Jan 2009, 20:16 by strazer »

Pumaman

  • Creator of AGS
  • Administrator
  • Mittens King
  • I sense danger.
    • Lifetime Achievement Award Winner
    • Pumaman worked on one or more games that won an AGS Award!
    •  
    • Pumaman worked on one or more games that was nominated for an AGS Award!
Re: strazer's CharacterControl script module
« Reply #1 on: 04 May 2005, 18:27 »
Clever stuff strazer, good work :)

Scorpiorus

  • 100101101010b
    • Scorpiorus worked on one or more games that won an AGS Award!
    •  
    • Scorpiorus worked on one or more games that was nominated for an AGS Award!
Re: strazer's CharacterControl script module
« Reply #2 on: 28 May 2005, 00:04 »
Nice work strazer!

It's cool to see this as a script module since the CCS plugin doesn't really use any of AGS plugin API specific functions. And it infact was made as an AGS script that was eventually converted into C. But that's because I just didn't want people to mess with "installing" it by copy and pasting portions of script code around the main global script. It's cool we have the module feature, indeed.

:)

Re: MODULE: CharacterControl
« Reply #3 on: 14 Jul 2005, 13:54 »
Version 0.81 now up:

  - Characters now play talking animation when talking*
  - Added check if character is .on before executing command
  - Renamed internal control command enums

See link above.

Edit:

*No lip-sync or voice speech though
« Last Edit: 14 Jul 2005, 14:11 by strazer »

Blitzerland

  • Hapless Spaz
    • I can help with AGS tutoring
    • I can help with animation
    • I can help with backgrounds
    • I can help with characters
    • I can help with play testing
    • I can help with proof reading
    • I can help with scripting
    • I can help with voice acting
    • I can help with web design
Re: MODULE: CharacterControl
« Reply #4 on: 15 Jul 2005, 11:50 »
Oh, just think what's possible with this. You could even make a game recreating the chaos of Wall Street.

*Shudder of geeky joy*

Or not. But you get the idea.

Awesomeness, Strazer. Pure awesomeness.

Re: MODULE: CharacterControl (BROKEN!)
« Reply #5 on: 30 Aug 2005, 05:43 »
Version 0.82 now up:

 - Fixed problems with rooms > 21
 - Fixed characters stuck speaking if not in current room

See download link above.

I'm still not quite satisfied with the internal workings of the module, but this will do for now. It's a Beta after all. ;)
« Last Edit: 13 Apr 2006, 02:37 by strazer »

Candle

  • Truly Hated
Re: MODULE: CharacterControl
« Reply #6 on: 27 Oct 2005, 05:27 »
Thanks strazer, nice work and you sure do a lot .
Thanks again.

Re: MODULE: CharacterControl v0.83
« Reply #7 on: 20 Dec 2005, 22:58 »
Version 0.83 now up:

 - Code rewrite and thus now requiring AGS v2.71!
 - Added SAY control command for entering speech directly into command string
 - RunScript add-on module now uses String parameters instead of Ints, so you
   may have to update your custom code and paste it into v0.83 of the RunScript
   module. Sorry for the inconvenience.
 - Fixed characters occasionally getting stuck when changing rooms

See download link in first post.

(For AGS v2.70, here is v0.82a that includes the bugfix above. This is the last version for AGS v2.70. All future versions including v0.83 will require at least AGS v2.71!)

Kinoko

  • Cartoonist/Illustrator/Great Lover
    • Kinoko worked on one or more games that was nominated for an AGS Award!
Re: AGS 2.71 *UPDATE* now released!
« Reply #8 on: 13 Jan 2006, 14:15 »
I'm converting a lot of my script over, but now I get a Type Mismatch for the line in bold:

function charCharColDetectEx(int CharID1, int slot1, int CharID2, int slot2) {
int room1;
int room2;
if (CharID1 != GetPlayerCharacter()) room1 = CharacterControl.GetRoom(CharID1);
else room1 = character[CharID1].room;
if (CharID2 != GetPlayerCharacter()) room2 = CharacterControl.GetRoom(CharID2);
else room2 = character[CharID2].room;
if (room1 == room2) {

...etc

Cannot convert int to character. I'm honestly not sure what to change here. Can anyone help?
« Last Edit: 13 Jan 2006, 15:38 by strazer »

Re: MODULE: CharacterControl v0.83
« Reply #9 on: 13 Jan 2006, 15:36 »
Kinoko, in contrast to the plugin, this module uses new-style scripting exclusively and takes pointers as parameters, not numbers/IDs.
This allows you to use the new character pointers for functions, e.g.:
  int roomid = CharacterControl.GetRoom(cGeorge);

So change
  CharacterControl.GetRoom(CharID1)
to
  CharacterControl.GetRoom(character[CharID1])

(and the same for CharID2)

Kinoko

  • Cartoonist/Illustrator/Great Lover
    • Kinoko worked on one or more games that was nominated for an AGS Award!
Re: MODULE: CharacterControl v0.83
« Reply #10 on: 25 Jan 2006, 10:43 »
Thanks. Another probem I have is that I have a longish cutscene that needs to start with various triggers and timers, so the code ends up in pieces in repeatedly_execute.

Now, what would really solve my problem would be the ability to call blocking functions from repeatedly_execute. The fact that AGS won't allow it is what's physically stopping me. I can prevent any problems myself, by triggering the code with a variable value and then immediately changing that value but letting the rest of the script run line by line, but AGS doesn't allow for this.
« Last Edit: 13 Apr 2006, 02:33 by strazer »

SSH

  • Flying round the world at the speed of haggis
    • I can help with scripting
    • SSH worked on one or more games that won an AGS Award!
    •  
    • SSH worked on one or more games that was nominated for an AGS Award!
Re: MODULE: CharacterControl v0.83
« Reply #11 on: 25 Jan 2006, 11:03 »
I thought you can call blocking functions in rep_ex, but not rep_ex_always...



mchammer

  • Can't touch it
Re: MODULE: CharacterControl v0.83
« Reply #12 on: 12 Apr 2006, 14:23 »
great module, its very useful to me. But last time I run the game, it crashed and I got this message:

ACI ver. 2,71,894
in CharacterControl(line 158)
from CharacterControl(line 372)

Error:Move Character: Character not in current room.

I dont know much about these things so im not sure is it either a bug or my own scripting error.
My 40 bullets - An action/war game.

Re: MODULE: CharacterControl v0.83
« Reply #13 on: 12 Apr 2006, 19:02 »
Nice work Strazer, will certainly play around with this at some point :)

Re: MODULE: CharacterControl v0.84
« Reply #14 on: 12 Apr 2006, 23:56 »
Version 0.84 now up:

 - Fixed characters not fully initializing when not starting with ROOM command
 - Fixed SAY command not working with characters that have no speech view set

mchammer: This should fix your problem. I (wrongly) assumed each chain starting off with a ROOM change command, so the character wasn't fully initialized yet.
« Last Edit: 26 Apr 2006, 23:20 by strazer »

llien

  • Guest
Problems with CCS and CharacterControl
« Reply #15 on: 24 Oct 2006, 14:37 »
Hi

I'm having trouble getting CCS103 or charactercontrol 0.84 to work. As far as I know, I've read through all the docs, searched through the forums etc, but still not closer to an answer. I'm trying to get 4 npc's to walk on set paths around 1 room in the background. First I tried charactercontrol, but as soon as I import them through modules, the game doeesn't compile any longer, I just get a tonne of "undefined symbol..." errors. Is there somewhere I need to add the scripts to a header? Tried (as a test) to comment out all instances of undefined symbols, but that, of course, broke the script  :)

Also tried CCS, all seems fine, but when, in game_start, I call ccCreateCommand(1, "WALK:1,1;"), I get an error stating it can't convert a const string to a string. Though all documentation states that this is the way to do it...

Both demo games don't run as well.

Am I missing something painly obvious???

using ags 2.72

thanks.

Version 0.84b now up. I have hopefully updated the module to work with both AGS v2.71 and v2.72.
« Last Edit: 06 Nov 2006, 23:42 by strazer »

Re: MODULE: CharacterControl v0.84b
« Reply #17 on: 19 Jul 2007, 02:12 »
Sorry for digging up this old post, I just wanted to point out that the AGS Resource page still links to version 0.84, the version that doesn't work in AGS 2.72.

Re: MODULE: CharacterControl v0.84b
« Reply #18 on: 19 Jul 2007, 12:47 »
I'm guessing he means this page.

Re: MODULE: CharacterControl v0.84b
« Reply #19 on: 19 Jul 2007, 16:50 »
Thanks, I've sent jasonkay a pm, he maintains that site.