Script/Code help

A refuge for those migrating from the fallen DXEditing.com and a place for general discussion relating to Deus Ex editing (coding, mapping, etc).
User avatar
Lork
NSF
Posts: 58
Joined: Wed Mar 25, 2009 6:33 pm
Location: The Great White North

Script/Code help

Post by Lork »

Hi there, I'm working on a mod that could be described as a "mini-shifter" and it's coming along nicely, but I'm having trouble with two things.

1. I need a way to kick the player out of any computer screen they're in, but no matter what I try, I can't get it to work. I'm probably missing something obvious, so please tell me about it.

2. Where exactly is the code that says that when the player is crouching, their movement is completely silent? I can't seem to find it anywhere. I'd almost think it was a hardcoded hack, but that would be downright silly.
DDL
Traditional Evil Scientist
Traditional Evil Scientist
Posts: 3791
Joined: Mon Oct 17, 2005 10:03 am

Re: Script/Code help

Post by DDL »

Check to see if GM_Trench actually has a meshnotify statement for playfootstep() in the crouchwalking animation. It may simply be that crouchwalking doesn't notify playfootstep().
User avatar
Lork
NSF
Posts: 58
Joined: Wed Mar 25, 2009 6:33 pm
Location: The Great White North

Re: Script/Code help

Post by Lork »

Yeah, that was it, thanks. Does that mean I'm out of luck if I want to change it, though? As far as I know, DeusExCharacters can't be rebuilt.

Edit: Never mind. It would've been nice to just add in the notify statements, but now that I have a better understanding of how it works, I was able to implement a considerably less elegant, but almost as effective solution.
User avatar
Jonas
Off Topic Productions
Off Topic Productions
Posts: 14224
Joined: Sat Apr 24, 2004 9:21 pm
Location: Hafnia

Re: Script/Code help

Post by Jonas »

For the first question, we've got something that does that in TNM. I think it's a mission script function, but it's been too long, so I don't remember where it is. You can poke around in our SDK if you want, and help yourself to anything you like.
Jonas Wæver
Chief Poking Manager of TNM

I've made some videogames:
Expeditions: Rome
Expeditions: Viking
Expeditions: Conquistador
Clandestine
User avatar
Lork
NSF
Posts: 58
Joined: Wed Mar 25, 2009 6:33 pm
Location: The Great White North

Re: Script/Code help

Post by Lork »

I looked through the mission scripts and I couldn't find anything, but thanks anyway.

On the bright side, I finally figured it out. For some reason that eludes me, none of the external or accessor functions related to turning computers off work, but bypassing them and calling termwindow.CloseScreen() directly does. Man, was that frustrating.
User avatar
Jonas
Off Topic Productions
Off Topic Productions
Posts: 14224
Joined: Sat Apr 24, 2004 9:21 pm
Location: Hafnia

Re: Script/Code help

Post by Jonas »

Oh sorry, it was actually a property in our computer class, I didn't mean to send you on a wild goose chase.
Jonas Wæver
Chief Poking Manager of TNM

I've made some videogames:
Expeditions: Rome
Expeditions: Viking
Expeditions: Conquistador
Clandestine
User avatar
Lork
NSF
Posts: 58
Joined: Wed Mar 25, 2009 6:33 pm
Location: The Great White North

Re: Script/Code help

Post by Lork »

I might as well use this for any further code related questions I have.

Is there any way to force a pawn to attack a specific target (and not just any instance of the target's class) without changing either the attacker or the attackee's alliances?
User avatar
Jonas
Off Topic Productions
Off Topic Productions
Posts: 14224
Joined: Sat Apr 24, 2004 9:21 pm
Location: Hafnia

Re: Script/Code help

Post by Jonas »

Use the OrdersTag - set it to the target's Tag. I think that'll do it.
Jonas Wæver
Chief Poking Manager of TNM

I've made some videogames:
Expeditions: Rome
Expeditions: Viking
Expeditions: Conquistador
Clandestine
User avatar
Lork
NSF
Posts: 58
Joined: Wed Mar 25, 2009 6:33 pm
Location: The Great White North

Re: Script/Code help

Post by Lork »

Jonas wrote:Use the OrdersTag - set it to the target's Tag. I think that'll do it.
Do you mean orderTag? Because that doesn't work.

I've come to the conclusion that it's impossible to get a pawn to attack something without making their alliances hostile. My next thought was to reset the alliances when the job was done, but I can't come up with a good way to do that.

I suppose it wouldn't hurt to say what I'm trying to do. I want to make an aug that "corrupts" a target's IFF system, causing any bots that see them to attack. I've actually got that part working well enough. The problem is that afterward the bots go into KILL ALL HUMANS mode and murder anybody with the same alliance as the intended victim. Any ideas?
User avatar
Hassat Hunter
Illuminati
Posts: 2182
Joined: Fri Apr 10, 2009 1:20 pm

Re: Script/Code help

Post by Hassat Hunter »

OrdersTrigger works just fine.

As for that, you would have to resort to the missionscript. Check for any survivors of type X (say "Soldier") and if there are none, trigger an alliancetrigger. Like the n00bz mission in TNM (You have played TNM, right?).
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: Script/Code help

Post by DDL »

No, orderstriggers wouldn't work here: imagine you have a squad of soldiers all of alliance 'soldier': you want to be able to make a bot attack ONE targeted soldier, then stop when he's dead. Doing this with an orderstrigger will A) require the single targeted soldier to have a unique tag (and tags are names, which cannot be created dynamically..or at least not easily), and then as soon as you set the bot to "attacking", the way it handles the setorders command means that it now hates the alliance of the targeted soldier, i.e. 'soldier' (permanently, until removed directly by an alliancetrigger), so it guns down all the soldiers quite happily.

Even if you had scripts running in place to check constantly for the death of the targeted soldier, you'd run the risk of the bot shooting at a more prominent target first, plus as soon as he opens up on them, they all assume the bot is an enemy, so they all flip THEIR alliances, and then it all goes a bit clusterfucked.

You could of course give every troop a discrete alliance and tag, but then you have to make sure each troop liked all his squadmate's alliances, and you'd run out of space in the initialalliances array pretty damn fast.

However, I'm curious to know how (in a pseudoscience kinda way) altering a person's IFF (assuming all targets HAVE an IFF) would make bots target them? Surely it would be more of a case of altering a bot's IFF to target a person?


Anyway, I can see a way you can do this, but it is oh-so-terribly, terribly hacky.
User avatar
Lork
NSF
Posts: 58
Joined: Wed Mar 25, 2009 6:33 pm
Location: The Great White North

Re: Script/Code help

Post by Lork »

I wanted to turn the targeting aug into something useful and fun, and I thought it'd be kind of neat if it offered a way to mess with bots that wasn't just scrambling them. I've been thinking about it mostly from a gameplay perspective, but if I had to give an in world explanation, it'd be something like "The data gathered by the targeting augmentation can be used as an entry point into IFF systems, allowing an agent to corrupt the IFF info for the target. Any entities that rely on their IFF systems rather than their intuition to distinguish friend from foe will treat the target as an enemy." It looks like there's not going to be any reasonable way to do this, though, so it's not going to happen.

My other idea was to use the target data to give orders to bots directly, which was really cool in theory, but ended up having numerous problems in addition to the one above, so I had to scrap that as well.

I think I'll just leave it alone for now.
User avatar
Hassat Hunter
Illuminati
Posts: 2182
Joined: Fri Apr 10, 2009 1:20 pm

Re: Script/Code help

Post by Hassat Hunter »

Ehm, targeting already is one of the most useful augs in the game, giving additional acc, reload, damage, info and what-not.
Can somebody tell me how I can get a custom avatar?
Oh wait, I already got one...
User avatar
Lork
NSF
Posts: 58
Joined: Wed Mar 25, 2009 6:33 pm
Location: The Great White North

Re: Script/Code help

Post by Lork »

Is there a place I can put code such that it will be run before every map change? I'm making an aug that holds references to actors indefinitely, and I need to clear those references when leaving a map. Just letting them dangle seems to work at first, but I've had at least one crash because of it.
User avatar
Jonas
Off Topic Productions
Off Topic Productions
Posts: 14224
Joined: Sat Apr 24, 2004 9:21 pm
Location: Hafnia

Re: Script/Code help

Post by Jonas »

Try PreTravel() in the mission script.
Jonas Wæver
Chief Poking Manager of TNM

I've made some videogames:
Expeditions: Rome
Expeditions: Viking
Expeditions: Conquistador
Clandestine
Post Reply