![]() |
[Broken(?)] shootarrow/nuke/ect
i was making a weapon script with shootarrow() today, and i noticed that, it wont shoot correctly, it doesnt follow the player.
however, this seems to work on UN, i dont know why, but i guess it's because it got gs1 enabled still(?) x_x. either stefan fixes this, we better come up with a workaround for all types of shoot*().. :mad: |
HTML Code:
Shootarrow(dir);You're probably thinking of a custom projectile using the command shoot(). |
Quote:
Quote:
(i'm not an idiot or a newby scripter.) |
Quote:
|
Quote:
|
Not sure what you mean by "following the player".
|
From what I remember, the old shootX()'s work off the NPC's x/y instead of the player's.
Something like: this.x = player.x; this.y = player.y; shootarrow(player.dir); might work. However, I'm pretty sure you don't need to take precautions like this(as WNPC's should by, default, be positioned at the player's x/y). Default bows are actually scripted and simply use shootarrow(player.dir). |
Quote:
|
Quote:
i don't see how setting this.x/y to player's x/y is going to change the shootarrow, but i'll try that tomorrow anyway. |
HTML Code:
//#CLIENTSIDE |
Quote:
PHP Code:
|
Quote:
PHP Code:
However, I'm not even sure that will work anymore as I'm pretty sure Stefan make this.x/y not accessible via script in WNPCs since a lot of old weapon scripts used those without intending to alter the position of the weapon's x/y. |
Quote:
|
Are you using a custom movement that doesn't involve player.x and player.y? [Don't know why- but that's all I can think of]
|
Quote:
|
Quote:
|
What ever I do, I can't seem to recreate your problem. This is weird.
|
Quote:
|
Quote:
|
Did you use it on a GMAP? 'Cause they don't work on GMAP's.
|
Quote:
|
Quote:
|
i am using this on gmap and a singel level, V6 does not fix this, i haven't tested the windows version, so i only got the unupdated linux version.
yes, anoter weapon is caling the public function, but i dont see how that should be a problem, i mean, if i was to make a weapon that triggerd another weapon, would it break then? |
Quote:
|
Quote:
|
Quote:
|
Quote:
(currently booted in windows, tried in v5 and v6, both broken.) |
Quote:
|
Quote:
|
You still haven't shown us the scripts doing this. I mean if you don't want to, fine, but it just makes it nearly impossible for anyone to see what's going on.
|
Quote:
sorry. i'll try to replicate it on testbed. **EDIT** it was quite easy to replicate, i only had to try once. Public/Deas_Voice/Weapon: (When you update this script, it goes to player's x/y, but if u move, it stays at that x/y) PHP Code:
(this is the wnpc you use to trigger the Weapon) PHP Code:
*Edit2: I've added "shootfireball(player.dir);" to the WeaponTrigger (on Testbed) because i want to show how it should look like. |
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
where do you want to to make a trigger? |
Quote:
|
shootarrow() takes the position of the npc/weapon that shoots the arrow. Weapons are automatically moved to the player position. You cannot change the weapon position if you are on a gmap.
About triggering another weapon: If you call the function of the other weapon directly it is not syncing the position, only if the weapon receives an event (onWeaponFired, trigger etc.). I suggest using a simple approach and calling shootarrow in the original weapon script (or pass the weapon object to the other function and then call callerweapon.shootarrow()). |
uhh, okey.
well it got solved by doing trigger in the public function, then do shootarrow() in that function. thanks maui. ~and the rest of you. |
| All times are GMT +2. The time now is 10:48 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.