Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-07-2012, 02:39 AM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Set layers and RGB/alpha in GuiDrawingPanel

Is it possible to change / set layers in the GuiDrawingPanel aswell as the RGB/alpha value? I'm messing around with something on Delteria which does display the tiles inside the DrawingPanel, the NPCs but the NPCs and players.
But the NPCs dont have the proper layer. Aswell I couldn't find any way how I could fix the problem with the RGB and alpha. Using maskimage(x, y, img, mode) was the only solution I could find which is not perfect. While using drawObject(x, y, obj) it doesnt seem to be a problem or atleast I couldnt find one yet.
This is the code I am using:
PHP Code:
for (temp.nnpcs) {
  if (
n.visible && n.x in |player.x-(player.x%64), (player.x-(player.x%64))+63.95| && n.y in |player.y-(player.y%64), (player.y-(player.y%64))+63.95|) {
    if (
temp.n.image != NULL && temp.n.ani == NULL) {
      if (
temp.n.alpha == 1) {
        
drawimagestretched(((n.x%64)*16)/ir, ((n.y%64)*16)/irgetImgWidth(n.image)/irgetImgHeight(n.image)/irn.image00getImgWidth(n.image), getImgHeight(n.image));
      }
      else {
        
maskimage(((n.x%64)*16)/ir, ((n.y%64)*16)/irn.image"add");
      }
    }
    else if (
temp.n.ani != NULL) {
      
drawobject(((n.x%64)*16)/ir, ((n.y%64)*16)/irn);
    }
  }
}
for (
temp.pplayers) {
  if (
p.x in |player.x-(player.x%64), (player.x-(player.x%64))+63.95| && p.y in |player.y-(player.y%64), (player.y-(player.y%64))+63.95|) {
    if (
p.alpha 0drawobject(((p.x%64)*16)/ir, ((p.y%64)*16)/irp);
  }

Screenshot:
__________________
MEEP!
Reply With Quote
  #2  
Old 06-07-2012, 02:48 AM
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
No, so you have to determine and draw each layer.
__________________
Quote:
Reply With Quote
  #3  
Old 06-07-2012, 03:09 AM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Ok, thanks.

Recently I found another bug:
Sometimes NPCs do seem to disappear while checking for them. I have to update the level to get them back. But they do get displayed in the GUI. How does it come that some disappear, some wont and how can that get fixed?

The script of the NPC which disappears
PHP Code:
// Created by Alex Stravier
join("npcdefault");
function 
onCreated() {
  
showcharacter();
  
this.head "kouji-head.png";
  
this.skin "orange";
  
this.shoes "orange";
  
this.sleeves "red";
  
this.belt "red";
  
this.coat "red";
  
this.dir 2;
  
this.ani "sit";
  
this.body "xor-body.png";
  
//this.nick = "Simon Fowl";
  
this.-= 0.5;
  
this.0.5;

  
this.chat "Absolutely, 100% no.";

The script of the NPC next to the disappearing NPC
PHP Code:
// Created by Alex Stravier
join("npcdefault");
function 
onCreated() {
  
showcharacter();
  
this.head "headrexx.png";
  
this.body "arwind-josey-body102.gif";
  
this.skin "orange";
  
this.shoes "orange";
  
this.sleeves "brown";
  
this.belt "gray";
  
this.coat "brown";
  
this.hat "hat777.png";
  
this.dir "right";
  
this.ani "sit";
  
this.nick "";
  
this.-= 0.5;
}

this.join("npc");

//#CLIENTSIDE

function onCreated() {
  
this.join("npc");
  
setnpcfeature("nickname""Rexx");
  
setnpcfeature("nicknamecolour""brown");


__________________
MEEP!
Reply With Quote
  #4  
Old 06-07-2012, 03:25 AM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
It might be an issue with my npc class :P I'll have a look.
EDIT: Nope. Not my class.
Reply With Quote
  #5  
Old 06-07-2012, 03:35 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by callimuc View Post
Ok, thanks.

Recently I found another bug:
Sometimes NPCs do seem to disappear while checking for them. I have to update the level to get them back. But they do get displayed in the GUI. How does it come that some disappear, some wont and how can that get fixed?

The script of the NPC which disappears
PHP Code:
// Created by Alex Stravier
join("npcdefault");
function 
onCreated() {
  
showcharacter();
  
this.head "kouji-head.png";
  
this.skin "orange";
  
this.shoes "orange";
  
this.sleeves "red";
  
this.belt "red";
  
this.coat "red";
  
this.dir 2;
  
this.ani "sit";
  
this.body "xor-body.png";
  
//this.nick = "Simon Fowl";
  
this.-= 0.5;
  
this.0.5;

  
this.chat "Absolutely, 100% no.";

The script of the NPC next to the disappearing NPC
PHP Code:
// Created by Alex Stravier
join("npcdefault");
function 
onCreated() {
  
showcharacter();
  
this.head "headrexx.png";
  
this.body "arwind-josey-body102.gif";
  
this.skin "orange";
  
this.shoes "orange";
  
this.sleeves "brown";
  
this.belt "gray";
  
this.coat "brown";
  
this.hat "hat777.png";
  
this.dir "right";
  
this.ani "sit";
  
this.nick "";
  
this.-= 0.5;
}

this.join("npc");

//#CLIENTSIDE

function onCreated() {
  
this.join("npc");
  
setnpcfeature("nickname""Rexx");
  
setnpcfeature("nicknamecolour""brown");


Already a reported issue.

http://forums.graalonline.com/forums...39&post1690139 + the next couple of posts.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #6  
Old 06-07-2012, 04:28 AM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Quote:
Originally Posted by xXziroXx View Post
Already a reported issue.

http://forums.graalonline.com/forums...39&post1690139 + the next couple of posts.
Thanks a lot.
__________________
MEEP!
Reply With Quote
  #7  
Old 06-07-2012, 01:27 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Whatever you've got going there, it looks really nice. Good job.
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 02:20 PM.


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