Graal Forums

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

JkWhoSaysNi 01-09-2006 01:11 AM

Strange player.shieldimg problem.
 
I am having an impossible time setting player.shieldimg.

I've figured out that the shield gets almost instantly reverted when I change it.

I made this basic NPC:

NPC Code:
//#CLIENTSIDE
if (created) {
// Initialize the attributes
showcharacter;
setcharprop #3,head0.png;
setcharprop #C0,orange;
setcharprop #C1,white;
setcharprop #C2,blue;
setcharprop #C3,red;
setcharprop #C4,black;
setcharprop #2,shield1.gif;
shieldpower = 1;
dir = 2;
}


if (playertouchsme) {
player.shieldimg = "shield2.png";
}



When i touch the NPC my shield will change to shield2.png for a split second before reverting to what it was before.

I tried deleting all weapon npc's from my account and there are no other npcs in the level.

Why does it do this?
headimg,swordimg etc all work fine, but shieldimg does not.

This also seems to be a problem on showani's using findimg(index).actor.shieldimg

Any ideas why this is happening or how to fix it?

Thanks.

Rick 01-09-2006 01:17 AM

Sounds like the shield you want isn't on the server...

Or the server is using the classic shield system and won't let you get a "better" shield. There's a function for that but I don't remember the name right now.

Yen 01-09-2006 01:17 AM

I believe the 3 default shields (normal, mirror, lizard) are protected. Use .gif, instead of .png.
There are also alternative names, but I can't remember them.
Try lizardonshield.png or mirrorshield.png

JkWhoSaysNi 01-09-2006 01:21 AM

oh, thanks :) using .gif works.

Is there any reason findimg(index).actor.shieldimg = "whatever"; won't work?

JkWhoSaysNi 01-09-2006 01:55 AM

Ok found it, for some reason it's findimg(index).actor.shield.

Admins 01-09-2006 03:26 AM

Move the code to serverside, remove that //#CLIENTSIDE line, you should do that anyway since all code that can be put on serverside should also be put on serverside.
Most attributes of the player are protected, you are not allowed to change the shield and shieldpower on clientside, there are also protections against modifying the head and body (can be configured in the server options).


All times are GMT +2. The time now is 06:05 PM.

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