Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   A couple of things (https://forums.graalonline.com/forums/showthread.php?t=134256831)

DustyPorViva 11-06-2009 03:23 PM

A couple of things
 
I need help on a few things.

1) I have a gani and in the gani I have a script running. I have also sent an account name(ThisIsMyAltAccount, for example) via a player.attr[3]. In the gani I have:
player.chat = player.attr[3] @ " : " @ findplayer(player.attr[3]).account;
What does it echo? It echos: "ThisIsMyAltAccount : DustyPorViva(my account)". Why is this? Obviously it is sending the right account to check, but why is it returning my own account back in the findplayer?

2) How can I check for projectiles that have landed from the serverside? I have checked the many apparent functions for them(onActionProjectile, onActionSProjectile, onActionProjectiles) and none of them seem to work, even with just a findplayer("DustyPorViva").chat = "test" script.

3) I have a custom movement system, and I don't want other players to be considered walls. How can I fix this? I tried noplayeronwall() but that's apparently serverside only.

Crow 11-06-2009 07:02 PM

1. No idea. My guess is that findPlayer() in a gani script will always return your own player object.

2. onActionSProjectile() should do the trick, really.

3. noPlayerKilling() is the only way right now. Or, you can do it the complex way. Write your own onwall functions checking for tiletypes.

cbk1994 11-06-2009 11:10 PM

Quote:

Originally Posted by DustyPorViva (Post 1536874)
I need help on a few things.

1) I have a gani and in the gani I have a script running. I have also sent an account name(ThisIsMyAltAccount, for example) via a player.attr[3]. In the gani I have:
player.chat = player.attr[3] @ " : " @ findplayer(player.attr[3]).account;
What does it echo? It echos: "ThisIsMyAltAccount : DustyPorViva(my account)". Why is this? Obviously it is sending the right account to check, but why is it returning my own account back in the findplayer?

GANI scripts are weird, it may just be a problem with them. Are you able to access the players[] or allplayers[] array(s)?

Quote:

2) How can I check for projectiles that have landed from the serverside? I have checked the many apparent functions for them(onActionProjectile, onActionSProjectile, onActionProjectiles) and none of them seem to work, even with just a findplayer("DustyPorViva").chat = "test" script.
onActionProjectile in the Control-NPC should work. I don't remember the parameters, but they should be obvious if you echo them.

Quote:

3) I have a custom movement system, and I don't want other players to be considered walls. How can I fix this? I tried noplayeronwall() but that's apparently serverside only.
The best way I can think of is to combine tileType and findAreaNPCs...

PHP Code:

function myWallCheck(pxpy) {
  return (
tileType(pxpy) == 0) || (findAreaNPCs(pxpy0.050.05).size() > 0)); // not sure if that's the right tileType code, though


something like that

DustyPorViva 11-06-2009 11:18 PM

:) Fixed the first problem by doing the findplayer check from the weapon and passing the data as a param.

Second problem I finally resolved, thanks, heh.

Third, I think I'm going to just use noplayerkilling and maybe custom detection for players themselves.


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

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