Multiple Chars selection screen

Started by Dr Fred Rubacant Edison, Wed 08/11/2006 18:27:36

Previous topic - Next topic
How do i make it so i can pick chars like Maniac mansion.

Like dave is the main player and i need to pick 2 or 3 more kids.

How can i script this into the Maniac mansion maniaÃ,  Starter
Some say i need panels! and Some say i dont Need them.   WHERES THE DRUGS I'm going CRAZY. Plus I must have been on Drugs and a Maniac if i was going to name the game Maniacs Mansion.

What was i thinking!!!!!

Ashen

Just to clarify: Are you talking about changing between Characters in the game (which is in the BFAQ), or the initial selecting which kids will be the playable characters?
For the second one, I think you'd have two character pointers for the two other PCs, and have a 'Pick the character' GUI Or room that links them to the 'real' character name:
Code: ags

Character *cPCOne;
Character *cPCTwo;


Code: ags

// Sample Character selection code, may not work as-is
if (cPCOne == cBernard) cPCOne = null;
else if (cPCTwo == cBernard) cPCTwo = null;
 // These lines de-select the character, if it's already selected
else {
  if (cPCOne == null) cPCOne = cBernard;
  else if (cPCTwo == null) cPCTwo = cBernard;
   // These will assign Bernard to the empty slot
  else Display("Deselect a character first");
   // This line runs if you try to select the character when 2 are already selected
}


Then you can use the cPCOne/Two pointers to set the Player character.

I don't know exactly how you'd add this to the MMM starter, but it should just be a case of adding the GUI/Room before the game proper starts.

And please, use more descriptive thread titles. Edit your first post to make it clear what you're trying to script like Maniac Mansion.
I know what you're thinking ... Don't think that.

Khris

#2
You've already bragged about how your game is going to be superior to and more complex than MMD, and now you want to know how to implement multiple chars?

There is a starter pack available with implemented character change functionality (written by me).
You can download it here.
It takes care of the door problem, too. In the room properties, enter the index number of the last door object, and in the door object properties, enter the number of the door's global int.
(This is necessary to prevent open doors from being displayed as closed and the other way round after having switched the playable char.)

The documentation is in german, if you experience any problems, I might provide a short translation.

This starter pack lacks a selection screen to pick players, you'll have to implement one yourself.
This can easily be done using hotspots and any click interactions.
Shouldn't be a problem for the author of the new and improved MMD-XXL. ;)

#3
My scripting skills stink  :'(  Im trying to get better


I have lots of ideas for this version of maniac mansion

I want you to start with dave and you can pick 3 other kids

I tryed the new stater that i downloaded and there a problem the game wont run it said.


There was an error compiling your script  the problem was in global script 

error  (line 273) type mismatch cannot convert string to int




function RemoveExtension (string location){
  //removes the extension of a string
  int length = StrLen (location);     
  if (Extension (location) != 0) StrSetCharAt (location, length - 2, 0);
  return location; // <------



whats wrong with it.


What i all so need are some Codeing/Scripting Tutorials on this stuff.

Like

Picking what kids you want like in Maniac Mansion,
How to make Cutseens,
How to make ramdom cutseens,
How to make basic puzzles,
Adding new GUI Commands tell you more on this soon,
Make items with the  mouse click on and off  (use) Like the flash light,
Makeing locked doors use the Keypad to unlock,

Sorry my scripting stinks



Can you all so Give me the short translation to English i dont know german
 
Some say i need panels! and Some say i dont Need them.   WHERES THE DRUGS I'm going CRAZY. Plus I must have been on Drugs and a Maniac if i was going to name the game Maniacs Mansion.

What was i thinking!!!!!

Ashen

#4
Try:
Code: ags

string RemoveExtension (string location){
  //removes the extension of a string
  int length = StrLen (location);     
  if (Extension (location) != 0)  StrSetCharAt (location, length - 2, 0);
  return location; // <------
} 


functions can only return ints (numbers). This one is trying to return a string, so it needs to be declared as a string. Also, it uses the old string type, not String - if you've downloaded this from somewhere it might be too much work to update it all, but you should be aware of it for your own coding. Since it works other than the error, you've probably got the 'Enforce new style Strings' opton un-checked - leave it that way for now and you should be OK.

Quote
Picking what kids you want like in Maniac Mansion,

At it's most basic you'll need something to pick them from, like a group of portraits. This can be done with Buttons on a GUI, with Objects in a room, or with a Room Background using Hotspots.

Open the Global Script (Ctrl-G). At the top put:
Code: ags

Character *cPCOne;
Character *cPCTwo;
Character *cPCThree;
export cPCOne, cPCTwo, cPCThree;


In the Script Header (Ctrl-H):
Code: ags

import Character *cPCOne;
import Character *cPCTwo;
import Character *cPCThree;


Now go to wherever (GUI/Room) you're selecting the kids. For each (Button/Object/Hotspot) add a Run Script interaction and set it to:
Code: ags

// Sample Character selection code, may not work as-is
if (cPCOne == cBernard) cPCOne = null;
else if (cPCTwo == cBernard) cPCTwo = null;
else if (cPCThree == cBernard) cPCTwo = null;
// These lines de-select the character, if it's already selected
else {
  if (cPCOne == null) cPCOne = cBernard;
  else if (cPCTwo == null) cPCTwo = cBernard;
  else if (cPCThree == null) cPCTwo = cBernard;
   // These will assign Bernard to the empty slot
  else Display("Deselect a character first");
   // This line runs if you try to select the character when 3 are already selected
}


Chnage cBernard to the script-o-name of the kid you want to select.
Add a 'Play' option that takes the player into the Game. (Make it dependant on all three characters having been selected.)

For the rest:
Quote
How to make ramdom cutseens,
How to make basic puzzles,
Adding new GUI Commands tell you more on this soon,
Make items with the  mouse click on and off  (use) Like the flash light,
Makeing locked doors use the Keypad to unlock,

You're going to have to be more specific - what do you want to happen in the cutscenes; what do you mean by 'random cutscenes'; what sort of puzzles ...
Read the manual, read the BFAQ, search the forums. Then ask back when/if you've got more specifc questions.


Also, don't double post, the 'Modify' button is there for a reason.
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk