Some table issues adjusting object speeds at random...

I have 3 item spawners that spit out actors, these actors come out at a starting speed of 100. I am using the move behavior to do this. I have an at a speed of: game.DrinkSpeed.

I have a table setup with 1 row and 4 columns. They are all using integers and they go in the following order 100, 150, 200, 250. Now I want to pass those values off at random to game.DrinkSpeed.

So I setup a change attribute that statues when my actor overlaps or collides with one of these drinks. Spawn another one and change its speed. My change attribute looks like this: set: game.DrinkSpeed to random(1,tableColCount(game.T_DrinkSpeeds))

It will spawn another one but they seem to move at the speed of one of those Comcast turtles. Looks like if I was to set the move speed to about 10.

Comments

  • ericzingelerericzingeler Member Posts: 334
    edited June 2013
    ChangeAttribute game.DrinkSpeed
    to
    tableCellValue(table.DrinkSpeeds, 1, random(1, tableColCount(tableDrinkSpeeds)))

    Give that a whirl.
  • UberAirshipUberAirship Member Posts: 10
    Yeah that did the trick. So let me see if I got this straight.

    That code is telling my drink speed table so look at row 1 then randomly pick from the columns.

    I was just pretty much missing the part telling it to look at a row. So when I do something like this again I need to make sure I am putting in a table check for a row and a column.
  • ericzingelerericzingeler Member Posts: 334
    Correct!

    Change attribute to a table cell value > of some table > at row number 1 > at column number random 1 to column count of some table.

    Just follow that puppy all they way through.
  • UberAirshipUberAirship Member Posts: 10
    Cool thanks again, coming from using the Unreal Engine this code in GS really mind F's me haha.
Sign In or Register to comment.