Graal Forums

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

Pelikano 12-25-2008 12:23 PM

Showimg
 
Well, I'm trying to show an image, but there's some sort of strange problem ---> the image just won't show oO
Everything else in the event works fine, and it's all serversided..


PHP Code:

function onActionServerSide() {
  if (
params[0] == "EventStart") {
    
serverr.event true;
    
serverr.eventlevel params[2];
    
serverr.eventx params[3];
    
showimg(185"event_icon.gif"screenwidth/2screenheight/2); 
    
serverr.eventy params[4];
  }



Codein 12-25-2008 01:08 PM

showimg() is a clientside function, I believe.

Crow 12-25-2008 01:19 PM

Quote:

Originally Posted by Codein (Post 1452279)
showimg() is a clientside function, I believe.

Negative. Though screenwidth and screenheight are clientside. Also, the default layer of showimg() is 1 as far as I know, so you would basically have to change it with changeimgvis() to get it in the center of the screen, but I suppose you can only use layers 0 to 3 on the serverside.

Codein 12-25-2008 01:24 PM

Quote:

Originally Posted by Crow (Post 1452281)
Negative. Though screenwidth and screenheight are clientside. Also, the default layer of showimg() is 1 as far as I know, so you would basically have to change it with changeimgvis() to get it in the center of the screen, but I suppose you can only use layers 0 to 3 on the serverside.

Oh, sorry. Atleast I've learnt something new ^^

Pelikano 12-25-2008 01:35 PM

Well.
It's serverside, but if screenheight and screenwidth are clientside (which is logical), shouldn't this be working?

" showimg(1, "event_icon.gif", 30, 30); "

well it isnt xD

[email protected] 12-25-2008 01:50 PM

You need
HTML Code:

changeimgvis(1, 1);
i think

Codein 12-25-2008 02:46 PM

I can't get showimg() to work serverside at all, for some reason. Even with changeimgvis().

xXziroXx 12-25-2008 02:58 PM

Your problem is that you're displaying the image on screen coordinates divided by half, which in 800x600 would be at x400 and y300, which is outside the level boundaries (64x64). If you're on a GMAP you should see the image a few levels south east :p

EDIT: I'm fairly sure showimg() works serversided in local NPCs, doubt it will work when done in a wNPC though.

Pelikano 12-25-2008 04:13 PM

So it won't work serversided in WNPCs..
mhmkay, thanks to everyone that answered :D

Crow 12-25-2008 06:38 PM

Quote:

Originally Posted by Pelikano (Post 1452308)
So it won't work serversided in WNPCs

*facepalm*

[email protected] 12-27-2008 03:49 AM

You don't have to do everything serverside. You could set a string serverside and check clientside to see if its true and if it is, it could show the image.

Pelikano 12-27-2008 12:15 PM

that's exactly what I'm doing now :D


All times are GMT +2. The time now is 03:02 PM.

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