• Welcome to Battlezone Universe.
 

News:

Welcome to the BZU Archive dated December 24, 2009. Topics and posts are in read-only mode. Those with accounts will be able to login and browse anything the account had access granted to at the time. No changes to permissions will be made to be given access to particular content. If you have any questions, please reach out to squirrelof09/Rapazzini.

Main Menu

Uncle Avatar's Scriptor Time...

Started by Avatar, April 22, 2008, 06:41:05 PM

Previous topic - Next topic

mrtwosheds

I had always assumed that the dll did take care of deploying enemy rec in mpi, as there is nothing in the aip's to tell it to do so.

Red Devil

#16
Well, the engine is what takes care of it, but we now have access to it via the AIP's.  :-) 

You can tell something to deploy and undeploy using a DLL, but it the stock one doesn't.
What box???

Sonic

The MPI/SP Dlls don't instruct the Recyclers to deploy, rather they deploy due to an AIP be setup. Which means, if you took Avatar's little script there, you could drop the entire deploy animation section and simply assign an AIP when the Recycler gets to where you want it to be. The Recycler at that point should auto-deploy and begin to do whats in the AIP.
"Linux is user friendly...
...it's just very selective about who its friends are."

lucky_foot

Quote from: Avatar on April 24, 2008, 04:29:14 PM
LOL...   knock yourself out


WHACK!

Now what? :P

Keep the information coming. It's helping me out too.
Jonathan S.



Avatar

RL heated up, can basically surf a bit from work but am tied up most of the rest of the time.

This weekend I want to outline doing a complete mission, from making the map to writing the script...

-Av-

lucky_foot

I'd love to add it to BZMag #6. ;) I've got a whole lot of content for BZMag #5. Thanks for letting me use your stuff for this issue. :)
Jonathan S.



Avatar

I do promise to get back here as soon as my sister has a front wall again...

-Av-

Red Devil

Another car/tree/plane crash through it again?

"We'll take it!"
What box???

bigbadbogie

Others would merely say it was good humour.


My BZ2 mods:

QF2: Essence to a Thief - Development is underway.

Fleshstorm 2: The Harvest - Released on the 6th of November 2009. Got to www.bz2md.com for details.

QF Mod - My first mod, finished over a year ago. It can be found on BZ2MD.com

Avatar

3 Seasons room falling down due to dry rot, soon to (re)become a full front porch.

Got the wall rebuilt, insulated, and wiring almost done.  A little siding, some demolition of the existing walls (mostly windows) and it's done.

This weekend, I promise, I'll get on at night and due a full mission from placing path points to writing the script.

-Av-

Avatar

#25
OK, here we go.

Let's take a map we're all familiar with, Dunes.

Start the map by making a shortcut to it like this:
"C:\Program Files\BZ\Battlezone II\BZ2Edit.exe" dunesi.bzn /nobodyhome

That line should be in the 'target' window of the shortcut, and will start the map completely blank.  No paths or DLL or anything...

Fire up the map and you're sitting in a Sabre in the middle of dunes.  The exact middle, btw...

You'll also notice a LOT more map with this one.  That's because loading it up empty removes the 'edge_path' that limits the view to the playable area of the map.  Now you can see all of the terrain, including those areas that you normally can't.  There are also no ruins or pools, but we'll deal with them later.

Once the map is up and running hit SHIFT-F9 to enter the path editor.  It opens in a window for various reasons, so if you want to you can use SHIFT-ENTER to make it fullscreen.  Just remember to put it back to a window before trying to save your map...

It should be mostly green-blue with a big yellow squiggle above a big green square.  The green square is YOU, the yellow squiggle is the cliff in front of you.  Use the '-' (minus) key to pull back and get more of a view of the terrain.  The further out you go the more terrain it'll show and the slower the response.  There's also a limit as my screen goes black if I pull back out too far.

There are other views, which you turn on via the simple menu used in the path editor.  What you're looking at now is called 'slabs'.  Hit 2, then 1 to turn them off and stare at a black screen.  Hit 2, then 6 to get a green-screen height view.  There are times and maps when you might want to view height rather than slabs, but usually slabs will give you a decent idea of where you are on a map.

Move the view by moving the cursor to the edge of the screen. 

Now to set some paths.

Move your view 'up', to the area the humans usually spawn in, at the north end of the playable area.  We'll lay a path point to create our Recycler.

Hit 1,2 and left-click somewhere on the map.  A path point will appear and a small text box with 'path_1' in it will open at the bottom of the screen.  Left-click on the text box and a dialog box will open in the middle of the screen.  (if it doesn't you're one of those people that will HAVE to run the editor in a window)

This dialog box has a few things in it, but nobody's sure anything beyond the name does anything anymore.  :)   So for now just change the name of the point to 'myrecycler'.  Hit "OK" and the box closes AND the name in the text box updates but doesn't close.  To close it and end making the path right-click somewhere outside the text box.

There.  You just made a path point.  I don't know why some people are so scared of the Shift-F9 editor, as most of the time this is as complex as you need to get in there.

Place a few more points, 'myturret1' and 'myturret2', and then move down to the Southern area so we can set up the AI.  Place 'airecycler', 'aiturret1' and 'aiturret2', which should be enough for now.

If you're in Full Screen mode hit Shift-Enter to get back into a window.  Hit ctrl-S to save the map, preferably with a non-stock name.  I usually exit the map at that point by hitting Shift-F9 again, then ESC and ABORT.  Shift-F9 can be finicky, and it's easy to get stuck in it (or a sortof an editor view) after using it, so I just finish up and end the map after saving.

Now change your shortcut to get rid of the /nobodyhome and change dunesi.bzn to whatever you named your map.  Start the map back up again and hit ctrl-e to enter the editor.  Place some pools, some loose scrap, play with the ruins, and when you're done hit the PATH entry at the top right of the tool set.  Notice where it says "empty.dll", and change that to "myscript.dll".  Save the map again.

That's it for map prep for this simple mission.  On to the Sciptor!

Fire up the Scriptor and hit BUILD, then save the blank script as "myscript", and do so IN the \missions folder.  You can hit the 'auto add' button OR if you like, answer 'yes' to each object name when prompted.  If you save the script there it'll build the DLL's there and they'll be ready when you run the mission.  Just don't forget they're there, and remember to include them in the map zip when you release it.

We'll want an objective, so add some to the TEXT section of the script:

[text]
Obj1,"Destroy the enemy Recycler"
Obj2,"Good Job!"
Obj3,"You're DEAD!"

Now, I usually start with setting up the map as part of the MAIN routine.  To do that quickly I set up MAIN to run very fast.  I'm also going to make my comments Scriptor comments so below should actually work in the Scriptor:

[routine,Main,10000,true]

//Give yourself a Recycler and two turrets, built at the path points you placed.

createp,MyRecycler,"ibrecy",1,"myrecycler"
createp,MyTurret1,"ivturr",1,"myturret1"
createp,MyTurret2,"ivturr",1,"myturret2"

//which is of course:
// "Build at Path Point", Name of build object, ODF to build, Team to build it on, Path Point Name.

//Now for the enemy...  you can copy/paste the above and change a few letters if you want...
createp,AiRecycler,"fbrecy",1,"airecycler"
createp,AiTurret1,"fvturr",1,"aiturret1"
createp,AiTurret2,"fvturr",1,"aiturret2"

//now slow this routine down to normal

runspeed,Main,1,true

//now for an objective, and light up the enemy Recy in your HUD.

Clear
Display,Obj1,white
Wait,5
BeaconOn,AiRecycler

//you might like some scrap to build pods, or make it enough to build a Scav if you want, but for this mission we'll just keep it at 10 for now.

SetScrap,1,10

//we'll turn on a separate routine to watch for YOU to die:

runSpeed,WatchPlayer,1,true

//now we'll set up to watch the enemy Recycler

CHECKAGAIN:
  IsAround,AiRecycler
  IfEq,True,CHECKAGAIN

//which will loop until you destroy the enemy Recy

Clear
Display,Obj1,green
Display,Obj2,green
Succeed,10,"misnWIN.des"





[routine,WatchPlayer,0,false]

//turned 'off' until we turn it on in MAIN
//get the Player object and make sure it's around

CHECKAGAIN:
  GetPlayer,ThePlayer
  IsAround,ThePlayer
  IfEq,TRUE,CHECKAGAIN

 
//gets here only if you're dead, to display the bad news
  Clear
  Display,Obj1,red
  Display,Obj3,red
  Fail,10,"misnFAIL.des"


//that's it...  a very simple mission but it does outline the steps needed to get a working mission up and running.

//So, maybe we should use this as a basis and add to it, based on requests?  You tell me...

-Av-







BNG Da BZ Fool

That's a very good idea AV. Step by step helps to make following along a bit easier...BNG
When I'm not in hot water with the community I'm usually making models for BZII. I've made a few models for other peeps. BNG.

Red Devil

Thanks, Av.  :-)   I copied and saved that for future reference.
What box???

lucky_foot

Adding it to my collection to be published. Thanks, Av!
Jonathan S.



bigbadbogie

wouldve been nice to know before i had to learn all that the hard way  :lol:
Others would merely say it was good humour.


My BZ2 mods:

QF2: Essence to a Thief - Development is underway.

Fleshstorm 2: The Harvest - Released on the 6th of November 2009. Got to www.bz2md.com for details.

QF Mod - My first mod, finished over a year ago. It can be found on BZ2MD.com