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 01-09-2006, 01:11 AM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
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.
Reply With Quote
  #2  
Old 01-09-2006, 01:17 AM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
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.
Reply With Quote
  #3  
Old 01-09-2006, 01:17 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
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
Reply With Quote
  #4  
Old 01-09-2006, 01:21 AM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
oh, thanks using .gif works.

Is there any reason findimg(index).actor.shieldimg = "whatever"; won't work?
Reply With Quote
  #5  
Old 01-09-2006, 01:55 AM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
Ok found it, for some reason it's findimg(index).actor.shield.
Reply With Quote
  #6  
Old 01-09-2006, 03:26 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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).
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 12:39 PM.


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