Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Gani Construction (https://forums.graalonline.com/forums/forumdisplay.php?f=50)
-   -   help with the size of animations? (https://forums.graalonline.com/forums/showthread.php?t=83636)

johny023 01-12-2009 07:39 PM

help with the size of animations?
 
well to make a long story short, i was trying to make a wall that npcs will attack, and the only way i could get it to work is if i put the "showcharacter" trigger in the script and to do that the wall had to be a animation... but when i turned the wall into a animation the actual size of the npc is only about 3/4th of the size of the image, so a fourth of the wall doesn't block...

how do i change the size of a animation so the npc will be as big as the image?

and i did try to use the "setshape" trigger, it didn't do anything :(

cbk1994 01-12-2009 11:35 PM

In the GANI, add (edit with Notepad):

PHP Code:

SCRIPT
//#CLIENTSIDE
if (created || playerenters) {
  
setshape 1WIDTH_OF_IMAGEHEIGHT_OF_IMAGE;
}
SCRIPTEND 

Or if you don't need it to work offline,

PHP Code:

SCRIPT
//#CLIENTSIDE
function onCreated() {
  
setshape(1WIDTH_OF_IMAGEHEIGHT_OF_IMAGE);
}
function 
onPlayerEnters() {
  
onCreated();
}
SCRIPTEND 


[email protected] 01-13-2009 07:36 PM

hmm- (width of image/ height of image) / 16

xXziroXx 01-13-2009 08:27 PM

I'm pretty sure you can't change the shape of a gani in any way.

johny023 01-14-2009 01:57 AM

Quote:

Originally Posted by cbk1994 (Post 1456584)
In the GANI, add (edit with Notepad):

PHP Code:

SCRIPT
//#CLIENTSIDE
if (created || playerenters) {
  
setshape 1WIDTH_OF_IMAGEHEIGHT_OF_IMAGE;
}
SCRIPTEND 

Or if you don't need it to work offline,

PHP Code:

SCRIPT
//#CLIENTSIDE
function onCreated() {
  
setshape(1WIDTH_OF_IMAGEHEIGHT_OF_IMAGE);
}
function 
onPlayerEnters() {
  
onCreated();
}
SCRIPTEND 


i tried both of those, but neither of them worked, do i need to put them in a specific place in the notepad?

DustyPorViva 01-14-2009 02:03 AM

I think the bigger problem people should be considering is the fact that you have to showcharacter() in order to get it to take damage.

Let's see the script.

johny023 01-14-2009 05:18 AM

Quote:

Originally Posted by DustyPorViva (Post 1456861)
I think the bigger problem people should be considering is the fact that you have to showcharacter() in order to get it to take damage.

Let's see the script.

sorry, was trying to avoid a wall of text in first post. it takes damage it's just that the npcs won't attack it unless i have "showcharacter" in it's script. it's like they can't see it unless i add that bit in, i find that a bit strange since i didn't have to do that with other npcs... but here's the script anyway, maybe someone could just tell my why the npcs don't attack it.

this is for the offline editor.
sorry about it not being neat, and i know some things may be scripted strangely.. but everything i learned about scripting i learned from pressing random buttons. didn't know about the forums until a few years after i got the editor.

PHP Code:

// NPC made by John
if (created) {
  
showcharacter;
setcharani wall,;
hearts 1;
this.hp player_carpentry_lv*100;
}

if (
timeout){
message #v(this.hp);
}

if (
actionattack && this.hp>0) {
  
this.sdamage random(player_weaponpower,player_weaponpower*10);
  
this.stdamage random(player_strengthlv,player_strengthlv*5);
  
random(0,100);
  if (
i<10this.hp -= (player_weaponpower*20 player_strengthlv*10);
  if (
i<10play critical.wav;
  else if (
i<100this.hp -= this.sdamage this.stdamage;
}

if (
actionshot && this.hp>0) {
  
random(0,100);
  if (
i<10this.hp -= bulletpower*10;
  if (
i<10play critical.wav;
  else if (
i<100this.hp -= bulletpower;
  
shot 3;
  }

if (
actionfire2 && this.hp>0) {
  
this.hp -= firepower2;
  }

if (
actionwater2 && this.hp>0) {
  
this.hp -= waterpower2;
  }

if (
actionearth2 && this.hp>0) {
  
this.hp -= earthpower2;
  }

if (
actionlightning2 && this.hp>0) {
  
this.hp -= lightningpower2;
  }

if (
actionlight2 && this.hp>0) {
  
this.hp -= lightpower2;
  }

if (
actiondark2 && this.hp>0) {
  
this.hp -= darkpower2;
  }

if (
actionmana2 && this.hp>0) {
  
this.hp -= manapower2;
  }

if (
actionattack2 && this.hp>0) {
this.hp -= attackpower;
}

if (
this.hp<=&& timeout){
play explode1.wav;
play explode2.wav;
play explode3.wav;
destroy;
}

timeout 0.05

if anyone knows how to change the size/shape of a gani (if it's possible) or why the npcs won't attack it if it doesn't have "showcharacter" the help would be appreciated :)

xXziroXx 01-14-2009 05:21 PM

Quote:

Originally Posted by johny023 (Post 1456880)
but everything i learned about scripting i learned from pressing random buttons.

Aaah, good old days. Welcome to the club. :)

Quote:

Originally Posted by johny023 (Post 1456880)
if anyone knows how to change the size/shape of a gani (if it's possible) or why the npcs won't attack it if it doesn't have "showcharacter" the help would be appreciated :)

As I previously stated, I wasn't aware of a way to do that. It appears I might be eluded about it though?

johny023 01-14-2009 05:42 PM

what i don't understand sometimes the shape of the animation changed to fit the image and sometimes it didn't. for this image it just won't change >.< but i did take your post into consideration, and i'm starting to think i can't change the shape of the animation.

do you notice anything in the script that would make it so npcs won't attack it? or is that just graal being glitchy again?

xXziroXx 01-15-2009 05:38 PM

Quote:

Originally Posted by johny023 (Post 1456947)
what i don't understand sometimes the shape of the animation changed to fit the image and sometimes it didn't. for this image it just won't change >.< but i did take your post into consideration, and i'm starting to think i can't change the shape of the animation.

I think it depends on the amount of transparency in the image, as well as it's width and height.

Quote:

Originally Posted by johny023 (Post 1456947)
do you notice anything in the script that would make it so npcs won't attack it? or is that just graal being glitchy again?

No, I didn't, but I lack the patient to figure out GS1 scripts nowadays I'm afraid. Especially poorly styled ones.

DustyPorViva 01-15-2009 06:26 PM

NPCs won't attack because I'm assuming you're using pre-defined character scripts in the editor, and they're scripted only to attack other players(showcharacter renders them a 'player').

johny023 01-16-2009 04:59 AM

Quote:

Originally Posted by DustyPorViva (Post 1457261)
NPCs won't attack because I'm assuming you're using pre-defined character scripts in the editor, and they're scripted only to attack other players(showcharacter renders them a 'player').

so if i re-script it on one of those blank npcs it should work? or are those pre-defined also?

DustyPorViva 01-16-2009 05:02 AM

Quote:

Originally Posted by johny023 (Post 1457395)
so if i re-script it on one of those blank npcs it should work? or are those pre-defined also?

If you're starting and NPC from scratch, it will do what you tell it to. If you tell it to attack all NPC's, it will. If you tell it to attack all NPCs that have save[0] true, then they will. So on and so forth.

johny023 01-17-2009 02:02 AM

ok, thanks for the help everyone.


All times are GMT +2. The time now is 09:34 AM.

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