Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Setshape2 problem (https://forums.graalonline.com/forums/showthread.php?t=134256476)

racycle 10-14-2009 09:29 AM

Setshape2 problem
 
Im trying to load a tree from a class however it dosent block at all, heres the local script

PHP Code:

//#Clientside
this.treetype="grass";
join("obj_tree"); 

and heres the class script i did
PHP Code:

//#CLIENTSIDE
function onCreated() {
if(
this.treetype=="grass"){
setimg ms_tree2.png;}
else if(
this.treetype=="dirt"){
setimg ms_tree3.png;}
else if(
this.treetype=="water"){
setimg ms_tree4.png;}
else if(
this.treetype=="test"){
setimg block.png;}
  
drawoverplayer;
  
setshape2(12,14, {
   
000000000000,
   
000000000000,
   
000000000000,
   
000000000000,
   
000000000000,
   
000000000000,
   
000000000000,
   
000000000000,
   
000000000000,
   
000000000000,
   
000000000000,
   
000,22,22,22,22,220000,
   
000,22,22,22,22,220000,
   
000,22,22,22,22,220000});



DustyPorViva 10-14-2009 09:57 AM

For a simple blocking like this, you're better off using a gani and just setshape(1,width,height) instead, much like GK uses.

What you do is you load the image in a gani, and where you want the top-left of the blocking to start, you place at the corner of the green box in graalshop. Open up a tree gani from GK and you'll see what I mean. Then in Graal just setcharani();setshape() and it will adopt the blocking correctly.

If you need help, just post the image and I'll make it up for you really quick.

racycle 10-14-2009 10:20 AM

lol alright , becouse I dont use ganis very often :P , once you show me ill be able to rip it apart and rebuild it

http://i55.photobucket.com/albums/g1...e/ms_tree2.png

and heres ware the blocking should start if im following you correctly

http://i55.photobucket.com/albums/g1...e/ms_tree3.png

DustyPorViva 10-14-2009 10:47 AM

1 Attachment(s)
Alright, here ya go. This is the script:

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
setcharani("ms_tree","ms_tree2.png");
  
setshape(1,80,64);




All times are GMT +2. The time now is 11:55 AM.

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