Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-25-2009, 09:21 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
GuiProfile problems

So, I have a weapon added to the player on login. It controls all the profiles on Bomy Island.

HTML Code:
//#CLIENTSIDE
function onCreated() {
  this.onLoadProfiles();
}

function onLoadProfiles() {
  new GuiTextCtrl("BomyIsland_KingdomHeaderText") {
    with(profile) {
      fontcolor = {255, 255, 255, 255};
      fontsize = 24;
      fonttype = "Arial";
      shadowcolor = {25, 25, 25, 255};
      shadowoffset = {2, 2};
      textshadow = true;
    }
  }

  new GuiTextCtrl("BomyIsland_KingdomText") {
    with(profile) {
      fontcolor = {255, 255, 255, 255};
      fontsize = 14;
      fonttype = "Arial";
      shadowcolor = {25, 25, 25, 255};
      shadowoffset = {2, 2};
      textshadow = true;
    }
  }
}
So that pretty much works (I think...), however when I try to draw the chat it's coming up as not found and as though that profile doesn't exist and draws Graals default profile.

Here's the code I am using to draw it
HTML Code:
    new GuiMLTextCtrl("Kingdom_Text-Information") {
      profile = BomyIsland_KingdomHeaderText;
      position = {30, 20};
      extent = {100, 50};
        
      text = "Information";
    }
Any ideas? thank you. The text is being displayed after the profiles have been loaded so that's not the problem.
I made all the profiles in a weapon so that it's called only on login or updated, is this a bad idea...?
Reply With Quote
  #2  
Old 08-25-2009, 09:26 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
I've always just used

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
loadProfiles();
}

function 
loadProfiles() {
  new 
GuiControlProfile(ATextProfile) {
    
textoffset "0 -10";
    
fontcolor "255 255 255";
    
fonttype "Arial";
    
fontsize 10;
    
fontstyle "b";
  }

Then in the GUI Object that I want to use it with

profile = ATextProfile;

I believe you can do things like:

PHP Code:
new GuiBlueTextProfile(Stuff) {
  
// automatically inherits variables from the GuiBlueTextProfile
  // adjust other variables at your discretion

__________________
Quote:
Reply With Quote
  #3  
Old 08-26-2009, 08:56 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
Yeah- that's what I've done but it doesn't seem to work haha

Thank you
Reply With Quote
  #4  
Old 08-27-2009, 10:33 PM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Quote:
Originally Posted by [email protected] View Post
Yeah- that's what I've done but it doesn't seem to work haha

Thank you
Notice:
Quote:
Originally Posted by fowlplay4 View Post
new GuiControlProfile
Quote:
Originally Posted by [email protected] View Post
new GuiTextCtrl("Bomy...
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #5  
Old 08-27-2009, 10:39 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
Quote:
Originally Posted by LoneAngelIbesu View Post
Notice:




Yeah- I did that and it still didn't work. Thanks for the heads up though
Reply With Quote
  #6  
Old 08-27-2009, 10:47 PM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Quote:
Originally Posted by [email protected] View Post
Yeah- I did that and it still didn't work. Thanks for the heads up though
This should work just fine. I don't know why you're in the profile scope, anyways.

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
this.onLoadProfiles();
}

function 
onLoadProfiles() {
  new 
GuiTextProfile("BomyIsland_KingdomHeaderText") {
    
fontcolor = {255255255255};
    
fontsize 24;
    
fonttype "Arial";
    
shadowcolor = {252525255};
    
shadowoffset = {22};
    
textshadow true;
  }

  new 
GuiTextProfile("BomyIsland_KingdomText") {
    
fontcolor = {255255255255};
    
fontsize 14;
    
fonttype "Arial";
    
shadowcolor = {252525255};
    
shadowoffset = {22};
    
textshadow true;
  }

__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #7  
Old 08-28-2009, 08:27 AM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
I was modifying an old script- still not loading on login. Maybe it's the weapon order. Thanks again
Reply With Quote
  #8  
Old 08-28-2009, 12:54 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by [email protected] View Post
I was modifying an old script- still not loading on login. Maybe it's the weapon order. Thanks again
weaponorder= should fix it, otherwise you can set some variable "profilesLoaded" and wait for it to be set before starting to draw the controls.
__________________
Reply With Quote
  #9  
Old 08-28-2009, 09:13 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
All fixed- haha. Thanks guys much appreciated
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:47 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.