Looking for feedback on smartbaddy BETA
I created a smartbaddy, using gbaddy3.0 to help me a little. This baddy is supposed to simulate how a player would fight. This baddy runs around the player and sometimes charges rather than charging 100% of the time, to create a challenge. In addition, the baddy has a 0.1-0.4 second delay before swinging its sword to show it is not a perfect computer that can hit right away. This script may be used for learning purposes, and feel free to upload it to your server to play with it. However, this script may not be used in the final content of a server. I might give away permission to this script if I get good feedback. I wouldn't use this on your server anyways, as I am sure it is not very efficient. Also, I had a bit of trouble with the triggering of the npc when hit, so if someone could tell me how to fix it, that will be appreciated.
PHP Code:
|
PLEASE fix your styling.
|
Quote:
|
use the tab key on your keyboard and quickly run through your script fixing it up, the script isnt that long... alternatively go into the level editor paste your script there and press the style button in the npc window like the way it use to be done before npc server scripting became the new BIG THING
also.... PHP Code:
= is for assigning values eg:this.i=4; == is for comparing values eg:if (this.i==4) might wanna fix this up and.... PHP Code:
triggeraction(player.x+1.5+(vecx(playerdir)*2),pla yer.y+1.5,"hit"); also arent triggeractions ment to have a space for parameters being sent or is this different in gs2? |
Quote:
|
Quote:
|
Quote:
|
you've been scripting for less then a week yet you feel this is code gallery worthy? Uhmmm k bai
|
you could always try styling your code as you write it
|
Quote:
|
The problem with your styling is that there are huge line gaps, indentation is all wrong.
PHP Code:
This makes reading scripts much easier. Do not use the built in style function on rc, as it tends to muck things up, and it is much better practice to style as you go along, instead of coding a giant wall of text, then attempting to style afterwards. Beginning braces should be on the same line as the function declaration, and ending braces should be on their own line. |
Quote:
|
How to style your script properly with jsbeautifer.org
Copy-paste your code into the code text area. Settings: - Indent with 2 spaces - Braces with control statement - Un-check all Checkboxes Click 'Beautify' Result: PHP Code:
|
Many fixes! The baddy currently doesn't work on gmaps at the time, I had to remove this to make the hit detection better.
|
Quote:
|
All times are GMT +2. The time now is 12:59 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.