MODULE: CharacterControl v0.84b

Started by strazer, Wed 04/05/2005 04:07:17

Previous topic - Next topic

strazer

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

Pumaman


Scorpiorus

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.

:)

strazer

#3
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

Blitzerland

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.

strazer

#5
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. ;)

Candle

Thanks strazer, nice work and you sure do a lot .
Thanks again.

strazer

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

#8
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?

strazer

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

#10
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.

SSH

I thought you can call blocking functions in rep_ex, but not rep_ex_always...


12

mchammer

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.

JD

Nice work Strazer, will certainly play around with this at some point :)

strazer

#14
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.

llien

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.

strazer

Version 0.84b now up. I have hopefully updated the module to work with both AGS v2.71 and v2.72.

Oddysseus

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.

GarageGothic


strazer

Thanks, I've sent jasonkay a pm, he maintains that site.

SMF spam blocked by CleanTalk