![]() |
Triggering weapons
Anyone know whats wrong with this?
PHP Code:
is the error I get in F2 log. Please help :C |
Is onWeaponFired() public in the weapon NPC?
|
Weapons/Basic Sword
PHP Code:
PHP Code:
|
change it to:
PHP Code:
|
Quote:
|
Makes it look better
|
Quote:
It seems like a lot of useless space, and is a horrible habit if you plan to go into other languages such as C/C++/C# due to functions needing to take specific parameters. |
Quote:
Please read my post on Clean Coding: Common Sense, and you will find that everyone has their own scripting style, and that if it's okay with them, it works. I've already stated my mind on people who say that lines of code matter, and that space matters. You can't waste space because I can put as many of those as I want. I can already script in C++, so get off of my ass. |
Quote:
2) I won't argue with you, it seems like a waste of time. |
Quote:
|
Ok When Did This Thread Have Anything To Do With Attacking Eachother About How Ppl Script? I Mean Really Ppl, Lets All Argue About The Way He Scripts Instead Of Helping Him!!
|
You need to use public function,
public function onWeaponFired should fix it. Nice code btw, :) |
Don't bite me.
Do this: weapon.trigger("WeaponFired", params ); This'll trigger onWeaponFired, but if it doesn't exist, it doesn't do anything. Another is to make onWeaponFired a public function and doing: weapon.onWeaponFired(); |
Quote:
Quote:
Would a moderator please lock this topic, it has no more purpose and I don't want an even bigger arguement. |
I agree the NULL may be a little useless and does get rather in the way in my opinion but I don't see his script as looking horribly structured o_o
He likes to space his stuff out alot... So? Personnaly, when I get into immensly long scripts, styling is important yes but any script style (as long as it is still organized and consistant) mean nothing as the script just a big haze :) (Have to remember where certain functions are defined in the script and such) |
All times are GMT +2. The time now is 12:45 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.