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 Technical / Map Design »Active Camo Through a Script?

Page 1 of 2 Go to page: · [1] · 2 · Next
Author Topic: Active Camo Through a Script? (48 messages, Page 1 of 2)
Moderators: Dennis

Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Dec 18, 2010 06:13 PM    Msg. 1 of 48       
So I need a little help, what I'm trying to do is replace the flashlight with active camo, sort of like halo 2. So when I hit the flashlight button I go invisible instead. I heard I can do this through a script but I'm not quite sure. Can anyone help? Thanks!
Edited by pepzee on Dec 18, 2010 at 06:13 PM


Muscl3r
Joined: May 22, 2010

dont pray 4 easy lives...pray to be STRONGER MEN


Posted: Dec 18, 2010 09:34 PM    Msg. 2 of 48       
Well i put this into my one of my missions and it worked once then next time i tried to compile the mission it corrupted itself and wouldn't let me compile until i removed the script:

(script continuous camo
(if (= (unit_get_current_flashlight_state (unit (list_get (players) 0))) 1)
(begin
(object_create_anew camo)
(objects_attach (list_get (players) 0) camo)
(objects_detach (list_get (players) 0) camo)))
(sleep 30)
(units_set_desired_flashlight_state (players) false)
)
)


you just need to create and active camo called camo somewhere the player can't get to and set it to not placed automatically

This isn't exactly h2 btw
Edited by Muscl3r on Dec 18, 2010 at 09:35 PM


rerout343
Joined: Aug 7, 2010

Targeted and Firing


Posted: Dec 18, 2010 10:29 PM    Msg. 3 of 48       
I don't have time to test it right now but to turn it on and off you could try something like:

(script continuous camo
(sleep_until (= (unit_get_current_flashlight_state (unit (list_get (players) 0))) 1)
(set cheat_active_camouflage 1)
(sleep_until (= (unit_get_current_flashlight_state (unit (list_get (players) 0))) 0)
(set cheat_active_camouflage 0)
)


This "should" work but like I said, I don't have time right now to test it and workout the bugs.
Edited by rerout343 on Dec 18, 2010 at 10:30 PM
Edited by rerout343 on Dec 18, 2010 at 10:31 PM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Dec 18, 2010 11:01 PM    Msg. 4 of 48       
I recall when I was doing an invisibility skull, that cheat_active_camouflage didn't work. Instead, I was forced to use cheat_active_camoflauge_local_player, or something like that, which cannot be turned off. Use Muscl3r's script.


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Dec 19, 2010 11:01 AM    Msg. 5 of 48       
Okay, so when I tried this it spawned an active camo in front of me. I would like it to where you automatically go invisible, not just spawn the power up. Any other ideas?


Muscl3r
Joined: May 22, 2010

dont pray 4 easy lives...pray to be STRONGER MEN


Posted: Dec 19, 2010 05:55 PM    Msg. 6 of 48       
It should have worked. It did for me


Skidrow925
Joined: Mar 19, 2010

"ideological sense of respect and tact of a 5yo"


Posted: Dec 19, 2010 06:31 PM    Msg. 7 of 48       
Just an FYI.

"cheat_active_camouflage" only turns on. It doesn't toggle.


SlappyThePirate
Joined: Aug 24, 2009

You are irritating, I'll release nothing


Posted: Dec 19, 2010 10:28 PM    Msg. 8 of 48       
Why don't people use search anymore? Every week, it seems, someone asks how to do this.
You're supposed to script the flashlight to attach a camo pickup to the player, then detach it, so the player picks it up.


Muscl3r
Joined: May 22, 2010

dont pray 4 easy lives...pray to be STRONGER MEN


Posted: Dec 19, 2010 11:19 PM    Msg. 9 of 48       
Exactly what my script does!


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Dec 20, 2010 11:18 AM    Msg. 10 of 48       
12.19.10 17:23:08 sapien pc 01.00.00.0609 ----------------------------------------------
12.19.10 17:23:08 reference function: _write_to_error_file
12.19.10 17:23:08 reference address: 401b13
12.19.10 17:23:08 Couldn't read map file './sapienbeta.map'
12.19.10 17:23:08 *found 2 adapters...
12.19.10 17:23:08 CreateDevice succeeded with refresh rate = 0
12.19.10 17:23:08 Increasing sound decompression buffer size to 1048576 bytes
12.19.10 17:23:10 WARNING: 11 clusters in structure_bsp levels\test\stgrove\stgrove have no background sound or sound environment.
12.19.10 17:23:10 local player 0, weapon (0x0), deleted unexpectedly
12.19.10 17:23:12 [camo line 5] the "objects_attach" call requires exactly 4 arguments.: (objects_attach (list_get (players) 0) camo)
12.19.10 17:23:12 recompiling scripts after scenarios were merged.
12.19.10 17:23:12 [camo line 3] this left parenthesis is unmatched.: (begin

I don't exactly know what this means:
12.19.10 17:23:12 [camo line 5] the "objects_attach" call requires exactly 4 arguments.:

Also, Slappy, post me a link to those other threads you're talking about. I'd love to see how they got answered.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Dec 20, 2010 02:03 PM    Msg. 11 of 48       
The issue is that the objects_attach parameter requires four arguments, whereas only two are specified.

To fix this, use:

(objects_attach (list_get (players) 0) "" camo "")

The logic is correct: the powerup method is the most efficient method. Of course, you're probably unsatisfied unless I give you an entire script, which is below:

(script continuous Cloak
(sleep_until (= (unit_get_current_flashlight_state (unit (list_get (players) 0))) true))
(object_create cloak)
(objects_attach (unit (list_get (players) 0)) "" cloak "")
(objects_detach (unit (list_get (players) 0)) cloak)
(sleep 1000)
(sleep_until (= (unit_get_current_flashlight_state (unit (list_get (players) 0))) false))
(sleep_until (= (unit_get_current_flashlight_state (unit (list_get (players) 0))) true))
(object_create cloak)
(objects_attach (unit (list_get (players) 0)) "" cloak "")
(objects_detach (unit (list_get (players) 0)) cloak)
(sleep 1000)
(sleep_until (= (unit_get_current_flashlight_state (unit (list_get (players) 0))) false))
)


Note that I named the powerup cloak instead of camo.
Edited by Gamma927 on Dec 20, 2010 at 02:04 PM


Muscl3r
Joined: May 22, 2010

dont pray 4 easy lives...pray to be STRONGER MEN


Posted: Dec 20, 2010 04:35 PM    Msg. 12 of 48       
In the first version of my script it would just keep spitting out active camo's if your flashlight was active. But enemies could see you anyway cos your flashlight was on. Also, to be more halo 2ish, set the camo to last about 7 seconds.


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Dec 21, 2010 12:04 AM    Msg. 13 of 48       
Hmm... that script worked in the weirdest way. The camouflage would wear out before the flashlight was dead and could be used constantly with no wait time in between uses.

@Muscl3r

How do I make the camo last only 7 seconds? I assume it's somewhere in guerilla, I just haven't found it yet.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Dec 21, 2010 12:15 AM    Msg. 14 of 48       
Use the script I posted. It requires a thousand tick wait before being able to invoke the camo script again.

As for making it last only seven seconds, open the .equipment tag in Guerilla, and scroll to the bottom. You'll find it.


Muscl3r
Joined: May 22, 2010

dont pray 4 easy lives...pray to be STRONGER MEN


Posted: Dec 21, 2010 01:25 AM    Msg. 15 of 48       
how long is 1000 ticks? Is 300 ten seconds?


Skidrow925
Joined: Mar 19, 2010

"ideological sense of respect and tact of a 5yo"


Posted: Dec 21, 2010 10:36 AM    Msg. 16 of 48       
Quote: --- Original message by: Muscl3r
how long is 1000 ticks? Is 300 ten seconds?

30 ticks = 1 second. SO 33 and 1 third seconds.


MoooseGuy
Joined: Aug 10, 2008

I Approve This Message.


Posted: Dec 21, 2010 12:58 PM    Msg. 17 of 48       
The easiest way to count numbers in a script is (* 30 SECONDS). Replace SECONDS with how many seconds you want.

I.E. (sleep (* 30 5))
Edited by MoooseGuy on Dec 21, 2010 at 12:59 PM


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Dec 21, 2010 03:23 PM    Msg. 18 of 48       
Quote: --- Original message by: Skidrow925
Quote: --- Original message by: Muscl3r
how long is 1000 ticks? Is 300 ten seconds?

30 ticks = 1 second. SO 33 and 1 third seconds.

Hmm... That's odd. I can just reuse it instantly over and over. I am using Gamma's script, very weird.

When does the timer start?

Once you use the camo or once the camo wears out?


Muscl3r
Joined: May 22, 2010

dont pray 4 easy lives...pray to be STRONGER MEN


Posted: Dec 21, 2010 06:33 PM    Msg. 19 of 48       
perhaps you could change the flashlight to only go for a few seconds


SlappyThePirate
Joined: Aug 24, 2009

You are irritating, I'll release nothing


Posted: Dec 21, 2010 11:03 PM    Msg. 20 of 48       
Quote: Also, Slappy, post me a link to those other threads you're talking about. I'd love to see how they got answered.
Meh, use search. Perhaps it's just because I've been around the tech forum for a long while. Of course, I'm nothing next to gamma, who has been doing tech help way longer. He seems to be glad to help people.


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Dec 21, 2010 11:22 PM    Msg. 21 of 48       
Quote: --- Original message by: Muscl3r
perhaps you could change the flashlight to only go for a few seconds

Where in guerilla is that? I don't even know where a "flashlight tag" is.

Quote: --- Original message by: SlappyThePirate
Quote: Also, Slappy, post me a link to those other threads you're talking about. I'd love to see how they got answered.
Meh, use search. Perhaps it's just because I've been around the tech forum for a long while. Of course, I'm nothing next to gamma, who has been doing tech help way longer. He seems to be glad to help people.

Yep, I wonder where Halo: CE would be without Gamma? Probably back in the primitive stages.


Skidrow925
Joined: Mar 19, 2010

"ideological sense of respect and tact of a 5yo"


Posted: Dec 22, 2010 01:33 AM    Msg. 22 of 48       
Quote: --- Original message by: pepzee
Quote: --- Original message by: Muscl3r
perhaps you could change the flashlight to only go for a few seconds

Where in guerilla is that? I don't even know where a "flashlight tag" is.

Quote: --- Original message by: SlappyThePirate
Quote: Also, Slappy, post me a link to those other threads you're talking about. I'd love to see how they got answered.
Meh, use search. Perhaps it's just because I've been around the tech forum for a long while. Of course, I'm nothing next to gamma, who has been doing tech help way longer. He seems to be glad to help people.

Yep, I wonder where Halo: CE would be without Gamma? Probably back in the primitive stages.

Heck yeah


MoooseGuy
Joined: Aug 10, 2008

I Approve This Message.


Posted: Dec 22, 2010 01:49 AM    Msg. 23 of 48       
Don't forget about Dwood though.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Dec 22, 2010 05:48 PM    Msg. 24 of 48       
Quote: --- Original message by: pepzee
Quote: --- Original message by: Skidrow925
Quote: --- Original message by: Muscl3r
how long is 1000 ticks? Is 300 ten seconds?

30 ticks = 1 second. SO 33 and 1 third seconds.

Hmm... That's odd. I can just reuse it instantly over and over. I am using Gamma's script, very weird.

When does the timer start?

Once you use the camo or once the camo wears out?

Hm, that is odd. Are you sure you compiled the script and recompiled the map? The script waits half a minute before allowing the player to use the camo again.


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Dec 22, 2010 07:59 PM    Msg. 25 of 48       
Quote: --- Original message by: Gamma927
Quote: --- Original message by: pepzee
Quote: --- Original message by: Skidrow925
Quote: --- Original message by: Muscl3r
how long is 1000 ticks? Is 300 ten seconds?

30 ticks = 1 second. SO 33 and 1 third seconds.

Hmm... That's odd. I can just reuse it instantly over and over. I am using Gamma's script, very weird.

When does the timer start?

Once you use the camo or once the camo wears out?

Hm, that is odd. Are you sure you compiled the script and recompiled the map? The script waits half a minute before allowing the player to use the camo again.

Yep, I compiled all of the scripts in sapein and recompiled in tool.

What I think the problem is, is that the timer starts once you use the cloak, so the time is going while the cloak is still in use, so if the cloak lasts 30 seconds and the timer is set for 33 seconds, that means there is only a 3 second wait.

I'm not sure if that is the case though.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Dec 22, 2010 08:45 PM    Msg. 26 of 48       
Oh, rofl. When I wrote the script, my cloak was only for 10 seconds, and the extra amount of sleep was negligible. Adjust the sleep time to include the amount of time for the cloak to run, plus the sleep time itself.


xbit272
Joined: Dec 22, 2010


Posted: Dec 22, 2010 10:23 PM    Msg. 27 of 48       
out of curiosity do any of you think that I can set this up and change what it does for example have it when flashlight is turned on a bubble shield deploys or something then each spawn a player could change it like with the reach armor abilities?


SlappyThePirate
Joined: Aug 24, 2009

You are irritating, I'll release nothing


Posted: Dec 23, 2010 01:00 PM    Msg. 28 of 48       
Quote: --- Original message by: xbit272
out of curiosity do any of you think that I can set this up and change what it does for example have it when flashlight is turned on a bubble shield deploys or something then each spawn a player could change it like with the reach armor abilities?
Reach abilities are possible but nobody has animated or scripted them. It is possible, yes. But the first priority is animations.


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Dec 23, 2010 01:31 PM    Msg. 29 of 48       
So I take it I could do this with any powerup. Like health packs, ect. Could I do this with weapons too? Or equipment?


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Dec 23, 2010 08:54 PM    Msg. 30 of 48       
Yes, you can make all sorts of objects appear in front of the player.


Pepzee
Joined: Sep 9, 2010

Retired Halo Modder


Posted: Dec 24, 2010 12:28 AM    Msg. 31 of 48       
But would it work? For instance, could I "force" a weapon upon the player. Let's say the player is armed with an assault rifle and pistol . But at a certain point I want him to have a sniper rifle and pistol. If I use this script with a weapon, would it force the player to trade the assault rifle for a sniper rifle?


sierra117
Joined: Jan 10, 2008

If sex is good exercise, why are there fat sluts?


Posted: Dec 24, 2010 06:12 AM    Msg. 32 of 48       
that is possible, but technically; both the assault rifle & pistol will be traded. It's just that because the other starting_profile has a pistol within it aswell.

Im quite sure it does either (to the pistol):

1. Nothing
2. Adds the ammo from the 1st & 2nd pistol together, until it reaches the ammo limit.
3. Nothing again... :P


SlappyThePirate
Joined: Aug 24, 2009

You are irritating, I'll release nothing


Posted: Dec 24, 2010 10:03 AM    Msg. 33 of 48       
It gives you exactly what the profile says.


MoooseGuy
Joined: Aug 10, 2008

I Approve This Message.


Posted: Dec 24, 2010 10:20 AM    Msg. 34 of 48       
Basically do the same thing that is done in Solitude-Firefight, but without the glitches.
It will destroy your old weapons you were holding and give you the new ones. If the second gun is a pistol in both profiles, let it be so. The only thing is, if you switched your pistol for another gun before this happens, you will still be given a pistol to replace it anyway.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Dec 24, 2010 12:42 PM    Msg. 35 of 48       
Quote: --- Original message by: pepzee
But would it work? For instance, could I "force" a weapon upon the player. Let's say the player is armed with an assault rifle and pistol . But at a certain point I want him to have a sniper rifle and pistol. If I use this script with a weapon, would it force the player to trade the assault rifle for a sniper rifle?

If you're referring to using the active camo script in this regard, then everyone else who posted is wrong (because they assumed you were using a separate script utilizing starting profiles). Let's look back at that script.

How it works: It spawns an active camo powerup, and teleports it on top of the player. Since players are obligated to pick up any equipment in their proximity, it will automatically be activated. However, if you use this script for spawning weapons, players are NOT obligated to pick up weapons. Sure, the pistol ammo might be added, but the player will NOT be forced to pick up the sniper rifle.

tl;dr: it doesn't work.
Edited by Gamma927 on Dec 24, 2010 at 12:42 PM

 
Page 1 of 2 Go to page: · [1] · 2 · Next

 
Previous Older Thread    Next newer Thread







Time: Thu January 19, 2023 1:41 AM 125 ms.
A Halo Maps Website