No announcement yet.

[CODING]Basic UnrealScript question.

  • Filter
  • Time
  • Show
Clear All
new posts

    [CODING]Basic UnrealScript question.

    Hello all. I need to make a placeable actor with some specific set of properties, I will explain it the best way I can.

    I have an actor "A" that is not placeable (I can make it placeable but it's really not needed in the level).
    This actor "A" has a static array of strings that is pretty long.

    Then I make an Actor "B"

    This Actor "B" is the placeable one.

    I need to make an array of strings in actor "B", that can be selected from the array of actor "A"

    what does this mean?

    I place Actor "B" in my level, and then in the dropdown list of Actor Properties I click "Add" Couple of times and a new line appears everytime (Mystring)

    Then I want to populate each of these lines with a string, but NOT write it manually in the field, but rather SELECT it from a drop down list, that is populated with strings from the static array of Actor "A".

    I have seen such a thing with readily made placeable Actors, but they were using Class limitors , and not arrays or anything similar. For example a Actor that allows you to add an array of specific classes.)

    Thanx in advance for all who are about to give me solutions on how to implement this.

    If you don't want to write code, don't worry, just explain it with words, I will try to do it on my own).

    Found a photo that kinda explains what I want to do:

    I need to make the placeable actor B look like that, and the array of strings (similar to what is seen in this screenshot) needs to be taken from an already defined static array of strings from class A.


      Hi, I see no one has replied, but I need to asko another thing and don't want to start another thread:

      I want to round an int number to 0~5.

      Meaning if I have 1253 I need to round this to 0 and get 1250.

      And if I have 1257, I need to round trhis to "5" and get 1255.

      Basically I need to input an int and the last number of my int must be either 0 or 5.

      I have really no idea how to achieve this. I tried ceil, Clamp, Max, Min but nothing worked.....

      Edit I did it on my own by converting my int to float, then dividing by 10, then using this:

      function MyRoundedNumber(float number)
      return int(number + 0.5);

      And then multiplied by 10
      And I got my desired result!!

      If you have your way of doing it plase share!!
      Last edited by Deggenyr; 07-25-2018, 02:56 PM.