Jump to content
Mizev

Does not assign to parameters array!

Recommended Posts

I'm trying to assign an array element of type parameter:

 

array<Param> ListZone = new array<Param>;

Param2<vector,int> m_Zone;

m_Zone = new Param2<vector, int>("3000 0 9000", 15);

Print(m_Zone);

ListZone.Insert(m_Zone);

Print(ListZone.Get(0));

 

In the log:

 Param2<vector,int><94fb7990>
 NULL

What am I doing wrong?

 

p.s. sorry about my English.

Share this post


Link to post
Share on other sites
  ref array<ref Param> ListZone = new array<ref Param>;
  
  ref Param2<vector,int> m_Zone;
  
  m_Zone = new Param2<vector, int>("3000 0 9000", 15);
  
  Print(m_Zone);
  
  ListZone.Insert(m_Zone);
  
  Print(ListZone.Get(0));

 

This should work.

Share this post


Link to post
Share on other sites

I work a few hours trying different ways, but it didn't work. 

 

Share this post


Link to post
Share on other sites
56 minutes ago, Mizev said:

The problem is solved!

How did you solve it, in the case others run into a similar issue and find this thread?

Share this post


Link to post
Share on other sites
2 hours ago, smasht said:

How did you solve it, in the case others run into a similar issue and find this thread?

I gave a simplified listing of the script. 

1. The problem was different. I initialized the global variable in the wrong place.

2. As Jacob_Mango suggested, it is important to do so: ref array<ref Param> ListZone = new array<ref Param>;

 

 

  • Beans 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×