A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE General Discussion »Hud Scripting Issue

Author Topic: Hud Scripting Issue (9 messages, Page 1 of 1)
Moderators: Dennis

Alexis
Joined: Nov 22, 2010


Posted: Feb 14, 2013 11:19 PM    Msg. 1 of 9       
So,
I am working on a 3D hud that bobs around as you walk. I have all elements working except for the grenade elements.

This is what I am trying to use

(global short rawwwwr 0)

(script static unit player
(begin
(unit (list_get (players) 0))))

(script continuous void number
(begin
(unit_set_current_vitality number
(*
(unit_get_health number) 99.00)
(unit_get_total_grenade_count number))
(set number
(+ number 1.00))
(if
(= number 16)
(set number 0))))


I can't seem to get passed a the error

"[line 7] the value of this expression (in a <void> slot) can never be used.: number."

When I remove "void" Sapien claims that "number" is not a valid object.

I am pretty new to scripting, so I am sure I am overlooking something.

Any help would be appreciated, Thanks!!


MoooseGuy
Joined: Aug 10, 2008

I Approve This Message.


Posted: Feb 14, 2013 11:22 PM    Msg. 2 of 9       
I see you have a script name and a reference named the same thing.

(script continuous void number
and
(unit_set_current_vitality number

...are both named "number".

Try renaming your continuous script to something else, and tell us if it works.


Alexis
Joined: Nov 22, 2010


Posted: Feb 14, 2013 11:33 PM    Msg. 3 of 9       
Quote: --- Original message by: MoooseGuy
I see you have a script name and a reference named the same thing.

(script continuous void number
and
(unit_set_current_vitality number

...are both named "number".

Try renaming your continuous script to something else, and tell us if it works.


No dice!

In fact, I think I may have borked that entire script. Here is my new one, but I still get the "void" issue as above

(global short number 0)

(script static unit player
(begin
(unit
(list_get
(players) number))))

(script continuous void rawwwwr
(begin
(unit_set_current_vitality rawwwwr
(*
(unit_get_health rawwwwr) 99.00)
(unit_get_total_grenade_count rawwwwr))
(set number
(+ number 1.00))
(if
(= number 16)
(set number 0))))


When I remove "void" I get the same "rawwwwr" is not a valid object.


MoooseGuy
Joined: Aug 10, 2008

I Approve This Message.


Posted: Feb 15, 2013 12:42 AM    Msg. 4 of 9       
Your script name needs to be named something different than your object reference.

Both things cannot be rawwwwr.

(script continuous void aieeeeee
(begin
(unit_set_current_vitality rawwwwr
(*
(unit_get_health rawwwwr) 99.00)
(unit_get_total_grenade_count rawwwwr))
(set number
(+ number 1.00))
(if
(= number 16)
(set number 0))))


kornman00
Joined: Jul 15, 2010


Posted: Feb 15, 2013 03:56 AM    Msg. 5 of 9       
1) remove the (begin) expressions from the start of your scripts, it's redundant
2) Only static/stub scripts can have return types. so change it to "(script continuous number"


Alexis
Joined: Nov 22, 2010


Posted: Feb 15, 2013 10:36 AM    Msg. 6 of 9       
Quote: --- Original message by: MoooseGuy
Your script name needs to be named something different than your object reference.

Both things cannot be rawwwwr.

(script continuous void aieeeeee
(begin
(unit_set_current_vitality rawwwwr
(*
(unit_get_health rawwwwr) 99.00)
(unit_get_total_grenade_count rawwwwr))
(set number
(+ number 1.00))
(if
(= number 16)
(set number 0))))


When I change the name, I still get 'rawwwwr' is not a valid object

Quote: --- Original message by: kornman00
1) remove the (begin) expressions from the start of your scripts, it's redundant
2) Only static/stub scripts can have return types. so change it to "(script continuous number"


Before I try this... are you referencing the first script I posted, or the second?


HaloExtreme117
Joined: May 5, 2012

~Gone~


Posted: Feb 15, 2013 11:03 AM    Msg. 7 of 9       
Quote: --- Original message by: Alexis
Quote: --- Original message by: MoooseGuy
Your script name needs to be named something different than your object reference.

Both things cannot be rawwwwr.

(script continuous void aieeeeee
(begin
(unit_set_current_vitality rawwwwr
(*
(unit_get_health rawwwwr) 99.00)
(unit_get_total_grenade_count rawwwwr))
(set number
(+ number 1.00))
(if
(= number 16)
(set number 0))))


When I change the name, I still get 'rawwwwr' is not a valid object

Quote: --- Original message by: kornman00
1) remove the (begin) expressions from the start of your scripts, it's redundant
2) Only static/stub scripts can have return types. so change it to "(script continuous number"


Before I try this... are you referencing the first script I posted, or the second?

He's referencing both. You have unneeded (begin)'s and return types in both.


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Feb 15, 2013 11:25 AM    Msg. 8 of 9       
(global short number 0)
(script static unit player (unit (list_get (players) NUMBER)))

(script continuous grenade_display
(unit_set_current_vitality (player) (* (unit_get_health (player)) 99) (unit_get_total_grenade_count (player)))
(if (< number player_spawn_count) (set number (+ number 1)) (set number 0))
)

NOTE: that 99 that ive highlighted in red, thats the amount of health the biped has. (Which map even had an old copy of the script? Its obviously been changed since I last saw it, since the health in mt backups was 198, and the continuous script had a paragraph long name which wouldnt of compiled lol. I also dont think there was any public maps released that had it in use.. I had thought they just decided to have it as a static element in the end *shrug*)
Please note, that this uses your shields to display the grenades.


Alexis
Joined: Nov 22, 2010


Posted: Feb 15, 2013 12:26 PM    Msg. 9 of 9       
Quote: --- Original message by: kirby_422
(global short number 0)
(script static unit player (unit (list_get (players) NUMBER)))

(script continuous grenade_display
(unit_set_current_vitality (player) (* (unit_get_health (player)) 99) (unit_get_total_grenade_count (player)))
(if (< number player_spawn_count) (set number (+ number 1)) (set number 0))
)

NOTE: that 99 that ive highlighted in red, thats the amount of health the biped has. (Which map even had an old copy of the script? Its obviously been changed since I last saw it, since the health in mt backups was 198, and the continuous script had a paragraph long name which wouldnt of compiled lol. I also dont think there was any public maps released that had it in use.. I had thought they just decided to have it as a static element in the end *shrug*)
Please note, that this uses your shields to display the grenades.


I was given a .yelo from the old lead, but he didn't have any of his source scripts so I extracted them from there.
I am aware of how the script is intended to work, I just couldn't get the old one to work, haha.

Thanks For your help Kirby, that works perfectly!

and Thanks to everyone else as well!!!
Edited by Alexis on Feb 15, 2013 at 12:29 PM
Edited by Alexis on Feb 15, 2013 at 06:08 PM

 

 
Previous Older Thread    Next newer Thread







Time: Tue September 17, 2019 4:04 PM 422 ms.
A Halo Maps Website