arrays

  • Thread starter Thread starter Unregistered
  • Start date Start date
U

Unregistered

Guest
ok im kinda annoyed about that i have to create 6 different variables to make stuff works, but then i heard u can use arrays so u only need one variable, so the questions is:

-is the array thing true
-how does it work

<<cool>>
 
Go into your variable editor, and create a new variable of any type. Check the "Array" box.

Then set it up like this....

( Using variable Attacking_Units, type UNIT, array. )

Set Attacking_Units[1]="Footman"
Set Attacking_Units[2]="Knight"
Set Attacking_Units[3]="Rifleman"
Set Attacking_Units[4]="Archer"

Then you can manipulate it like this....

For each Integer A in 1 thru 4, do
Create unit ( Attacking_Units[A] ) at center of ( playable map area)
 
(me again) well i dont get that trigger for each intigner A thing, but can u write how to put the array thing in, i want to make a diolog to each player in my game without using 6 different. can u tell me how to do that plz..

me
 
(ive got an account now:D) i just thought of: when u check that field where the array box is it ask for the ´size, what does that do..

team diolog
Events
Time - Elapsed game time is 11.00 seconds
Conditions
Actions
Dialog - Change the title of creditsdioloh to |cffffcc00TEAM?|r
-------- credits --------
Dialog - Create a dialog button for teamchoosing labelled Soviet
Set soviet = (Last created dialog Button)
Dialog - Create a dialog button for teamchoosing labelled Allied
Set allies = (Last created dialog Button)
-------- misc --------
Dialog - Show teamchoosing[1] for Player 1 (Red)
Dialog - Show teamchoosing[2] for Player 2 (Blue)
Dialog - Show teamchoosing[3] for Player 3 (Teal)
Dialog - Show teamchoosing[4] for Player 4 (Purple
Dialog - Show teamchoosing[5] for Player 5 (Yellow)
Dialog - Show teamchoosing[6] for Player 6 (Orange)
Game - Display to (All players) for 5.00 seconds the text:...

will that work???
 
ALMOST. Size is how many. But you can leave it blank.

You need to say something like this....

Player group - pick all players in (all players) and do action
-Dialog - Create a dialog button for teamchoosing[Player number(picked player)] labelled Soviet
-Set soviet[player number(Picked Player)] = (Last created dialog Button)

I don't know how your map works, but you might releive a LOT of stress if you set up the teams to be forces, under player properties. So in the game room

Soviet Powers
Player 1
Player 2
Etc.

Allied Powers
Player 3
Player 4
Etc.

Or somethin'.


Originally posted by zozoR
(ive got an account now:D) i just thought of: when u check that field where the array box is it ask for the ´size, what does that do..

team diolog
Events
Time - Elapsed game time is 11.00 seconds
Conditions
Actions
Dialog - Change the title of creditsdioloh to |cffffcc00TEAM?|r
-------- credits --------
Dialog - Create a dialog button for teamchoosing labelled Soviet
Set soviet = (Last created dialog Button)
Dialog - Create a dialog button for teamchoosing labelled Allied
Set allies = (Last created dialog Button)
-------- misc --------
Dialog - Show teamchoosing[1] for Player 1 (Red)
Dialog - Show teamchoosing[2] for Player 2 (Blue)
Dialog - Show teamchoosing[3] for Player 3 (Teal)
Dialog - Show teamchoosing[4] for Player 4 (Purple
Dialog - Show teamchoosing[5] for Player 5 (Yellow)
Dialog - Show teamchoosing[6] for Player 6 (Orange)
Game - Display to (All players) for 5.00 seconds the text:...

will that work???
 
u got a point

if u mean i should give up making a dialog so u can choose team(im making a red alert based map), u r damn right, because i dont get anything of that array shit, that pretty sux, but if u can find a array turtorial or somthing like that it will be cool:D
 
...

now i got a new problem that i think many have experience

wenn i try to build a structure (summon it) it just stops as soon as its starts building, dos it count when u copy the unit from another shoulnt it being a new unit (i have changed som art)???



:(
 
LOL I had that problem too.

The reason is, your building is human, right? And the builder cannot make it. So it puts it down, but it doesn't do anything.

Fine to use human buildings. Make a custom builder unit.

1 Copy the unit
2 Strip ALL abilities
3 Make the race undead (cuz they don't have to stand beside the building)
4 Add classifcation - WORKER to the unit.

Should work fine now.
 
this trigger i will use arrays (because i will learn it!!!). a unit is trained and will enter the map and then i will add it to a unit groupe, but the place where there is standing [index] (add unit to units[index] (<--- my unit groups)) can just write 1,2,3,4 etc. in the [index] box. look below for more info.. and thx.



Events
Unit - A unit enters (Entire map)
Conditions
Actions
If ((Owner of (Triggering unit)) Equal to Player 1 (Red)) then do (Unit Group - Add (Triggering unit) to units[1]) else do (Do nothing)
If ((Owner of (Triggering unit)) Equal to Player 2 (Blue)) then do (Unit Group - Add (Triggering unit) to units[2]) else do (Do nothing)
If ((Owner of (Triggering unit)) Equal to Player 3 (Teal)) then do (Unit Group - Add (Triggering unit) to units[3]) else do (Do nothing)
If ((Owner of (Triggering unit)) Equal to Player 4 (Purple)) then do (Unit Group - Add (Triggering unit) to units[4]) else do (Do nothing)
If ((Owner of (Triggering unit)) Equal to Player 5 (Yellow)) then do (Unit Group - Add (Triggering unit) to units[5]) else do (Do nothing)
If ((Owner of (Triggering unit)) Equal to Player 6 (Orange)) then do (Unit Group - Add (Triggering unit) to units[6]) else do (Do nothing)
 
Hey Hey - You got it! But lets make it more effecient, k?

Events
Unit - A unit enters (Entire map)
Conditions
Actions
Unit Group - Add (Triggering unit) to units[(player number(owner of(triggering unit))]

Don't forget to remove it from the unit group if it dies.

[edit] Heres some more examples from my map.

Kill_Count[] = integer tallying kills for my TD
Gold_Won[] = keeps tabs on gold won last mini game round
Total_Gold_Won[] = tallies gold won in mini games
Player_Colors[] = array of color codes for appropriate players, set at runtime
Creep_List[] = array contains all my attackers, for my level loops (30)
 
i didnt get much of ur exampel =S. but it worked (i have tjecked my map for it), but can u do it the [1] [2] [3] [4] etc. with all the arrays?

new question (i got a lot, eh?): is there a way to order a unit to use a costum abbilaty or can i change those: "warchiefe- chain ligthning" stuff that are thos in the order trigger, would it make a differance if i changed them in the abbilaty editor?
 
Yes you can do [1] [2] [3] etc.

THIS LINE
Unit Group - Add (Triggering unit) to units[(player number(owner of(triggering unit))]

Does that. Just more effeciently. In one line. It will put the [1][2] in there FOR ya.

Now for the abilities....
You always make an ability from one that already exists, right?
So it has a line that looks (something) like this:

"Text - Order String - Turn on"

Whatever that ability / order string is, is what you will tell the trigger to do. If you changed AVATAR, your gonna tell it to AVATAR.

Originally posted by zozoR
new question (i got a lot, eh?): is there a way to order a unit to use a costum abbilaty or can i change those: "warchiefe- chain ligthning" stuff that are thos in the order trigger, would it make a differance if i changed them in the abbilaty editor?
 
i got the array thiing now, but that trigger action = For each Integer A in 1 thru 4, do. what teh hell is a?? 0? 8? because.. because i wanna know:D :)
 
and uuuh.

i have heard of somthing called a multiboard so i just wanted to ask:

1) what is a multibaord exacly
2)how does it work
3)i've heard that it screws up the game if u o it wrong
4) is it better than a normal leaderbaord???
 
Lets try this.
Variable Fruits, type string, array.

Code:
Set Fruits[1] = "Apples"
Set Fruits[2] = "Oranges"
Set Fruits[3] = "Pears"
Set Fruits[4] = "Bananas"

For integer A from 1 through 4 , do actions
 Loop Actions
  Game display to all players (Fruits[Integer A])

Will Display....

Apples
Oranges
Pears
Bananas

Originally posted by zozoR
i got the array thiing now, but that trigger action = For each Integer A in 1 thru 4, do. what teh hell is a?? 0? 8? because.. because i wanna know:D :)
 
soooooooo

so the "A" in it is standing for array?

so can u say it like this (its not the code only what it means) :

------------------------------------------------------------------------------------
For integer Array([1][2][3]) from 1 through 3 , do actions
Loop Actions
Game display to all players (Fruits[Integer Array])

------------------------------------------------------------------------------------

so its just going though all the array indexes, and for this matter saying them in a row?
 
No. A is a temporary variable.

When you say, "for integer A equals 1 to 5" It means:

Do these actions once using A=1
Do these actions again, this time A=2
Do these actions again, this time A=3
Do these actions again, this time A=4
Do these actions again, this time A=5

So you can use 'Integer A" throughout the loop. You can also do 5 thru 10. or 30 thru 33. It doesn't matta. In my example, I used 1 thru 5.
Have a look ONE MORE time... notice what I change?
Code:
Set Fruits[1] = "Apples"
Set Fruits[2] = "Oranges"
Set Fruits[3] = "Pears"
Set Fruits[4] = "Bananas"

For integer A from 3 through 4 , do actions
 Loop Actions
  Game display to all players (Fruits[Integer A])
It will display
Pears
Bananas

"so its just going though all the array indexes, and for this matter saying them in a row?"

Yes it is. Its going through the loop and hitting each one ;)
 
One last example

If we have a variable called Spawn_Regions, which is a region, and an array, we can do something like this.

set Spawn_Regions[1] = This region
set Spawn_Regions[2] = That region
set Spawn_Regions[3] = Some region
set Spawn_Regions[4] = Whatever region

Code:
For integer A equals 1 to 4
 Loop actions
  create 1 footman at the center of (Spawn_Regions[Integer A]) for player 1 facing (random angle)

It will create a unit in each region.

Code:
For integer A equals 2 to 3
 Loop actions
  create 1 footman at the center of (Spawn_Regions[Integer A]) for player 1 facing (random angle)

It will create a unit in "That region" and "Some region"
 
ur fruit example got me confused because i thought that it was diplaying them all at ones.

well i dont think i need to know anyway, but i get it.

but what with those multi boards (questions are in another replay i lay before the intigner A thing...)
 
Re: and uuuh.

1. Multiboard does more than a leaderboard, but looks similar.
2. A multiboard is a table like in excel. You get rows and columns to work with.
3. Yup it seems so.
4. A multiboard can show icons and text as well, and also be minimized, so it is far superior.

Please see this post concerning multiboards. There is also a simple one I did attached within that post.

http://www.thehelper.net/forums/showthread.php?s=&threadid=10495&highlight=MULTIBOARD

Originally posted by zozoR
i have heard of somthing called a multiboard so i just wanted to ask:

1) what is a multibaord exacly
2)how does it work
3)i've heard that it screws up the game if u o it wrong
4) is it better than a normal leaderbaord???
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    we were down for a minute - think a log file or something got too big
    +1
  • Ghan Ghan:
    The alerts say it was down for a while unfortunately.
  • Ghan Ghan:
    Didn't know what was going on while I was at work.
  • Ghan Ghan:
    Disk filled up with logs. Fixed now.
    +1
  • The Helper The Helper:
    not a problem at all thanks for getting us back up
  • The Helper The Helper:
    I think the bots are finding a way to get through the anubis
  • The Helper The Helper:
    Happy Wednesday Everyone! Hope everyone has a Fantastic Day!
    +1
  • The Helper The Helper:
    Yeah, stats are showing big bot influx like 12k page views.
  • Wizard Wizard:
    :wave:
    +1
  • Ghan Ghan:
    TH changed his avatar again. 6 more weeks of summer.
    +3
  • Wizard Wizard:
    lol
    +1
  • The Helper The Helper:
    Guys just a heads up I am going to be shutting the site down soon. I am just waiting on the NUON people to decide whether they want to transfer forum data and keep the discord. My email is [email protected] for anyone that wants to keep in touch and I have a facebook too. I will make an official post later. Love you guys and will miss everyone!
    +1
  • V-SNES V-SNES:
    Sent a pm @The Helper
  • Stephen Stephen:
    Oh no - please don't lose the Nuon content
    +1
  • The Helper The Helper:
    Someone email AtariAge and see if they want me to transfer the forum data over to it
  • Ghan Ghan:
    Could probably keep NUON stuff around here if we wanted.
  • Ghan Ghan:
    Hmm what to do about the World Editor site though?
  • Stephen Stephen:
    I'd rather personally just own a backup of the Nuon data than see it go to AtariAge honestly. If it gets enshittified as per usual, or if some of the "regular" Jaguar folks get there, it's not gonna be fun
  • The Helper The Helper:
    There will be a github of the forum data so the NUON Forum Data I guess would be available there
  • The Helper The Helper:
    World Editor is technically Ryoko stuff not mine you guys can keep that I am not in that even
  • jonas jonas:
    :( end of an era :(
  • The Helper The Helper:
    Dont think of it as an end jonas - think of it as a beginning, because really my friend that is what it is.
  • The Helper The Helper:
    Also, anyone who is reading this and is sad - don't be, turn off the Internet, step away from the box - enjoy your life - there is so much more out there for you than there is here for you.

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top