
Gamma927
Joined: Jun 12, 2008
Steam: gamma927
|
Posted: Oct 9, 2010 12:50 PM
Msg. 1 of 15
From the HSCB:
# cross The cross character is used to introduce a special interpretation of the subsequent expression. Here are several examples:
#(1 2 3) Creates a vector (array) from a list of elements.
Dunno if arrays work with variables though.
On a side note, I also don't know how to refer to a certain element from an array. Edited by Gamma927 on Oct 9, 2010 at 12:51 PM
|
|
|

SlappyThePirate
Joined: Aug 24, 2009
You are irritating, I'll release nothing
|
Posted: Oct 9, 2010 02:00 PM
Msg. 2 of 15
Dunno if you can just put a value in there... (global short variable1 1) (global short variable2 2) (global short variable3 3) (global short VARIABLE_NUMBER 0) (global short FINALANSWER 0)
(script static short variables (if (= VARIABLE_NUMBER 1) (set FINALANSWER variable1) ) (if (= VARIABLE_NUMBER 2) (set FINALANSWER variable2) ) (if (= VARIABLE_NUMBER 3) (set FINALANSWER variable3) )
(FINALANSWER)
) I guess this would work. Because if you can do this... (script static unit player0 (unit (list_get (players) 0)) ) ... to return a unit, you should be able to do this... (script static short variables (FINALANSWER);;which is a short )
...to get a short. oh please dont let me be wrong
|
|
|

MoooseGuy
Joined: Aug 10, 2008
I Approve This Message.
|
Posted: Oct 9, 2010 02:45 PM
Msg. 3 of 15
Wow, um, I thought I knew a bit of scripting, until I read this. 0_0 Is there a Google Translate for this?
|
|
|

d4rfnader
Joined: Jul 16, 2010
Open mouth, insert sandwhich.
|
Posted: Oct 9, 2010 03:01 PM
Msg. 4 of 15
lol, once you get the hang of scripting variables aren't that hard to understand.
|
|
|

SlappyThePirate
Joined: Aug 24, 2009
You are irritating, I'll release nothing
|
Posted: Oct 9, 2010 10:18 PM
Msg. 5 of 15
Maybe. How about I test it for you tomorrow? I <3 scripts.
|
|
|

AGLion
Joined: Jun 29, 2010
- Animator... suck it -
|
Posted: Oct 9, 2010 10:42 PM
Msg. 6 of 15
I hate learning new computer languages. I mean, it took me long enough to learn maxscript.
just had to get that off my chest Edited by AGLion on Oct 9, 2010 at 10:42 PM
|
|
|

Gamma927
Joined: Jun 12, 2008
Steam: gamma927
|
Posted: Oct 9, 2010 11:25 PM
Msg. 7 of 15
They're virtually the same lexically. It's just a difference in formatting and reserved words.
|
|
|

Dwood
Joined: Oct 23, 2007
Judge Ye Therefore
|
Posted: Oct 10, 2010 01:48 AM
Msg. 8 of 15
As a note, Halo script does not support arrays... you're going to have to order each in a different manner GRUNTS. Edited by Dwood on Oct 10, 2010 at 01:49 AM
|
|
|

SlappyThePirate
Joined: Aug 24, 2009
You are irritating, I'll release nothing
|
Posted: Oct 10, 2010 11:31 AM
Msg. 9 of 15
Tada! Works. You can test it, but make sure you have a button named weaponbutton, and the sound file for health pack. (global short variable1 1) (global short variable2 2) (global short variable3 3) (global short VARIABLE_NUMBER 2) (global short FINALANSWER 0)
(script static short variables (if (= VARIABLE_NUMBER 1) (set FINALANSWER variable1) ) (if (= VARIABLE_NUMBER 2) (set FINALANSWER variable2) ) (if (= VARIABLE_NUMBER 3) (set FINALANSWER variable3) )
FINALANSWER )
(script dormant weaponbutton (if (= (variables) 1) (sound_impulse_start sound\sfx\ui\pickup_health "none" 1) ) (if (= (variables) 2) (begin (sound_impulse_start sound\sfx\ui\pickup_health "none" 1) (sleep 20) (sound_impulse_start sound\sfx\ui\pickup_health "none" 1) ) ) (if (= (variables) 3) (begin (sound_impulse_start sound\sfx\ui\pickup_health "none" 1) (sleep 20) (sound_impulse_start sound\sfx\ui\pickup_health "none" 1) (sleep 20) (sound_impulse_start sound\sfx\ui\pickup_health "none" 1) ) ) )
|
|
|

SlappyThePirate
Joined: Aug 24, 2009
You are irritating, I'll release nothing
|
Posted: Oct 10, 2010 01:10 PM
Msg. 10 of 15
I think I get it now. So, the problem is there's no way to increment variable names (or volume names or vehicle names) without having to do all that script? Because I've had the same problem with backpack weapons as scenery. The only was was to use a whole lot of ifs (like you have there) to increment the strings. There should be a command for converting numbers to strings (e.g. 3 --> "3")
|
|
|

Dwood
Joined: Oct 23, 2007
Judge Ye Therefore
|
Posted: Oct 11, 2010 02:56 AM
Msg. 11 of 15
You are explaining what you want to to Grunts, but what is the final effect of what you want to do in game? (don't mention anything technical, what's the user going to see?)
|
|
|

SlappyThePirate
Joined: Aug 24, 2009
You are irritating, I'll release nothing
|
Posted: Oct 11, 2010 09:28 AM
Msg. 12 of 15
Either syncing or vehicle teleport, by the look of it. Hog doesn't necessarily mean hog. But it probably does.
|
|
|

SlappyThePirate
Joined: Aug 24, 2009
You are irritating, I'll release nothing
|
Posted: Oct 11, 2010 12:59 PM
Msg. 13 of 15
What if two hogs are the same digit? (12344) Then you'd need something to control where to place each hog in the trigger volumes. Unless each volume is a room and the teleport in near the ceiling.
|
|
|

SlappyThePirate
Joined: Aug 24, 2009
You are irritating, I'll release nothing
|
Posted: Oct 11, 2010 03:08 PM
Msg. 14 of 15
Quote: --- Original message by: Dwood You are explaining what you want to to Grunts, but what is the final effect of what you want to do in game? (don't mention anything technical, what's the user going to see?) Still didn't answer this ^ hehe
|
|
|

Dwood
Joined: Oct 23, 2007
Judge Ye Therefore
|
Posted: Oct 11, 2010 06:49 PM
Msg. 15 of 15
Quote: --- Original message by: Dwood You are explaining what you want to do Grunts, but what is the final effect of what you want to do in game? (don't mention anything technical, what's the user going to see?) What does the player see?
|
|
|