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 Menu
//END OF PREVIOUS ROOM
Wait(60);
aPioggia.Stop();
SetScreenTransition(eTransitionInstant);
FadeOut(1);
cEgo.ChangeRoom(3);
OCCHISEGUONOPERSONAGGIO=true;
PALPEBRESEGUONOPERSONAGGIO=true;
SPEECHSEGUETESTA=true;
cAnimazioniOcchi.UnlockView();
cEgoPalpebre.Transparency=0;
OCCHITRASPARENZAAUTOMATICA=true;
cAnimazioniOcchi.UnlockView();
cEgoBraccia.UnlockView();
cEgoBraccia.Transparency=100;
cEgo.UnlockView();
}
//NExtROOM
function room_Load()
{
closeUp[0]=cGen1;
closeUp[1]=cGen2;
closeUp[2]=cGen3;
closeUp[3]=cGen4;
closeUp[4]=cGen5;
closeUp[5]=cGen6;
closeUp[6]=cGen7;
for(int i; i<7; i++)
{
//closeUp[i].Transparency=100;
closeUp[i].ChangeRoom(3);
closeUp[i].x=320;
closeUp[i].y=360;
closeUp[i].ManualScaling=true;
closeUp[i].Scaling=100;
closeUp[i].Clickable=false;
closeUp[i].FaceDirection(eDirectionDown, eBlock);
closeUp[i].IgnoreLighting=true;
closeUp[i].SetGetlightlevel(0);
}
cGen1.ChangeView(77);
cGen1.Baseline=1001;
cGen2.ChangeView(78);
cGen2.Baseline=1002;
cGen3.ChangeView(1);
cGen3.Baseline=1003;
cGen4.ChangeView(2);
cGen4.Baseline=1004;
cGen5.ChangeView(5);
cGen5.Baseline=1000;
cGen6.ChangeView(3);
cGen6.Baseline=1006;
cGen6.x=cGen1.x-150;
cGen6.Scaling=90;
cGen6.Transparency=100;
cGen7.ChangeView(6);
cGen7.Baseline=1005;
cGen7.SpeechView=6;
cGen3.Loop=1;
cGen3.Frame=1;
//cGen3.Animate(0, 3, eRepeat, eNoBlock, eForwards);
if (player.PreviousRoom==1)
MUSICA=aStanzaLovecraftColpi.PlayFrom(MUSICA.Position, eAudioPriorityHigh, eRepeat);
INVENTARIOPOPOUP=false;
cAbdul.ScaleMoveSpeed=true;
cAbdul.SetWalkSpeed(1, 1);
cEgo.y=300;
cEgo.ChangeView(10);
cEgo.SpeechView=17;
cAbdul.x=-20;
cAbdul.y=270;
cAbdul.ManualScaling=true;
cAbdul.Scaling=80;
cAbdul.Baseline=1;
cEgo.FaceDirection(eDirectionDown, eBlock);
cEgo.SetIdleView(0, 0);
FadeIn(1);
}
function Angolo(float xgiocatore, float xpersonaggio, float ygiocatore, float ypersonaggio)
{
float x;
float y;
float angle;
float degangle;
int angolo;
x= xgiocatore-xpersonaggio;
y= ygiocatore-ypersonaggio;
angle = Maths.ArcTan2(x,y);
degangle=Maths.RadiansToDegrees(angle);
angolo = FloatToInt(degangle);
if (angolo<0) angolo=360+angolo;
return angolo;
}
String direzione(int angolo)
{
if ((angolo>=337&&angolo<=360)||(angolo>=0&&angolo<22))
return "D";
else if (angolo>=22&&angolo<67)
return "RD";
else if (angolo>=67&&angolo<112)
return "R";
else if (angolo>=112&&angolo<157)
return "RU";
else if (angolo>=157&&angolo<202)
return "U";
else if (angolo>=202&&angolo<247)
return "LU";
else if (angolo>=247&&angolo<292)
return "L";
else if (angolo>=292&&angolo<337)
return "LD";
}
bool SightBlocked(float fx, float fy) {
int x = FloatToInt(fx, eRoundNearest);
int y = FloatToInt(fy, eRoundNearest);
// check if room pixel x, y is blocking
return GetLocationType(x - GetViewportX(), y - GetViewportY()) == eLocationObject;
}
bool IsVisibleTo(this Character*, Character* enemy) {
float x = IntToFloat(enemy.x), y = IntToFloat(enemy.y);
float dx = IntToFloat(this.x - enemy.x);
float dy = IntToFloat(this.y - enemy.y);
float l;
l = Maths.Sqrt(IntToFloat(((this.y - enemy.y)*(this.y - enemy.y))+((this.x - enemy.x)*(this.x - enemy.x))));
//check every 2 pixels
if (l == 0.0) return true;
dx /= l / 2.0;
dy /= l / 2.0;
int steps = FloatToInt(l / 2.0, eRoundDown);
for (int i = 0; i < steps; i++) {
x += dx; y += dy;
if (SightBlocked(x, y)) return false;
}
return true;
}
void VerificaAngolo(Character *giocatore, Character *nemico){
angolus=Angolo(IntToFloat(giocatore.x), IntToFloat(nemico.x), IntToFloat(giocatore.y), IntToFloat(nemico.y));
dir=direzione(angolus);
if (distanza(giocatore.x, giocatore.y, nemico.x, nemico.y)<167)
{
if (giocatore.IsVisibleTo(nemico))
{
if (nemico.Loop==0)
{
if (dir=="D")
{
giocatore.SayBackground("Mi ha visto.");
}
else giocatore.SayBackground("");
}
else if (nemico.Loop==1)
{
if (dir=="L")
{
giocatore.SayBackground("Mi ha visto.");
}
else giocatore.SayBackground("");
}
else if (nemico.Loop==2)
{
if (dir=="R")
{
giocatore.SayBackground("Mi ha visto.");
}
else giocatore.SayBackground("");
}
else if (nemico.Loop==3)
{
if (dir=="U")
{
giocatore.SayBackground("Mi ha visto.");
}
else giocatore.SayBackground("");
}
}
}
}
function repeatedly_execute_always()
{
VerificaAngolo(cEgo, cGen3);
VerificaAngolo(cEgo, cGen4);
VerificaAngolo(cEgo, cGen5);
VerificaAngolo(cGen1, cGen3);
VerificaAngolo(cGen1, cGen4);
VerificaAngolo(cGen1, cGen5);
VerificaAngolo(cGen2, cGen3);
VerificaAngolo(cGen2, cGen4);
VerificaAngolo(cGen2, cGen5);
}
Quote from: Crimson Wizard on Tue 17/04/2018 15:07:48
Perhaps, you need to disable that label when any blocking action takes place?
One trick I know is based on the fact that repeatedly_execute_always runs during blocking actions, and repeatedly_execute does not run during blocking actions. Also rep_exec_always runs before rep_exec. This means that you may disable your label in in repeatedly_execute_always (set empty string to the label.Text or set Visible = false) and restore it in repeatedly_execute.
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.083 seconds with 14 queries.