QuoteYou're wrong, geork. The character is called cChair, not cChar.
AHH, I thought that was a typo

On the other hand, the irony is brilliant, so it all works out

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuoteYou're wrong, geork. The character is called cChair, not cChar.
if(cChar.Moving){
//this is what it does
}
QuoteNOTE: This function does not support Whole-Screen speech.
void Comment(this Character*, String Text){ //by having (this Character*) as a parameter, you are making it an extender function for characters
//this means you can call the function by typing: player.Comment("blah")
this.StopMoving(); //so the character won't keep moving. [this] is a keyword which refers to the specific character calling this function
Overlay* bgs = Overlay.CreatTextual(0, 2, 384, Game.SpeechFont, this.SpeechColor, Text); //Here you create a textual overlay.
//it's worth looking up in the manual to see what
//all the parameters are.
this.LockView(this.SpeechView); //locks the character view into it's speaking view
this.Animate(this.Loop, this.AnimationSpeed, eRepeat, eNoBlock, eForwards); //animates the character using it's speaking view
//make sure it is repeating and not blocking!
WaitMouseKey((m.Length/Game.TextReadingSpeed + 1) * GetGameSpeed()); //WaitMouseKey means wait until the user clicks or presses a key or time runs out.
//The stuff inside the parameter is the official AGS maths for how long spoken
//text usually appears on screen...I think...
if (bgs != null && bgs.Valid) bgs.Remove(); //remove the overlay if it still exists
this.UnlockView(); //unlock the character's view, making it go back to normal.
}//ends the function
import void Comment(this Character*, String Text);
player.Comment("These heavy oak doors are (etc)");
DynamicSprite.CreateFromScreenShot();
sMenu = DynamicSprite.CreateFromScreenShot();
sMenu.Tint(0, 64, 128, 50, 75);
int i;
while(i<64){
Background[i] = DynamicSprite.CreateFromBackground(0, (i*8), (i*3), (i*8), (i*6));
Background[i].Resize(1024, 768);
i ++;
}
int i;
float c = 1.0/64.0;
float d;
while(i<64){
if(i!= 0) d = c + (IntToFloat(i)*c);
else d = c;
d += 1.0;
Background[i] = DynamicSprite.CreateFromBackground(0, (1024-FloatToInt(1024.0/d)), (384-FloatToInt(384.0/d)), FloatToInt(1024.0/d), FloatToInt(768.0/d));
Background[i].Resize(1024, 768);
i ++;
}
//somewhere above:
DynamicSprite Background[64];
//these then get assigned to the backgrounds at progressive level of "zoom" (63 = max zoom)
int i = 63;
float xFactor = IntToFloat(cChar.x-EndCharXPlace)/64.0; //where EndCharXPlace is where the character's final x coordinate should be
float yFactor = IntToFloat(cChar.y-EndCharYPlace)/64.0; //and so on...
float sFactor = IntToFloat(cChar.Scaling-EndCharScaling)/64.0;
float j;
while(i >= 0){
object[0].Graphic = Background[i].Graphic; //there are reasons why it's an object...I think...
j = IntToFloat(i);
cChar.Scaling = EndCharScaling+FloatToInt(j*sFactor, eRoundNearest);
cChar.x = EndCharXPlace+FloatToInt(j*xFactor, eRoundNearest);
cChar.y = EndCharYPlace+FloatToInt(j*yFactor, eRoundNearest);
Wait(3);
i --;
}
void DoSomeStuff(){
Display("Doing things");
//NO RETURN STATEMENT!
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.133 seconds with 14 queries.