MODULE: CharacterControl v0.84b

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

Previous topic - Next topic

Rocco

thx for updating this great module.  :)

i have one question:
what is the easiest way, to change walkspeed between chain-commands?
i want to assign a random walkspeed after some walk commands in the chain.

mchammer

Quote from: Rocco on Sun 16/09/2007 17:48:34
thanks for updating this great module.  :)

i have one question:
what is the easiest way, to change walkspeed between chain-commands?
i want to assign a random walkspeed after some walk commands in the chain.


I think easiest way is to use RunScript module (comes with Character Control module).
Add RunScript module BEFORE CharacterControl module in your game.

Script you use inside RunScript module:
Code: ags

   if (parameter1.AsInt == ExampleValue) {
    int WalkingSpeed = Random(MaxWalkspeed - MinWalkspeed) + MinWalkspeed;
    thechar.SetWalkSpeed(WalkingSpeed,WalkingSpeed);
  return 0; 


Then you add to chain a command 'RUN:ExampleValue;' when you want change the walking speed.

Replace ExampleValue with a number 1 or above.
My 40 bullets - An action/war game.

Rocco

thanks mchammer, works perfect  :)
i will use this module in 2 of my upcoming games.

strazer


Rocco

#24
i tried something like this

Code: ags
   	CharacterControl.CreateChain(1, "ROOM:3, random(80)+250,270; RUN:1; WALK:Random(250)... 


and get the error message that only numbers are allowed,

i need the whole values randomly all the time.
i know the example in the demo which sets the chain values randomly,
but the problem is, when the chain is finished one time and returns to the beginning, (GOTO 1 )
it should generate new random values again, and dont use the values generated one loop earlier.

the only solution i can imagine, is to make a new chain for every loop, but then i need a very huge ammount of chains.
is there another possible solution?

Rocco

sorry for doppelposting, i have another question.  :)

i noticed that the chars arent in the given position when i change room,
and come back to the room, where the CC module is running.

Can this happen, when the roomsize is different?
The main room with the Controled Chars is 4time bigger as the other room.

Rocco

Ok here i go again.  :)

The situation is as follow:
I have one character walking in one room with the CC-module, this character activates some events every few seconds when he steps on a specified region.
This is important for the game, regardless if the player is in the same room or not.
Ok so when im leaving the room with the CC controlled chars, the events doesnt occurs anymore.

My thought was, when all the CC-controlled chars are taken to the rooms where the player is,
and act invisible, i draw the same regions in another room and the events can go on.
But this approach doesnt work either.

strazer please help!!!  :),
MAGS deadline is coming very close now.

strazer

Rocco, I'd like to help but I'm totally out of the loop at the moment, haven't worked with AGS in months and am quite busy at work.
I'm sorry, I hope someone else will be able to help you out.

Khris

Quote from: Rocco on Thu 24/07/2008 18:22:38
i tried something like this

Code: ags
   	CharacterControl.CreateChain(1, "ROOM:3, random(80)+250,270; RUN:1; WALK:Random(250)... 


and get the error message that only numbers are allowed,

Code: ags
   	CharacterControl.CreateChain(1, String.Format("ROOM:3, %d, 270; RUN:1; WALK:%d...",random(80)+250, Random(250))); 

Revonx

Hi,

Having a problem with the module that I can't figure out. When I run the game it works fine except for sometimes at random removing either a character from the game entirely or incorrecly placing a character into a non designated room scrolling up and down the right side of the room itself, quite bizzare.
Hopefully its a simple explanation that I failed to acknowledge.

Heres the code:

function game_start() // called when the game starts, before the first room is loaded
  {
    CharacterControl.CreateChain(1, "ROOM:7,30,170; WALK:319,176;");
CharacterControl.AppendChain(1, "ROOM:3,0,175; WALK:319,174;");
CharacterControl.AppendChain(1, "ROOM:16,0,182; WALK:140,172; WAIT:100; WALK: 300,170; WAIT: 100; WALK:140,172; WAIT:100; WALK:0,179;");
CharacterControl.AppendChain(1, "ROOM:3,319,174; WALK:0,175;");
CharacterControl.AppendChain(1, "ROOM:7,319,176; WALK:30,170; GOTO:1;");
CharacterControl.StartExecuting(cGoliath, 1);
CharacterControl.CreateChain(2, "ROOM:11,165,152; WAIT: 100; LOOK: 160,160; WAIT: 100; ANIMATE:4,0,0; WAIT: 100; WALK: 274,153; WAIT: 200; WALK: 266,111; WAIT: 200; WAIT: 100;");
CharacterControl.AppendChain(2, "WALK:274,153; WAIT: 100; WALK:165,152; GOTO:1;");
CharacterControl.StartExecuting(cCop, 2);
}

Hoping someone knows whats going on.  ;D

Revonx.

beomoud

I can't get it to work.... i get this message:

CharacterControl_084b.asc(52): Error (line 52): Array size must be constant value

strazer

I don't think it works with AGS 3 at the moment. Aside from not having the time at the moment, I can't run the new editor so I'm unable to debug this.

Unless someone else is willing to step in, I'm afraid this module is orphaned for now...sorry.

monkey0506

#32
Hey strazer, no worries.

Download (Mirror)

This is pretty much just a 1-to-1 conversion.

Changelog:

  • Converted CharacterControl_Character struct into local variables (ccCharacter_ChainID, ccCharacter_ChainPosition, etc.)
  • Replaced AGS_MAX_CHARACTERS with dynamic arrays of size Game.CharacterCount.
  • Replaced all short variables with ints, because they're faster.
  • Replaced AGS_MAX_VIEWS parameter checks with Game.ViewCount.
  • Added "CharacterControl module error: " to the beginning of error messages to clarify the meaning to the user.
  • Changed version info to 0.85.
  • Added dependency for AGS 3.0+; AGS 2.72- users can continue to use prior versions of the module.
  • Removed all AGS 2.72 IFVER checks as they're redundant with 3.0 dependency.


NOTE: The above download link only includes the SCM for the module. It does not include any documentation, the CharacterControl_RunScript module, demo game, etc., etc. You must download the 0.84 package for these files.

I did test the 0.84 demo game with 0.85 of the module and it appeared to function fine. I didn't do any extensive testing, but based on the minimal changes I made, none of the actual module functionality should have been affected anyway. All prior module commands (for the end-user) should work exactly the same.

strazer



monkey0506

You're both welcome. It was a simple fix really. :)

As a matter of fact...it wouldn't be that difficult to throw in some #ifdef-s to make the entire thing backwards compatible to 2.71...maybe on my next day off from work. ;)

Dualnames

Sorry for the bump, but downloaded and greatest of implementations so far Monkey..
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Matti

Whoa, this Module could come in handy. Thanks in advance, strazer and monkey..

Dualnames

Quote from: Mr Matti on Tue 28/04/2009 23:49:57
Whoa, this Module could come in handy. Thanks in advance, strazer and monkey..

And dual, for bumping it up for no reason.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Dualnames

Can I ask if there's a license of any sort coming with this module? For from all I can see there's not.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SMF spam blocked by CleanTalk