• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Function Idea

Status
Not open for further replies.

CTM

CTM

Level 2
Joined
Nov 6, 2004
Messages
7
Hi,

I've been using JASS for bits of scripts from time to time but I mostly program in PHP. I was wondering if anyone would mind doing a in_array() function like the PHP one...it'd be really helpful :)

Reference for the PHP function : http://www.php.net/manual/en/function.in-array.php

Thanks to anyone who tries to do this :D
 
Level 3
Joined
Mar 27, 2004
Messages
70
It can't really be done since functions can't take arrays as parameters.
However, there are a couple of "object" array systems out there that uses an integer as identifier and the gamecache to store the data in the array.
When I need a dynamic array I use the list utility (found here).
Instead of an in_array function I made a ListFind function which covers the use of an in_array function.
 

CTM

CTM

Level 2
Joined
Nov 6, 2004
Messages
7
Thanks Kat :)

It does seem kinda big just this little part ( no, I didn't add the WP system, I'm not that stupid :p ). But it works and it's optimized, so who cares :p


Thanks again :D

( God I wish we could just edit the C++ )
 
Status
Not open for further replies.
Top