Moderators: They make you lose count(Longest thread still alive!)

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Someone Else 37

Forum Addict
Feb 10, 2013
1,876
1,440
168
7 these are great lens
Great indeed. A bit of funky grammar, but meh.

I did some testing in DF. Vampires can see where living creatures with blood are located, as long as they're near enough, regardless of ambient light conditions (i.e. reduced visibility underground or at night) or there being walls in the way; when playing as a vampire, they show up as little red circles sitting outside your field of view. Creatures with omnivision, on the other hand, can see equally well in all directions (so there's no sneaking up behind them) and do not need functioning eyes to do so, although they are still subject to the same visibility conditions as normal creatures (so they can't see much at all at night).

I don't know if there's any tag that allows creatures to not need light to see, so they won't care about the time of day at all.
 

erindalc

Popular Member
Mar 3, 2015
992
512
109
Steam
13

You forgot a number SE

And my guess is the grammar is something to do with the fact that lens is Dutch? (Correct me if I'm wrong)
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
19 so.....I finally made it so that cards can be effected by local effects (global effects are not yet tested).
However I taught of a nice problem that may very well occur.
Currently effects that will trigger other effects (which may or may not trigger other effects), will break everything and their dogs >_<
The reason is because I currently store the effect that is being executed in the card_interpreter object (to get around php being annoying), these values will get overwritten as soon as another effect gets executed (which also happens when effects chain together).

I know how to work around it, make an array that contains a list and let each time an effect gets executed add the needed data to this array. I do fear it will get messy very fast though and remove it from the list when it is done. That way the last entry in the list is the effect that is currently being executed (which also means I can have access to the parent effect of the effect that trigged the last effect in the list)

I won't change my code yet as implementing that will be a bitch I fear >_<
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
21 well, then you need to use nodejs and js has a whole bunch of other problems.
 

Someone Else 37

Forum Addict
Feb 10, 2013
1,876
1,440
168
25
19 so.....I finally made it so that cards can be effected by local effects (global effects are not yet tested).
However I taught of a nice problem that may very well occur.
Currently effects that will trigger other effects (which may or may not trigger other effects), will break everything and their dogs >_<
The reason is because I currently store the effect that is being executed in the card_interpreter object (to get around php being annoying), these values will get overwritten as soon as another effect gets executed (which also happens when effects chain together).

I know how to work around it, make an array that contains a list and let each time an effect gets executed add the needed data to this array. I do fear it will get messy very fast though and remove it from the list when it is done. That way the last entry in the list is the effect that is currently being executed (which also means I can have access to the parent effect of the effect that trigged the last effect in the list)

I won't change my code yet as implementing that will be a bitch I fear >_<
You need a stack. That's basically what you're describing with the array thing, but if PHP has a built-in stack library, that'd simplify things.

Whenever something triggers or is cast, push it onto the stack. When it resolves, pop it back off.
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
26
25
You need a stack. That's basically what you're describing with the array thing, but if PHP has a built-in stack library, that'd simplify things.

Whenever something triggers or is cast, push it onto the stack. When it resolves, pop it back off.
Unless I am missing something php only has arrays and objects as things that can store multiple kinds of data. However php is very nice and if you do the following
PHP:
$someArray=array("test","test2","test3");
unset($someArray[1]);//remove the second entry
echo $someArray[1]); //will crash due to the fact that it isn't set, in other words php doesn't automatically shift values, unlike some other languages.

Adding things to the end of an array is easy just write $someArray[]="someValue". Its the getting the last one in the array that I am not sure about (Thus without using count() ). Then again, php even has a function build in to flip a string thus I am sure there is a way to get the last value in an array without using count :p
 

Someone Else 37

Forum Addict
Feb 10, 2013
1,876
1,440
168
27
26

Unless I am missing something php only has arrays and objects as things that can store multiple kinds of data. However php is very nice and if you do the following
PHP:
$someArray=array("test","test2","test3");
unset($someArray[1]);//remove the second entry
echo $someArray[1]); //will crash due to the fact that it isn't set, in other words php doesn't automatically shift values, unlike some other languages.

Adding things to the end of an array is easy just write $someArray[]="someValue". Its the getting the last one in the array that I am not sure about (Thus without using count() ). Then again, php even has a function build in to flip a string thus I am sure there is a way to get the last value in an array without using count :p
How object-oriented is PHP? If you can do the same kinds of things that you do in Java, then you could define your own Stack class with the following fields and methods (I'm using Java type declaration syntax here because it's what I'm familiar with):
  • private Object[] array //Stores the elements in the stack; starts off empty or full of nulls or something like that
  • private int size //The number of elements in the array; initialized to zero
  • public void push(Object o) //Adds the object to the end of the array (i.e. array[size] = o) and increments size
  • public Object peek() //Returns the object at the end of the array (size - 1) without modifying anything
  • public Object pop() //Decrements size, then removes the element at the end of the array and returns it
It looks like PHP arrays dynamically change their size as needed, which would make implementing this even easier than in something like Java. Assuming that doing so is even possible, of course.