Jump to content

Forums Announcement

Read-Only Mode for Announcements & Changelogs

Dear Survivors, we'd like to inform you that this forum will transition to read-only mode. From now on, it will serve exclusively as a platform for official announcements and changelogs.

For all community discussions, debates, and engagement, we encourage you to join us on our social media platforms: Discord, Twitter/X, Facebook.

Thank you for being a valued part of our community. We look forward to connecting with you on our other channels!

Stay safe out there,
Your DayZ Team

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

×