Channel Elements -- too many attacks?

Any new ideas that you'd like to see in the next version of ToME 2.x.x post here

Moderator: Moderator

What to do?

Leave Channel Elements as is
1
11%
Replace some attacks with other spells
2
22%
Replace all the attacks
0
No votes
Uhm ... Manathrust! :P
2
22%
I like casting Geyser lots of times
0
No votes
Polls are silly :)
4
44%
 
Total votes: 9

Message
Author
darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

#31 Post by darkgod »

1) yes we agree, carriage returns are whitespaces. But .. mh lua does not rely on them .. not at all. You can write all yoru code on one line if you fancy

2) mh

3) Limits being ?

4) Now you're trying to tell me that because you cant botehr to learn a new language somebody should go to some lengths to write a converter for a much less pwoerfull language(C) ? No converter in the world could make smart use of lua niceness, beacuse they just dont exists in C. Now please learn lua or stop throwing silly arguments
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Atarlost
Sher'Tul Godslayer
Posts: 1973
Joined: Sat Apr 26, 2003 7:38 pm
Location: GMT-8:00

#32 Post by Atarlost »

I don't care about LUA niceness. I'd rather be able to do what I want and have the spell cost and failrate info stored somewhere else as they used to be before this LUA fad started than have everything in one place but not be able to do what I want without several lines of fiddling with temporary variables because I can't string together operators because I need one that LUA doesn't have.
Digitochracy
n. 1. technocracy. 2. government by the numbers. 3. rule by people with the longest fingers.

Neil
Sher'Tul Godslayer
Posts: 2438
Joined: Sat Dec 14, 2002 7:18 pm
Location: California (or sometimes Erebor)
Contact:

#33 Post by Neil »

Atarlost: Was that supposed to make any sense at all?

The only thing I took out of that big block of rambling was that you think it's *good* to store different attributes of spells in different places?

Atarlost
Sher'Tul Godslayer
Posts: 1973
Joined: Sat Apr 26, 2003 7:38 pm
Location: GMT-8:00

#34 Post by Atarlost »

No, It's not *BAD* compared to the PITA that complicated conditional statements become in LUA.
Digitochracy
n. 1. technocracy. 2. government by the numbers. 3. rule by people with the longest fingers.

Neil
Sher'Tul Godslayer
Posts: 2438
Joined: Sat Dec 14, 2002 7:18 pm
Location: California (or sometimes Erebor)
Contact:

#35 Post by Neil »

I already gave an example of a conditional above. It's virtually identical with C.

You lose. Find some other excuse to complain, as this one has no credibiltiy.

Atarlost
Sher'Tul Godslayer
Posts: 1973
Joined: Sat Apr 26, 2003 7:38 pm
Location: GMT-8:00

#36 Post by Atarlost »

Can you translate these concisely?

Code: Select all

if ((o_ptr->k_idx) &&
	    (!artifact_p(o_ptr)) && (!ego_item_p(o_ptr)) &&
	    (!broken_p(o_ptr)) && (!cursed_p(o_ptr)))

Code: Select all

if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
			    (r_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
What about this statement?

Code: Select all

msg_format("%sour %s (%c) %s destroyed!",
				           ((o_ptr->number > 1) ?
				            ((amt == o_ptr->number) ? "All of y" :
				             (amt > 1 ? "Some of y" : "One of y")) : "Y"),
				           o_name, index_to_label(i),
				           ((amt > 1) ? "were" : "was"));
Digitochracy
n. 1. technocracy. 2. government by the numbers. 3. rule by people with the longest fingers.

Neil
Sher'Tul Godslayer
Posts: 2438
Joined: Sat Dec 14, 2002 7:18 pm
Location: California (or sometimes Erebor)
Contact:

#37 Post by Neil »

First one's easy: just use "and" instead of "&&". In fact, lua requires one fewer levels of parentheses in that if.

Second two are examples of poorly-written C, so any example of poorly-written lua would be their equal.

Nerdanel
Sher'Tul
Posts: 1461
Joined: Mon Jul 07, 2003 5:22 pm
Location: Finland

#38 Post by Nerdanel »

The C example #1 doesn't need all those parentheses.

No comment to the actual subject.
Zothiqband -- still an Angband variant.

Atarlost
Sher'Tul Godslayer
Posts: 1973
Joined: Sat Apr 26, 2003 7:38 pm
Location: GMT-8:00

#39 Post by Atarlost »

Tell that to Ben Harrison.
Digitochracy
n. 1. technocracy. 2. government by the numbers. 3. rule by people with the longest fingers.

Jules
Halfling
Posts: 117
Joined: Tue Jun 24, 2003 2:40 pm

#40 Post by Jules »

Well readability of operators is subjective. An operator becomes readable and intuitive when you read it enough.

BenH liked (grokked, indeed) the ? operator and used it a lot. It is, however, in my opinion a fairly small problem. I use it occasionally in C, I don't find it hard to program without it. You could implement it in lua if you wanted to as a function, and just possibly as an overloaded operator with some considerably ingenuity.

Much more interesting are first-class functions with closures. Now that's a programming tool.

There's plenty about LUA that's suboptimal, speaking as someone who only learnt it 3 weeks ago and has been hacking in the ToME code since. But first-class functions and tables are entirely sufficient, IMO, to make it a better programming language for ToME scripts than C.

Atarlost
Sher'Tul Godslayer
Posts: 1973
Joined: Sat Apr 26, 2003 7:38 pm
Location: GMT-8:00

#41 Post by Atarlost »

If someone would implement the trinary conditional operator for LUA I'd stop or at least dramatically curtail my complaining. I still don't like the way it does code blocks (no {..}s) but my biggest complaint is the lack of the ? operator.
Digitochracy
n. 1. technocracy. 2. government by the numbers. 3. rule by people with the longest fingers.

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

#42 Post by darkgod »

I'm sorry but if you ask somebody who never coded what {} means and what then ... end or do ... end means. I'm sure the lua way will get more right anwsers.

Code: Select all

if (foo)
{
...
}
else
{
....
}

Code: Select all

if foo then
...
else
...
end
See it even looks better in Lua, less used lines
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Atarlost
Sher'Tul Godslayer
Posts: 1973
Joined: Sat Apr 26, 2003 7:38 pm
Location: GMT-8:00

#43 Post by Atarlost »

I find the {} notation easier to read. I also find having the ()s surrounding conditionals helpful. As I said, however, my main beef is the lack of a ? operator.
Digitochracy
n. 1. technocracy. 2. government by the numbers. 3. rule by people with the longest fingers.

Tachyon
Uruivellas
Posts: 924
Joined: Sun Jul 06, 2003 10:04 pm
Location: A mountain range east of Bree

#44 Post by Tachyon »

Look Atarlost, this is getting annoying. Yes, having the game crash because you forgot to put in the "}" is definitely irritating - at least in my opinion - but the C vs. Lua argument has really gone too far. Yes, Lua can be a little annoying, but it really is quite similar to C.

Oh, and sorry about saying that Lua is (shudder) almost as bad as basic, I was annoyed because my game had crashed about 3 times when I tried to fix that geomancy bug I described earlier and forgot to add a 2 commas and a "}".
WWBD - What Would Bozo Do?

Atarlost
Sher'Tul Godslayer
Posts: 1973
Joined: Sat Apr 26, 2003 7:38 pm
Location: GMT-8:00

#45 Post by Atarlost »

I shouldn't have mentioned curly braces.

My main problem is with the lack of a trinary conditional operator. Jules implies it could be implemented, but that would require someone who knows LUA and can work with the C code for LUA interpretation. There are people here who must know how to do that sort of thing, because they were able to implement the function hooks that do exist for ToME, but I am not one of those people.
Digitochracy
n. 1. technocracy. 2. government by the numbers. 3. rule by people with the longest fingers.

Post Reply