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 »a script scenery spawner with markers?

Author Topic: a script scenery spawner with markers? (15 messages, Page 1 of 1)
Moderators: Dennis

Hell_Jumper_056
Joined: Jan 7, 2010

Halo: Accession


Posted: Jan 15, 2014 10:19 AM    Msg. 1 of 15       
I was looking through a weapon.gbx file when an idea hit me. In weapon and other such files we use markers to spawn other items, or display certain things. In a weapon file you can simply select what you want to attach to the marker.

then I thought about how to spawn a marker in the level.bsp itself. I looked through the bsp and there was indeed a marker section with locations, but no options in the level.scenario file to attach anything to markers.

I personally hate using sapien to spawn items, and I use alot of them. So i figured that I could do map based scenery like lamp posts and doors (that require accuracy placement) from markers contained with the map file. I began doing some research on scripting to see if this was possible. so far I have come up with this:

(script startup effect scenery_spawner
effect_new_on_object_marker "effects\burning large" warthog_mp "driver"
)


I think that the effect could be replaced with scenery, its a code from a list I downloaded from here on this site. It says that this:

(script <script type> <return type> <script name>
<code>
)


is what your code requires. I am rather new to code, but not completely. I understand how it works. I think my script is missing the marker name to attach the effect to.

I got an error from sapien:

[scenery_spawner line 1] the value of this expression (in a <void> slot) can never be used... this left parenthesis is unmatched.:(script startup effect scenery_spawner

any help would be great. I think I need a script that says something like: "get marker name, place at marker + locations?"


bobbysoon
Joined: Feb 1, 2007


Posted: Jan 16, 2014 03:43 AM    Msg. 2 of 15       
idk, but if that doesn't work, tool could merge a scenario saved by guerilla from a scenario.txt export of said markers with a maxscript.


stunt_man
Joined: Sep 22, 2009

GMYF - Now hosting proper MLG gametypes!


Posted: Jan 16, 2014 11:29 AM    Msg. 3 of 15       
Isn't there an option in Sapien called "Snap to markers?" I believe it's in that window that everyone closes when they first load up a .scenario.

Shouldn't it be possible to create the markers in Max, export them as part of the map's.JMS, and then use Sapien to snap your scenery to the markers you placed? If you want to get even crazier, you could import the .gbxmodels of the scenery objects you want to place into your BSP's scene, link them to the markers, and rotate the markers instead of the scenery instances.

This way, all manipulation (xyz location/rotation) of scenery objects can be handled in Max (with much more precision) and in Sapien you just snap the object to the marker.

This is all theoretical, I haven't tried any of it, and I'm not home at the moment. Can someone try this out?


Skidrow925
Joined: Mar 19, 2010

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


Posted: Jan 16, 2014 08:46 PM    Msg. 4 of 15       
So, I looked through the BSL1 Bible, and I have not noticed anything yet that may help you. Perhaps, if you created a vehicle to place in the BSP that had basically no geometry, but had markers where you would want them on the BSP, that should work. Just create the markers in MAX where you want to stuff to be at, then have all those markers as a vehicle and use that, then you could spawn scenery in on the markers. I would imagine this would work, but not entirely sure. You would probably need to create a effect tag that has the GBXmodel of you scenery and spawn that on the markers.

As to your script:
(script startup effect scenery_spawner
effect_new_on_object_marker “effects\burning large” warthog_mp “driver”
)


The basic script (as you saw) is:
(script <script type> <return type> <script name>
<code>
)


So you script should be:
( script startup scenery_spawn
( effect_new_on_object_marker "effects\burning large" warthog_mp "driver" )
)


effect_new_on_object_marker calls for 3 arguements.
( effect_new_on_object_mark <effect> <object> <string> )
<effect> Effect tag [effe]
<object> Object tag [ obj]
<string> tring of characters in double quotes
Max number of characters: 32?

(This is from the BSL1 Bible. I use http://www.modacity.net/docs/bslbible/ )


Another possible ( but likely impractical ) option is to add a few pieces of scenery into MAX on you map, and combine them into a single GBXmodel tag. And make sure each group of scenery pieces is centered at (0,0,0) so you just place it at (0,0,0) assuming that's inside the BSP. Which it really has to be for this method. Then you could either place it normally, or use object_create to place them.


I will look into these at some point and see what can be done.

E: As to stunt man's idea, that doesn't work. That just seems to affect the objects. Snap to Markers doesn't appear to do anything at all.
Edited by Skidrow925 on Jan 16, 2014 at 09:00 PM


Jesse
Joined: Jan 18, 2009

Discord: Holy Crust#4500


Posted: Jan 17, 2014 01:58 AM    Msg. 5 of 15       
Quote: --- Original message by: Skidrow925

Another possible ( but likely impractical ) option is to add a few pieces of scenery into MAX on you map, and combine them into a single GBXmodel tag. And make sure each group of scenery pieces is centered at (0,0,0) so you just place it at (0,0,0) assuming that's inside the BSP. Which it really has to be for this method. Then you could either place it normally, or use object_create to place them.


I did that with foundry, and while it does work, you're gonna run into issues when trying to make LODs for it, and the lighting is gonna be the same for the whole object depending on where the node is placed in the BSP. If the 0,0,0 location is in a lit area, the whole model will be bright, even if the model itself is in a dark area. Also, fog is going to look terrible on it.


Hell_Jumper_056
Joined: Jan 7, 2010

Halo: Accession


Posted: Jan 17, 2014 03:11 AM    Msg. 6 of 15       
hmm. I looked at the original script again and realized the the "effects\burning large" was a separate line, warthog_mp was a separate line and "driver" was a separate line. Idk why i didn't see that in the first place. So I placed a mp_warthog to see if I could get it to work, but it gave me the same (in a <void> slot) error.

The .scenario_structure_bsp file does allow for markers. Mines labelled 0_structure_bsp_marker_block with the name 'scenery'. The name scenery would be used in the weapon file and is located at 0,0,0 it's only unusable in the .scenario file.

I have already experimented with multiple scenery in one file, but i'm working with all destructable scenery now, and its impossible to separate their damage if their in one file. Like you said Jesse, this does work for non destructable scenery though, even though it'll be a little buggy. BUT, if there is no script that exists to add markers to the scenario bsp, then I could make a vehicle like you said Skidrow925, then place the markers appropriatly. But I can't seem to get the script working...

when i use this:

(script startup effect sceneryspawner
effect_new_on_object_marker "effects\burning large" warthog_mp "driver"
)


i get this:

[scenery_spawner line 1] the value of this expression (in a <void> slot) can never be used...
this left parenthesis is unmatched.:(script startup effect scenery_spawner


but when is use this from Skidrow925

( script startup sceneryspawner
( effect_new_on_object_marker "effects\burning large" warthog_mp "driver" )
)


I get this:

[sceneryspawner line 2] this is not a valid object name.: warthog_mp "driver")...
[sceneryspawner line 1] this left parenthesis is unmatched.:(script startup effect sceneryspawner


The only difference is the "()" in the second line.


Skidrow925
Joined: Mar 19, 2010

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


Posted: Jan 17, 2014 04:14 PM    Msg. 7 of 15       
Ok, here is the problem with your script, and why mine isn't working.

Your script used 3 arguments "startup" "effect" and "sceneryspawner" while mine only had "starup" and "sceneryspawner." You added the argument "effect" into a place where there should not be any arguments.

Mine isn't working for the following reasons:
You need to name a vehicle "warthog_mp"

This is how you do that:
1. Place a vehicle in sapien (like a warthog, but could be any vehicle)
2. In the Properties Window, click the text-box below the dropdown box you selected the vehicle type from.
3. Into this box, type "warthog_mp" (without quotes) and that will name your vehicle "warthog_mp."

If you were doing a scorpion, you could place a scorpion, name it "tank" and use the following script:
Quote: ( script startup driverfire
( effect_new_on_object_marker "effects\burning large" tank "driver camera" )
)


This would create the effect "burning large" on the scorpion's (named "tank" ) "driver camera" marker.

In the script, where it says warthog_mp, it is not looking for a tag, but for the name of a vehicle.

Back to the original thing about scenery and other stuff, you could import the GBXmodel of the weapons you want, create markers for them, align frame_gun to your marker and then after exporting it, open the scenario_structure_bsp tag, go to the markers area, go to the marker you want, and copy the translation/rotation data to sapien. This would be precise, but may take longer. Here is an example.

I want to place a sniper very precisely in bloodgulch, so to modify the bloodgulch BSP, so I rip the BSP and import it into 3d software (I will use 3ds Max for this example as that is what I personally use) then rip the GBXmodel of the sniper (with nodes). I create a sphere named #sniper (The pound sign indicates it to exporters as a marker) then I align the frame_gun of the sniper to #sniper and make sure they have the same rotation and translation values. I put them where I want them in the BSP, delete the sniper and all it's stuff but leave the marker #sniper where it was. I link the BSP and the marker to a frame object (normally use a box) and export with Bluestreak JMS exporter. I place that in the data folder somewhere, for example, data\levels\test\bloodgulchsniper\models\bgs.JMS. Then open tool, type structure levels\test\boodgulchsniper and let it go. After that, open Guerilla go to markers, select the marker, open sapien, create a sniper weapon, copy rotation and translation to sapien, and viola!

Hope that helps some.


Hell_Jumper_056
Joined: Jan 7, 2010

Halo: Accession


Posted: Jan 18, 2014 04:50 AM    Msg. 8 of 15       
LMAO. I can't believe I didn't see that I had the word 'effect' in there... I had already added a name for the warthog, but it didn't work since my script itself was wrong lol.

I corrected the script to this:

( script startup sceneryspawner
( effect_new_on_object_marker "effects\burning large" lolwarthog "driver" )
)


But for some reason it still didn't work, but for the first time it successfully compiled the script! Then I changed it to this:

( script startup sceneryspawner
( effect_new_on_object_marker "effects\blood aoe elite" lolwarthog "driver" )
)


and it still didn't work. Then I changed the 'startup' to 'continuous' and got this:

I accidentally created a warthog that worshiped the blood gods...

I am super glad that Sapien doesn't display what the code does in it's game view, my game lagged like crazy! I changed the script back to 'startup' but it still didn't work... I don't know why, but maybe it only work's in single player? I can't remember how to spawn the player in solo. But it wouldn't make sense if it was only a solo only script.

I began changing the script to see if it would spawn scenery instead of effects, and I don't think it works. I used:

( script startup sceneryspawner
( scenery_new_on_object_marker "scenery\street_sign" lolwarthog "driver" )
)


and it said that it didn't exist. This is still a pretty handy script though and thanks for everything Skidrow925 and Jesse! I still want to figure out why the 'startup' command isn't working...
Edited by Hell_Jumper_056 on Jan 18, 2014 at 04:52 AM


Skidrow925
Joined: Mar 19, 2010

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


Posted: Jan 18, 2014 11:52 AM    Msg. 9 of 15       
Bit of an explaination on why it wasn't working, and startup versus continuous.

Startup only placed the effect once, while continuous (you guessed it) constantly places it. The reason it didn't spawn the scenery is because it can only have an effect tag. If you go in guerilla, and play around with an effect tag, you may be able to get what you want. This is how you will probably learn most of your modding skills. Just play around with things.


Hell_Jumper_056
Joined: Jan 7, 2010

Halo: Accession


Posted: Jan 18, 2014 06:43 PM    Msg. 10 of 15       
I've worked extensivly with scenery and i remember figuring out how to in guerilla, get a new piece of scenery or a vehicle to spawn out of a piece of scenery after it was destroyed, using either a garbage or effect file. I can't remember exactly which one it was lol. I'll have to look through those again. So that might work.

But even when The script was 'startup' nothing happened. When you smack an elite, he spews blood out in an animation. So when the startup script was in effect, it should have displayed that animation once. But it didn't, at all. No matter what other effect file it was. I thought that I had to declare it to do that when something activated it, but thats what the 'startup' is for. I don't know what to do to fix that..


Skidrow925
Joined: Mar 19, 2010

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


Posted: Jan 18, 2014 06:47 PM    Msg. 11 of 15       
You may need to put a "begin" argument in the script.

( script startup stuff
( begin
( scripty command stuff )
)
)

That should start the script at the very start of the maps loading. Now that I think, this is only needed when you don't have a ( sleep or a ( sleep_until command to tell it when to start doing stuff.


Hell_Jumper_056
Joined: Jan 7, 2010

Halo: Accession


Posted: Jan 18, 2014 06:58 PM    Msg. 12 of 15       
So i made this:

( script startup sceneryspawner
(begin
( effect_new_on_object_marker "effects\blood aoe elite" lolwarthog "driver" )
)
)


and it had no difference. We wouldn't need anything to tell it to stop? I feel like I'm over thinking this lol.


Skidrow925
Joined: Mar 19, 2010

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


Posted: Jan 18, 2014 07:44 PM    Msg. 13 of 15       
Quote: --- Original message by: Hell_Jumper_056
So i made this:

( script startup sceneryspawner
(begin
( effect_new_on_object_marker "effects\blood aoe elite" lolwarthog "driver" )
)
)


and it had no difference. We wouldn't need anything to tell it to stop? I feel like I'm over thinking this lol.

From what I know, that placed it the instant you loaded the map. And it would only place it once.

Try:
( script startup grapebloodymary
( begin
( sleep 120 )
( effect_new_on_object_marker "effects\blood aoe elite" lolwarthog "driver" )
)
)


Hell_Jumper_056
Joined: Jan 7, 2010

Halo: Accession


Posted: Jan 19, 2014 04:41 AM    Msg. 14 of 15       
AWESOME! This worked! But you are right, it should have placed it once in the first script, but its a blood effect and i spawn beside it. So it would have stayed until I got a certain distance away from it to unrender it. It never appeared in the first script... But did with the script change.

I looked through an effect file when it hit me. You can spawn items through effect files... Instead of directly spawning a piece of scenery, why not spawn an effect file, to spawn a piece of scenery?



and it WORKED! This is a destructable street light that I made a while back. The coordinates will have to be messed around and im not too sure yet about the shadows (I could have sworn that scenery casted shadows or maybe it's just too thin).

I'm guessing that this is one way how people made Halo Reach camo. They'd set it to spawn inside the player's model. So thanks again Skidrow925, for everything. This has been a great learning experience!


Skidrow925
Joined: Mar 19, 2010

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


Posted: Jan 19, 2014 08:46 AM    Msg. 15 of 15       
From what I know, I don't think the scenery spawned this way casts shadows. I think it has to do with lightmaps and radiosity. But glad it worked.

 

 
Previous Older Thread    Next newer Thread







Time: Thu January 19, 2023 2:07 AM 203 ms.
A Halo Maps Website