[DiscordArchive] hmm, but in your examples there the classname is nowhere as string, would that matter?
[DiscordArchive] hmm, but in your examples there the classname is nowhere as string, would that matter?
Archived author: Foe • Posted: 2022-05-16T18:07:56.194000+00:00
Original source
i mean it's possible, but Lua (and Eluna) isn't designed that way
Archived author: Grandold • Posted: 2022-05-16T18:08:13.114000+00:00
Original source
in php its super easy, just like
```
$classes = array('A', 'B');
foreach ( $classes as $className ) {
$obj = new $className()
}
```
Archived author: Grandold • Posted: 2022-05-16T18:08:20.238000+00:00
Original source
ye lua is certainly different
Archived author: Grandold • Posted: 2022-05-16T18:09:07.638000+00:00
Original source
^^ important part being the double $ there
Archived author: Grandold • Posted: 2022-05-16T18:09:49.638000+00:00
Original source
or something like that, but ye all works so no problem, just didn't get it done the way I wanted ^^
Archived author: Grandold • Posted: 2022-05-16T18:10:50.311000+00:00
Original source
actually now i think its correct
Archived author: Grandold • Posted: 2022-05-16T18:12:14.892000+00:00
Original source
but yeah it works just fine the way u described last, gotta settle with that (for now) x)
![[Image: unknown.png?ex=690c3cb5&is=690aeb35&hm=f...013aea1d7&]](https://cdn.discordapp.com/attachments/448835144564867094/975823505251774464/unknown.png?ex=690c3cb5&is=690aeb35&hm=f8b90d90b3924eacbd50faa4c6dae0024b26f3887d914b5fa2683ff013aea1d7&)
Archived author: Foe • Posted: 2022-05-16T18:14:13.688000+00:00
Original source
You can also do this..
![[Image: unknown.png?ex=690c3cb5&is=690aeb35&hm=f...013aea1d7&]](https://cdn.discordapp.com/attachments/448835144564867094/975823505251774464/unknown.png?ex=690c3cb5&is=690aeb35&hm=f8b90d90b3924eacbd50faa4c6dae0024b26f3887d914b5fa2683ff013aea1d7&)
Archived author: Foe • Posted: 2022-05-16T18:15:04.517000+00:00
Original source
Classes, A and B could all be in different files respectively
Archived author: Foe • Posted: 2022-05-16T18:15:42.799000+00:00
Original source
That wouldn't pollute the global namespace at least with a ton of objects