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 10-14-2009, 09:29 AM
racycle racycle is offline
smooth as eggs
racycle's Avatar
Join Date: Jul 2008
Location: Chanko
Posts: 136
racycle will become famous soon enough
Send a message via AIM to racycle
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});

__________________

Reply With Quote
  #2  
Old 10-14-2009, 09:57 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
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.
Reply With Quote
  #3  
Old 10-14-2009, 10:20 AM
racycle racycle is offline
smooth as eggs
racycle's Avatar
Join Date: Jul 2008
Location: Chanko
Posts: 136
racycle will become famous soon enough
Send a message via AIM to racycle
lol alright , becouse I dont use ganis very often :P , once you show me ill be able to rip it apart and rebuild it



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

__________________


Last edited by racycle; 10-14-2009 at 10:27 AM.. Reason: forgot second tree =o
Reply With Quote
  #4  
Old 10-14-2009, 10:47 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Alright, here ya go. This is the script:

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

Attached Files
File Type: gani ms_tree.gani (284 Bytes, 212 views)
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 05:22 PM.


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