General > Developers Corner

Need some help with a ULX LUA command.

<< < (10/14) > >>

Megiddo:
The log call looks alright to me. Did you try sticking a print before it to make sure that it's being called? It's suspicious that it wouldn't throw an error if it's having a problem.

Also, your config is set so that you can see echoes, right?

LuaTenshi:

--- Quote from: JamminR on July 06, 2011, 02:34:41 PM ---Worth a shot.
 
Sorry, I just looked over the actual function and, well, it would take me longer to research all it does than it would for Megiddo to tell you whats wrong.
It's got some cool checks in it, I can tell you that much. Some I don't even understand. :D

No no no no. :D
In the code I was originally commenting on.
Hint. It's just that. It's not a variable. It's a string. It tells anyone that types the command incorrectly what is expected.
Like if I typed "ulx zombify fred forever" it would come back and say something similar to "Command parameters incorrect - ulx zombify <player> <your_hint string, default 10>
I recommend "seconds" or "time in seconds"

As for own vs command variables -
You broke the code by changing it to ulx.number("fun..blah blah). It has to be ulx.command.. that's what tells ULX you're setting up stuff.
Your ulx.command object passes 3 variables to your ulx.zombify, (not visible) who called it, addparam - target, addparm - time)

Those three fill in the following when you call the function.
function ulx.zombify( calling_ply, target_ply, number )
However...not once during the rest of the function, all the way to the 'end' statement, do you ever use that 3rd variable, now named number, originally named 'command' when I commented on it.
Then, right before the end statement, you call another function -
Spawnzomb( pl, pos, ang, own )
Where in any of the lines from function ulx zombify to the end statement after that call does "own" come into play?
You're passing a nil value to spawnzomb on that final variable.
If it's working in any way for you, I'd be surprised how.

--- End quote ---

I did not even notice that "own" was in there, curse you replace all. :P . Your saying if I change "own" to "number" it would work better?

In response to Megiddo. All other commands return with the log, and I left it at default and I believe that default is on correct?

Megiddo:
It's on by default

JamminR:

--- Quote from: HeLLFox_15 on July 07, 2011, 09:06:53 AM ---Your saying if I change "own" to "number" it would work better?

--- End quote ---
The chances of it working better are much increased, yes. :)
Coding tip - I recommend naming the variable something easier for you to remember what it is.
You have pl (player), pos (position), ang (angle)... those a pretty good.
if you look at it a year from now, how much time will it take you to figure out/remember what 'number' was.
Now, we all know it's time..but...later...it will take more 'time' to figure out. :) Perhaps ztime (zombie time!)

LuaTenshi:

--- Quote from: JamminR on July 07, 2011, 02:44:12 PM ---The chances of it working better are much increased, yes. :)
Coding tip - I recommend naming the variable something easier for you to remember what it is.
You have pl (player), pos (position), ang (angle)... those a pretty good.
if you look at it a year from now, how much time will it take you to figure out/remember what 'number' was.
Now, we all know it's time..but...later...it will take more 'time' to figure out. :) Perhaps ztime (zombie time!)

--- End quote ---

ZTime it is then.

Because my post needs to be longer... How would I be able to be part of the Ulysses team? You probably get spammed with that question.

Edit: I am not hijacking my own post. I just wanna know and embarrassed to ask in the chat section. I will come back with an on topic message after I get to test my command.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version