Menu

Show posts

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

Messages - Papyrus

#1
Quote from: Joe on Thu 26/06/2014 19:38:04
Sorry, today it's not my best day.

Of course your code solves the problem and, since you are the game creator, you will decide if that solution is good enough or not. I used the variable because I'm not the game creator and I don't know if your NPC will animate again at some point in the game alterating his loop so it won't be 8 anymore and the "if" condition will become useless.
That the only reason I'm using a boolean variable. But if the NPC is not animating anymore then that change might be a good (but not elegant) solution.

Thanks you very much for your explanation and your effort.
I have not explained well at all, english isn't my native lenguage. Sure i will use all this information in future, very usufull.
My best wishes for u.
Greeting :)
#2
Sorry is the only text i didn't read, but i didn't tell u " u don't understand me or u don't read me".
i only try to understand why i have to insert variables on code if only with one line i can do that.
There are no malice in my words.
#3
i think Joe it was a misunderstanding:
i meant Loop into a View... Not loop for repeat a script
wasn't it?

but thnks for the explanation, i will try to use all of this!
;-D
#4
so, simple!:X

Code: ags

function region1_WalksOnto()
{
  if (player.HasInventory(isello))
  {
    player.ChangeRoom(7, 150, 550);
  }
  else if (cPortero.Loop==8)//this is that i wanted
  {
    player.ChangeRoom(7, 150, 550);
  }
  else
  {
    cPortero.LockView(3);
    cPortero.Animate(2, 3, eOnce, eNoBlock); 
    cPortero.Say("EH! TU!...SI NO PAGAS NO ENTRAS");
    player.Walk(468, 495, eBlock);
    player.FaceCharacter(cPortero);
  }
}


Well, thnks to Joe...you've driven me crazy but i started to learn about variables (laugh]
#5
when i talked about "loop" i mean loop's view.

thnks
#6
thnks for answer!
sorry, but don't know to script, even a little, im triying to learn.
i have been watching ur scipt for a minuts and i don't understand clearly
i want ask u some else:
firstly, where can i spicify wich loop be considered? (ex. loop 1)
where can i define the variables.?
i search "bool" in the manual but i didn`t find this.
Where can i search about all of that?

regards!;)
#7
hi!
First, i begin to believe, AGS is the most addictived "game" i've ever played...(laugh)

ok, i need player change room throug region only at two situations:
1.-when player have a object (no problem with that)
2.-when a specific NPC's loop have been run.

i use a conditional into function region_walkOnto
Code: ags

function region1_WalksOnto()
{
  if (player.HasInventory(isello))
  {
    player.ChangeRoom(7, 150, 550);
  }
  else if (character[cPortero].loop==8)// This is what i don't know
  {
    player.ChangeRoom(7, 150, 550);
  }
  else
  {
    cPortero.LockView(3);
    cPortero.Animate(2, 3, eOnce, eNoBlock); 
    cPortero.Say("EH! TU!...SI NO PAGAS NO ENTRAS");
    player.Walk(468, 495, eBlock);
    player.FaceCharacter(cPortero);
  }
}
[\code]

thanks for answering!(roll)
#8
Quote from: Vincent on Sun 22/06/2014 20:30:49
Quote
how can i assign object a view??
while i'll try to move it...!

Well, I guess this also could help you..

While :
while ( expression ) {
statements
}
Runs statements continuously, while expression is true.

For example:
Code: ags

while (cEgo.Moving) {
  Wait(1);
}


will run the script Wait(1); repeatedly, as long as cEgo.Moving is not zero. Once it is zero, the while statement will exit at the end of the loop.
thanks very much Vicent! i will try, it could be very usefull (nod)
#9
ARRG! sorry,sorry...Set.View(4,0,0)
Somedays i can read...
:-D
#10
ok i have another doubt: how can i assign object a view??
while i'll try to move it...!
#11
oh, correct! thnks!
now the object come to view!
to continue i will try to animate and move it.
thnks Vicent and Kris!
#12
yes, sorry, i was not explain correctly. I meant i try with:
Object[0].Visible=true
#13
Hi all!
Im trying that player throw a little marble to a NPC and latter slips and falls.
i have a NPC and player animations working fine; player throw the marble and NPC falls, but i need the marble moving from Player's hand to NPC's feet.
I made a object in the room and selected "false" in "Visible" propierties.
Firsty,i tried that object come in view when player View loop(player throw marble) end.
Code: ags

  else if ((player.HasInventory(icanica)) && (player.ActiveInventory==icanica))
    {
      player.Walk(629, 509, eBlock);
     player.FaceCharacter(cPortero);
     cEgo.LockView(1);
     cEgo.Animate(8,5);
     cEgo.Say("DAME SUERTE CANICA!");
     cEgo.UnlockView();
     oCanica.Visible = true;
     cPortero.LockView(3);
     cPortero.Animate(8, 3, eOnce);
    }

it give me this error:
GlobalScript.asc(599): Error (line 599): Undefined token 'oCanica'

then i tried with "Object[ID].Visible=true"
so i recieve this error:
GlobalScript.asc(599): Error (line 599): fixed size array cannot be used in this way


how can i do, mainly to object comes in view, secondly to start object animations and ending to move it.
Thanks for your time and help.
#14
ok, i noticed that line 1 of global Script was the same that the line 561(approx) and i deleted all since 561 to the last i remember i had scripted (character interact). And now works fine ^^

Surely all this info is completly unusefull, but i`m so happy :)
#15
i have found it!...im so so stupid :-[. I don't know how but i copy all the GlobalScript twice, well this is my theory.
I will try to solve it, and i'll post.

thanks to me
i'm welcome
:-D
#16
Hi everyone! im newbie, i don`t have idea about scrpting, im triying to make my first game (i thought it would be easier :X). I was creating another char when suddenly appear this message and i can't understand why becouse, i think, i didn't touch this code.

"error 563: Variable 'initialize_control-panel' is already defined"

i did three things before this error: "Interact character", "Look at character" and rewrite one display message for one inventory item. I read all the GlobalScript but i didn't find out a 2initialize_control_panel" before. So i read all three steps i did before and all seems be ok.

here is the line 563 and all since { to }.

Code: ags

function initialize_control_panel(){
  // Centre the control panel
  gPanel.Centre(); 
  // Centre the Restart dialog as well
  gRestartYN.Centre();
  if (!IsSpeechVoxAvailable()) { 
    // If there is no speech-vox file, and therefore no speech,
    // disable all the controls related with speech.
    lblVoice.Visible = false;  
    btnVoice.Visible = false;  
    sldVoice.Visible = false;
  }
  else {
    // If there *is*, then set it to voice and text. It's best to use
    // both whenever possible, for the player's sake.
    Speech.VoiceMode = eSpeechVoiceAndText;
    // And reflect this in the control panel.
    btnVoice.Text = "Voice and Text"; 
  }
  if (!System.SupportsGammaControl) {
    // If we can't change the gamma settings, disable the relevant options.
    sldGamma.Visible = false; 
    lblGamma.Visible = false;
  } 
  
  //And now, set all the defaults
  System.Volume = 100;
  sldAudio.Value = System.Volume;
  SetGameSpeed(40);
  sldSpeed.Value = 40;
  if (IsSpeechVoxAvailable()) {
     Speech.VoiceMode = eSpeechVoiceAndText;
     btnVoice.Text = "Voice and Text";
     sldVoice.Value = 255;
     SetSpeechVolume(255);
  }
  if (System.SupportsGammaControl) {
    System.Gamma = 100;
    sldGamma.Value = 100;
  }
}




I can't find out what is happening. Further, my english is so bad...(laugh)
¿what could be wrong?
Thanks everyone will respond to me.
SMF spam blocked by CleanTalk