Graal Forums

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

Jiroxys7 09-13-2010 10:23 PM

Two questions.
 
First Question:

Is there any way besides actionprojectile2() to cause something to happen when a projectile hits something? actionprojectile2() apparently cannot seem to differentiate between different projectiles. Say, If i want my projectile to explode when it hits a wall, actionprojectile2 will cause EVERY projectile to explode when it hits a wall. regardless of who shot it. And, since from what I understand, that there's currently no ways to find a projectile's id, generating a random number between 0 and 999999999, putting it in the projectile's params and copying it into a this.var, then putting if(params[whatever] == this.randval){blah;} still seems to trigger on every projectile. is there a way to find the id of the projectile yet? or is there a better function or method i should know about?

Second Question:

In one of my NPCs, I have it set so the players use a custom idle gani based on what weapon the have equipped. but when I tried it with another player, the custom idle gani seemed to only show clientside, and the regular idle animation was showed to everyone else (e.g. player A sees themself using the custom gani, but player B sees player A with the regular idle gani, and vice-versa) But from what I understand, such ganis should be globally viewable. what would normally cause this to happen?

Bonus Question: Remember that old function reflectarrow? I don't suppose there're any functions like that that work with shoot() projectiles are there?

fowlplay4 09-13-2010 10:31 PM

1. You can use setshootparams() to change the parameters that are called when the projectile hits so you can differentiate the exploding projectiles from others.

2. I don't see why you'd have that problem you should be using: replaceani("idle", "newidle");

3. Use setshootparams, and re-calculate where to shoot it back to based on your parameters.

Jiroxys7 09-13-2010 11:26 PM

Quote:

Originally Posted by fowlplay4 (Post 1600580)
1. You can use setshootparams() to change the parameters that are called when the projectile hits so you can differentiate the exploding projectiles from others.

I was doing that before, but it looks like it needed more tweaks. I've got it working now, but it strikes me as a bit more convoluted than it needs to actually be. I do hope Stefan incorporates a better alternative soon. (if not already in v6)

Quote:

Originally Posted by fowlplay4 (Post 1600580)
2. I don't see why you'd have that problem you should be using: replaceani("idle", "newidle");

I had been setting the gani to the alternative instead based on the player's weapon. I tend to avoid setani in the past to avoid problems in case something doesn't switch back. But I'll give this a shot.

Quote:

Originally Posted by fowlplay4 (Post 1600580)
3. Use setshootparams, and re-calculate where to shoot it back to based on your parameters.

There was this trick i found out where you could use reflectarrow on all of the arrows in the area over and over. it make it seem like a time stop or something so it was neat. But perhaps I may be able to chop together some kind of way to emulate that.

Thanks for the help :D


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

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