Mission Script Tutorials?

Dedicated to the discussion of OTP and Deus Ex in general.

Moderators: Master_Kale, TNM Team

Post Reply
User avatar
SimonDenton
NSF
Posts: 78
Joined: Sun Mar 08, 2009 8:32 am

Mission Script Tutorials?

Post by SimonDenton »

Any links to useful mission script tutorials? For things like when a flag is set a specific object or person who is in a different map?
User avatar
Hassat Hunter
Illuminati
Posts: 2182
Joined: Fri Apr 10, 2009 1:20 pm

Re: Mission Script Tutorials?

Post by Hassat Hunter »

Not that I know off, but you can view the actual code used for a level in the editor, so it shouldn't be hard to figure it out (copy+paste and modify is my favorite tactic).
Can somebody tell me how I can get a custom avatar?
Oh wait, I already got one...
DDL
Traditional Evil Scientist
Traditional Evil Scientist
Posts: 3791
Joined: Mon Oct 17, 2005 10:03 am

Re: Mission Script Tutorials?

Post by DDL »

SimonDenton wrote:For things like when a flag is set a specific object or person who is in a different map?
...That's not a sentence. :p

You could always flick through the missionscripting tutorials over at DXE (which I wrote, incidentally), but really: there's very little you CAN'T do with an MS, given that they're pretty much just a base framework you can add context-specific code to.

Can you give an example of something you'd like to do?
chris the cynic
Human Encyclopaedia
Posts: 2207
Joined: Thu Jan 26, 2006 9:50 pm

Re: Mission Script Tutorials?

Post by chris the cynic »

DDL wrote:but really: there's very little you CAN'T do with an MS

...

Can you give an example of something you'd like to do?
Take over the world? Get rich? Restart Firefly?
User avatar
Jonas
Off Topic Productions
Off Topic Productions
Posts: 14224
Joined: Sat Apr 24, 2004 9:21 pm
Location: Hafnia

Re: Mission Script Tutorials?

Post by Jonas »

Invest in Off Topic Productions LLC!
Jonas Wæver
Chief Poking Manager of TNM

I've made some videogames:
Expeditions: Rome
Expeditions: Viking
Expeditions: Conquistador
Clandestine
chris the cynic
Human Encyclopaedia
Posts: 2207
Joined: Thu Jan 26, 2006 9:50 pm

Re: Mission Script Tutorials?

Post by chris the cynic »

I had considered something along those lines, but couldn't come up with a satisfactory way to phrase it.
User avatar
SimonDenton
NSF
Posts: 78
Joined: Sun Mar 08, 2009 8:32 am

Re: Mission Script Tutorials?

Post by SimonDenton »

Heres one thing in terms of A,B and C:

A class named A with the event tag of B enters the world when flag C is set.
DDL
Traditional Evil Scientist
Traditional Evil Scientist
Posts: 3791
Joined: Mon Oct 17, 2005 10:03 am

Re: Mission Script Tutorials?

Post by DDL »

Well, enterworld() only works for scriptedpawns and vehicles, so are we assuming it's a scriptedpawn/vehicle? If it's not you'll probably want to use bHidden instead.

Assuming a scriptedpawn, place it in your map, set bInWorld to false, and give them a tag of "Guy".

Code: Select all

function timer()
{
    local scriptedpawn P;

    super.timer();

    if(flags.getbool('YourFlagHere') && !flags.getbool('GuyAdded'))
    {
        foreach allactors(Class'scriptedpawn',P,'Guy')
        {
            P.enterworld();
        }
        flags.setbool('GuyAdded',true);
    }
}
And there you go. In fact, something basically EXACTLY like that is in the DXE thread (and that one includes a check for which map it's in, even! ZOMG).

http://www.dxediting.com/forums/showpos ... stcount=23
User avatar
SimonDenton
NSF
Posts: 78
Joined: Sun Mar 08, 2009 8:32 am

Re: Mission Script Tutorials?

Post by SimonDenton »

Thanks! So if it is an information device I just change the bHidden to true right?

Thanks again DDL :mrgreen:
DDL
Traditional Evil Scientist
Traditional Evil Scientist
Posts: 3791
Joined: Mon Oct 17, 2005 10:03 am

Re: Mission Script Tutorials?

Post by DDL »

Ayup. And then instead of

Code: Select all

P.enterworld();
you have

Code: Select all

I.bhidden=false;
(where I is the locally declared information device)

On the offchance you're having collision issues, you can also set the deco/infodevice/whatever to bCollideActors=false, and then use (again with our information device as above)

Code: Select all

I.setcollision(true,I.bBlockActors,I.bBlockPlayers); //sets bcollideactors to true, leaves blockactors/players as they were
Post Reply