Author Topic: Screwed-up Script. I require assistance.  (Read 2079 times)

Not work D: Thanks anyways, lordician
Hmm, did it do anything at all?
Any console errors?

You're trying to test "%obj.toolAmmo[%obj.currTool]", but if you're using my script for that Parent::onMount is not being called (which sets the initial ammo if you have nome), there are no reload sequences and the maximum ammo amount isn't set in the item datablock. Because of these the ammo is always counted as 0 and it won't go into iron-sights.

If you are not using my system then be aware that mine has the variable "toolAmmo" and will conflict with yours if they have any of e.g. Tier Tactical weapons, TF2 Basic Guns installed.

You're trying to test "%obj.toolAmmo[%obj.currTool]", but if you're using my script for that Parent::onMount is not being called (which sets the initial ammo if you have nome), there are no reload sequences and the maximum ammo amount isn't set in the item datablock. Because of these the ammo is always counted as 0 and it won't go into iron-sights.
Perhaps that solved something i had too. :o
Should've known.

Thanks Space, for clarifying the Ammo/Ironsight thng for me. The thing is, I don't want the ammo thing, it raycasts, but no ironsight. Why is dat?

Hmm, did it do anything at all?
Any console errors?
Nope. No errors. My head hurts though. ._.*

Nope. No errors. My head hurts though. ._.*
Haha, lemme look through the script one more time.

EDIT:
I think Space Guy is right and doesn't say that for fun.
Your weapon only changes image when the ammo != 0.
But i don't see that the ammo gets set on anything.
IF you use Space Guy's ammo script, you should try to do what Space Guy said.
Otherwise, set the ammo in the onmount script.

When a variable doesn't get set but is used, you get some highly unpredictable actions.

Tl;dr
The ammo clarification DOES matter since the iron sight action only executes when having ammo.


And when Space Guy says something, you can almost know he's right.
He has very much experience points in scripting. ;)
(However, even he doesn't know everything though. :P)
« Last Edit: November 18, 2010, 05:19:42 AM by lordician »

Haha, lemme look through the script one more time.

EDIT:
I think Space Guy is right and doesn't say that for fun.
Your weapon only changes image when the ammo != 0.
But i don't see that the ammo gets set on anything.
IF you use Space Guy's ammo script, you should try to do what Space Guy said.
Otherwise, set the ammo in the onmount script.

When a variable doesn't get set but is used, you get some highly unpredictable actions.

Tl;dr
The ammo clarification DOES matter since the iron sight action only executes when having ammo.


And when Space Guy says something, you can almost know he's right.
He has very much experience points in scripting. ;)
(However, even he doesn't know everything though. :P)
Thanks again, but have you seen my updated code?

Bump for lack of answer/explanation.


You still have the test for %obj.toolAmmo[%obj.currTool] != 0 before it changes. You never set the ammo amount (since you've removed everything to do with that) so it's always going to be a blank string ("") which equals 0 in value. Therefore it'll never change to the iron-sight.

You still have the test for %obj.toolAmmo[%obj.currTool] != 0 before it changes. You never set the ammo amount (since you've removed everything to do with that) so it's always going to be a blank string ("") which equals 0 in value. Therefore it'll never change to the iron-sight.
Thank you for that info. I shall try it out immediately.