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 - jhonberg

#1
Quote from: eri0o on Sat 09/12/2017 22:38:28
Ok, so today I lost some hours of my life coding NormalMap with AGS Script.

In case you want it, Download the Demo here!.

I don't think it looks good, I decided to ditch this idea, but maybe someone wants to try and test this.

I based my code on the code here.

If someone does make it better, faster, please share your enhancemets here!



Great Scott!!! what kind of sorcery is this!!
#2
Quote from: Gilbert on Fri 21/04/2006 10:55:32
Since speeches are overlays they're always displayed below GUIs (I think, not sure), if you want the text over a GUI, you may try making another GUI with transparent background for displaying the text.

Ok i found out the reason... i changed this for god knows what reason!!!! and this creates this very weird effect, hope this can help some one else in the future, leave the Speech on LucasArt always.
#3
 :angry: Tried recreating the Character, View, still it's like im not pointing to the same object?
#5
Was there a solution to this on 3.4.1 ?
#6
Since i can't pass the struct as parameter i just decomposed the object primitives, i don't feel confortable with this workaround but it serves my initial purpose, which was organize the data and make it easy to manipulate.

 

Code: ags

//header
struct ScreenText{
 String text;
 FontType fontType;
 import function init(String text_,FontType fontType_);
};

//script
Overlay* roomText[];

function displayAnimatedText(String fullText,FontType fontType,int row, int maxRows){
   String message=""; 
   for(int i=0;i<fullText.Length;i++){
     message=message.AppendChar(fullText.Chars[i]);
     roomText[row]=ShowTextinRowLeft(message,53665, row+1, maxRows,fontType);
     Wait(2);
   }
   Wait(80);
}

function room_AfterFadeIn()
{
 int maxRows=10;
 ScreenText textRows[10]; 
 roomText= new Overlay[maxRows];
 textRows[0].init("Earth year 1947",eFontNormal);
 textRows[1].init("70.000 years after the last colony left",eFontSpeech);
 textRows[2].init("A strong high energy pulse was picked up by a consulate",eFontSpeech);
 textRows[3].init("cruiser 2 years earlier, origing is planet Earth.",eFontSpeech);
 textRows[4].init("A scout mission is sent to investigate it's origing,",eFontSpeech);
 textRows[5].init("no intelligent life is expected to be found.",eFontSpeech);
 textRows[6].init("   ",eFontNormal);
 textRows[7].init("Mission:",eFontNormal);
 textRows[8].init("Identify energy source and evalute  explore the abbandoned ",eFontSpeech);
 textRows[9].init("settlement for lost artifacts left behind on the exodus.",eFontSpeech);
 
  
   for(int i=0;i<maxRows;i++){
      displayAnimatedText(textRows[i].text,textRows[i].fontType,i, maxRows);
   }

}
#7
Quote from: Snarky on Sat 04/08/2018 11:58:43
The problem is that you can't store pointers in a managed struct (for reasons that have to do with AGS not having a garbage collector), and String is a pointer type.

A workaround (as already discussed above in the thread) would be to store the String in an array, and store the array index in the ScreeText (you planning on fixing that typo?). You could then use an attribute to look up the String in the array and make it seem like it's part of the struct.

Fixed the typo :D
#8
Is there any way this could work for Strings ??  in my case i'm getting this error

Failed to save room room1.crm; details below
room1.asc(4): Error (line 4): Member variable of managed struct cannot be pointer
Code: ags

managed struct ScreenText{
 String text;
 FontType fontType;
};

ScreenText* createScreenText(String text_,FontType fontType_ ){
  
  ScreenText* screenText= new ScreenText();
  screenText.text=text_;
  screenText.fontType=fontType_;
    
  }


Seems that this only works for primitives?   :confused:
#9
Well I'm working on my adventure, solving issue here and there some of them thanks this wonder people here (roll), now I tried to create
a full Intro to transition from the LOGO , to the Main Menu which I would like it to be animated, the problem is what to do with the main character?

I just set it's transparency to a 100 and use a Room for the Intro and planning to use another one for the Menu, what would be proper way to handle this?
What to do with the main character then in this two parts of the workflow.

You input would be much appreciated.

Lien.
#10
Thank you guys, your hints and explanation made realize why  they character base line was higher, i forgot to Trim the mushroom sprite so it occupies more space as you can see, i fixed that and now Baseline and Y position does the trick.



THank you.
#11
This is so lame...  i just added some code on the event block when the room starts and modify the base line number...  I can't believe i had to do that by the code, how come this is not a property of an object? is this really the only way?


#12
How can i set the index for the NPC characters they seem the be in front of the main player i don't understand what's wrong here...
It's clear not intuitive what to do... :undecided:

Can some one give me hand here  what am i missing here???  some one said  Did you modified object baseline? charcters don't have a base line property on the dash board, so i'm clueless here..

Is there property here that helps with that??   How can i set this :(
Thanks in advance.
#13
Well seems that my background is too small and the right edge never got shown if it happens to any of you. :) just import a bigger image and move it to the center.
#14
Now that we are here, i wanted to ask  where the heck is the right edge line ??  there is left ,top , bottom  but no right??? wtf :D  i think i missed something here.
#16
Wait i have to recheck this again because it was not working for me last time. BRB
#17
Code: ags
// room script file
bool moveStarted=false;
function room_FirstLoad()
{ 
  objFlower.SetView(2, 0, 2);
  objFlower.Animate(0, 5, eRepeat,eNoBlock);
  
  cEgo.LockView(3);
  cEgo.Animate(0, 30, eRepeat, eNoBlock);
  cEgo.UnlockView();

  
  
 
  cEgo.Say("HEllo");
    
  //cEgo.Animate(0, 45, eRepeat,eNoBlock);
  objFlower.Animate(0, 5, eRepeat,eNoBlock);
  
   
 
  
}

function room_RepExec()
{
  if(cEgo.Moving){ 
     moveStarted=true;
    }
    
  if(!cEgo.Moving && moveStarted == true){
     cEgo.Say("I stop now");
     moveStarted=false;
    }
 
}


here is how it's going so far.  So at least now when he stops moving he can say something...
#18

function room_RepExec()
{

}

i was thinking that maybe i should set up everything here... but then i don't understand how do i use the Idle views and thinking views available.

Addressing this problem seems not so trivial for me atm :S i might just overthinking something simple...
#19
So i am bit lost here i mean to make my player show up in room which i managed to do, he can walk.  But my idle animation does not seem to be called.

Where should i set up this logic in the room.asc script ? 

I mean if i want to make him walk and talk for example i saw that there is no onMove  or onObjectMoving...  any ideas?

#20
ok i am sorry i even ask that stupid question... is just that i can't see well some times
i completely missed the in the left side window there is Properties  and there you can find a dropbox with all the items contained. :sealed:
SMF spam blocked by CleanTalk