Neos2010-12-07 05:24:41
QUOTE (Lilia @ Dec 7 2010, 12:05 AM) <{POST_SNAPBACK}>
Is there any way to do the opposite? That works for the enemy thing, but I also need something like that for my curing system. I guess what I really need to know is, how do you end a function in the first line?
if thisthing = true then
else dothis end
This is telling me I don't have enough ends, which I understand, but everything else I've tried has done the second part no matter what the first part comes out to.
if thisthing = true then
else dothis end
This is telling me I don't have enough ends, which I understand, but everything else I've tried has done the second part no matter what the first part comes out to.
you had too many ends
if table.contains(enemies, matches) then blah else blah end
Lilia2010-12-07 05:39:29
No, I want it to end if the first thing is true. If I'm afflicted with something I don't want to cure, the function should just stop right there.
Sylphas2010-12-07 05:41:55
QUOTE (Lilia @ Dec 7 2010, 12:39 AM) <{POST_SNAPBACK}>
No, I want it to end if the first thing is true.
CODE
function foo()
  if bar then
    return
  else
   Â
  end
end
  if bar then
    return
  else
   Â
  end
end
Return will exit a function. You can return a value as well, with "return
CODE
function foo(num)
  if num % 2 == 1 then
    return "odd"
  else
    return "even"
  end
end
echo(foo(3) .. "\\n") will echo "odd" to your screen. (And a line break.)
  if num % 2 == 1 then
    return "odd"
  else
    return "even"
  end
end
echo(foo(3) .. "\\n") will echo "odd" to your screen. (And a line break.)
Lilia2010-12-07 05:44:14
Awesome, thanks! I knew it would be something stupid simple like that.
Unknown2010-12-07 06:24:26
QUOTE (Lilia @ Dec 6 2010, 11:44 PM) <{POST_SNAPBACK}>
I have a question about tables. Say I capture my enemies list and make a table holding all my names. Then I want to trigger something, but only if the person is on my enemies list. I'm guessing if matches ~= something. What's the something?
Also @Shou, that sounds kind of complicated. I trigger the target call to target the turret, then trigger the turret regaining balance to fire. If the target is dead, I trigger that line to retarget, because we generally siphon more than one beast.
Also @Shou, that sounds kind of complicated. I trigger the target call to target the turret, then trigger the turret regaining balance to fire. If the target is dead, I trigger that line to retarget, because we generally siphon more than one beast.
Oh I see, so in this case you'd continue to re-target each time a beast dies, instead of waiting for the command or for a new one to appear? One reason I took the extra steps is sometimes pilots prefer you to wait for their command, because it might endanger the crew or something like that... not 100% sure.
Esano2010-12-07 06:30:05
Mudlet uses Lua, right?
In Lua you can use 'not' to change the value, ie:
if not null then
print("True!")
else
print("False.")
end
In Lua you can use 'not' to change the value, ie:
if not null then
print("True!")
else
print("False.")
end
Sylphas2010-12-07 06:34:17
QUOTE (Shou @ Dec 7 2010, 01:24 AM) <{POST_SNAPBACK}>
Oh I see, so in this case you'd continue to re-target each time a beast dies, instead of waiting for the command or for a new one to appear? One reason I took the extra steps is sometimes pilots prefer you to wait for their command, because it might endanger the crew or something like that... not 100% sure.
I'm 99% sure that if there is something you can target, you should be shooting at it. The only problem might be target priority, but that's not hard to do either.
EDIT: Slight nitpick, Esano. Lua uses nil instead of null.
Unknown2010-12-07 06:43:52
@Lilia:
I save the aetherbeast target as a variable, then I trigger ^A battle turret is not targeting anything\\.$ to target the aetherbeast again.
Edit: Only time there might be a problem is if the vortex spawns two different aetherbeasts. Then, yeah, manual.
I save the aetherbeast target as a variable, then I trigger ^A battle turret is not targeting anything\\.$ to target the aetherbeast again.
Edit: Only time there might be a problem is if the vortex spawns two different aetherbeasts. Then, yeah, manual.
Lilia2010-12-07 06:48:05
QUOTE (Caerulo @ Dec 7 2010, 12:43 AM) <{POST_SNAPBACK}>
@Lilia:
I save the aetherbeast target as a variable, then I trigger ^A battle turret is not targeting anything\\.$ to target the aetherbeast again.
I save the aetherbeast target as a variable, then I trigger ^A battle turret is not targeting anything\\.$ to target the aetherbeast again.
Yeah, that's what I do. If you shouldn't be firing, you'll generally be told to 'deactivate your turret', in which case you'll deactivate the whole folder. I've got folders for each module that are always locked, and I only unlock them when I'm on that module.
Anisu2010-12-07 11:17:23
QUOTE (Lilia @ Dec 7 2010, 07:48 AM) <{POST_SNAPBACK}>
Yeah, that's what I do. If you shouldn't be firing, you'll generally be told to 'deactivate your turret', in which case you'll deactivate the whole folder. I've got folders for each module that are always locked, and I only unlock them when I'm on that module.
mine actually a table to either add all called out targets, or add spawned targets (I prefer working with spawned targets but meh some pilots don't like that). And if it is empty and you get attacked it targets the attacking creature. I then track things that blow up, if the list is not clear, retarget with priority on karbs.
Jules2010-12-07 13:48:06
When it comes to aetherhunting, I have a semi-sophisticated system set up. Whenever an aetherbeast appears, I insert the name of the beast into a table. Then, when it comes to targeting, I iterate through that table, and if there's a Dragon, or Scyllus, or Gargantuan, then I'll target and kill them first. After that beast dies, I'll check if there's anything left in the table, and if so, I'll target them and repeat the process. If there's a Karibidean, I'll still add them to the list, but I won't target them unless all other aetherbeasts are dead. And as far as roaming beasts that you sometimes have to kill, I made an alias 'aa ', which will add that aetherbeast into my targeting table, and do it all over again. Pretty cool, and that allows me to not have to do too much manual anything! 

Trinit2010-12-09 19:09:50
When I enter the editor to write something, in this case the examined in a design, it forces a single space before the examined. Any ideas on how to fix this?
Vadi2010-12-09 19:37:13
If it's not removed in latest pre-release yet, then it will be in the next one. Can't fix it right now, though - besides leaving the first line blank.
Lilia2010-12-09 19:37:57
QUOTE (Trinit @ Dec 9 2010, 01:09 PM) <{POST_SNAPBACK}>
When I enter the editor to write something, in this case the examined in a design, it forces a single space before the examined. Any ideas on how to fix this?
Get someone who doesn't use mudlet to edit it for you, or use nexus for editing.
Anisu2010-12-09 21:18:19
QUOTE (Lilia @ Dec 9 2010, 08:37 PM) <{POST_SNAPBACK}>
Get someone who doesn't use mudlet to edit it for you, or use nexus for editing.
or just use the ingame editor

Jules2010-12-09 23:32:37
Is there a built-in Scripting Event that goes off when a new line comes in from the game? If not, I can easily make up something, but I'd rather not reinvent the wheel here.
Unknown2010-12-10 02:04:01
I must be really dunce here, I'm trying to highlight a complete line that contains a variable, but the highlight is only on the part of the line that isn't a variable.
e.g.
The floor shakes as you fire a blast that slams into (.*)
How do I include (.*) in the coloured part?
(and while on this topic, can I colour the line and the variable within it as two separate colours)?
e.g.
The floor shakes as you fire a blast that slams into (.*)
How do I include (.*) in the coloured part?
(and while on this topic, can I colour the line and the variable within it as two separate colours)?
Jules2010-12-10 02:14:12
QUOTE (Shou @ Dec 9 2010, 09:04 PM) <{POST_SNAPBACK}>
I must be really dunce here, I'm trying to highlight a complete line that contains a variable, but the highlight is only on the part of the line that isn't a variable.
e.g.
The floor shakes as you fire a blast that slams into (.*)
How do I include (.*) in the coloured part?
(and while on this topic, can I colour the line and the variable within it as two separate colours)?
e.g.
The floor shakes as you fire a blast that slams into (.*)
How do I include (.*) in the coloured part?
(and while on this topic, can I colour the line and the variable within it as two separate colours)?
To select the entire line:
CODE
selectLine()
setBgColor(R, G, B)
setFgColor(R, G, B)
setBgColor(R, G, B)
setFgColor(R, G, B)
I'm not exactly sure how to color the variable one way, and the line another, though I suppose it would be some way similar to coloring the entire line.
Vadi2010-12-10 02:54:04
QUOTE (Jules @ Dec 9 2010, 06:32 PM) <{POST_SNAPBACK}>
Is there a built-in Scripting Event that goes off when a new line comes in from the game? If not, I can easily make up something, but I'd rather not reinvent the wheel here.
yes, it's called a trigger
Jules2010-12-10 03:09:58
QUOTE (Vadi @ Dec 9 2010, 09:54 PM) <{POST_SNAPBACK}>
yes, it's called a trigger
Not exactly what I was going for... But meh, it'll have to do.