Jump to content
The Dark Mod Forums

Sotha's mapping thread


Sotha

Recommended Posts

Ah.. I seem to be full of stupid questions today.. What does this dollar sign mean? Sometimes a script command has $-sign and sometimes not. Whazzat?

 

"$somename.foo()" is "find the entity with that name, then use it to call foo() on it", while "name.foo()" is "use the variable somename and call foo() on it".

 

And you need to declare and initialize variables with:

 

 entity somename;
 somename = SomeScriptEventThatReturnsAnEntityHere();

 

Usually you have one entity, like $myentity, and if you call a method on it, it returns you some other entity. Like when you say:

 

 entity target = $entity.GetTarget(1);

 

then you use the variable named "target" to store the result of the GetTarget() script event. $Entityname seems just a build shortcut in the scripting system to give you the entity by name.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I saw something like this somewhere:

 

Ha. You're as easy as Sotha... with his "I'm going to take some time off" every time he finishes a FM.

 

Comparing me to grayman? No such comparison can be made! I am just a mapper, but grayman's work on AI is really really significant for TDM's future. The sneaking genre is really dependant of intelligent-looking AI. Personally I feel that AI improvement is the most important thing TDM needs to attain the status of the most influential sneaking game of our time.

 

Also let the following be know for all (who are interested):

After my current WIP map is finished and released, my mapping endeavours will snuffed by a huge IRL undertaking which I have been postponing for too long.

 

With this, it looks like I've confirmed AS's point, but really the situation is as described. The good side in this is that you get one more release from me before my unfortunate future inactivity. :(

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Well, I did say I was only having a little fun with y'all (and wasn't comparing your output, or the significance of it, so much as your all-too-evident need to pursue this avocation).

 

...

 

Anyway, I hope that your RL stuff is "unfortunate" only in that it takes you away from exercising your talent as a FMA. I hope that whatever it is isn't serious in a dire sense.

Link to comment
Share on other sites

I hope that whatever it is isn't serious in a dire sense.

 

Thanks. It isn't very serious thing, no worries. Just something I've been postponing too long and now I have to tackle the task with maximal free time investment. Once I get that off my table, I'm definately gonna map again.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Thanks. It isn't very serious thing, no worries. Just something I've been postponing too long and now I have to tackle the task with maximal free time investment. Once I get that off my table, I'm definately gonna map again.

 

Congratulations to you and your wife and the newborn once it arrives :D :D

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

The conversation system has the possibility of having the AI look at something. It works nicely if I put the entity name of an object and the AI looks at that object.

 

My question is, how can I make an AI look at the player? What is the entityname of the player?

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

The conversation system has the possibility of having the AI look at something. It works nicely if I put the entity name of an object and the AI looks at that object.

 

My question is, how can I make an AI look at the player? What is the entityname of the player?

 

$player1 in scripting, or I guess whatever "name" the "player_info_start" entity has in DR? Normally this would be "info_player_start_1" but I guess you can rename it?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

It's idPlayer in objectives. Try them all. but info player start is just some spawning info so I'm sure that won't work.

 

But idPlayer is not the entityname of the player. According to wiki and the objective editor, it is SDK-level spawnclass.

 

Gotta test once I have time, unless someone happens to know the exact solution.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

I think the fence in NHAT2 faced the player while talking, didn't he? You could check how it was done there.

Link to comment
Share on other sites

Another question for ye!

 

What is the conversation system command "InteractWithEntity" supposed to do?

 

If it is supposed to work like path_interact, (like I assume) then it is broken and does not do anything.

 

I have an AI and a switch. In a conversation I try to get the AI to flip the switch. InteractWithEntity does not do anything, when AI uses it at the switch.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

I've not tried it but this is in the wiki article...

 

 

InteractWithEntity

Lets the actor walk to an entity, play the "use" anim and trigger the entity's frobaction script. Doors will be opened, buttons be pushed, etc.

Argument 1: (string) the entity to interact with.

 

Is that what you're doing?

Link to comment
Share on other sites

I wonder if the "walking to it" part of it might be an issue, like if the model's origin is against a wall the system can't pathfind to it, or something like that, and it breaks everything from that point.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

Is that what you're doing?

 

Aye.

 

I wonder if the "walking to it" part of it might be an issue, like if the model's origin is against a wall the system can't pathfind to it, or something like that, and it breaks everything from that point.

The AI is standing something like 32 units away from the switch and won't operate it.

 

path_interact uses successfully any levers, which may even be on the other side of the map. (The AI won't walk to them. The AI turn to the lever's direction and flips them even if the lever is a lightyear away.)

 

This conversation command is starting to look like the feature is indeed broken.

 

There is a workaround while waiting for a fix, but it is very tedious:

Mapper makes the same effect with existing working commands:

Actor turns to the lever.

Actor plays use_righthand anim (no wait)

Actor waits 1 second.

Actor triggers the wanted lever. (Triggers with "activate target," not with "interact with entity.")

(the no wait and 1s delay are needed to make the switch turn then the actors hand is in the highest position.)

 

But yeah, it would be nice to get the interact command to work so future mappers can only use that command instead of 4.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

My question is, how can I make an AI look at the player? What is the entityname of the player?

The name is player1.

 

The $ is only applicable to scripting to perform an automatic "the entity with that name" lookup. $player1 is basically doing the same as sys.getEntity("player1").

 

idPlayer is the name of the C++ class, the type name. It's mainly used in the def to specify the spawnclass, and in objectives to specify that all player entity types should be affected.

Link to comment
Share on other sites

Thanks!

 

My newest question: is there a script command to force player view angle to some value, ie reset the player view to something. I've a cutscene after which the player should be looking at certain direction, which is not necessarily the direction he looked before the cutscene started.

 

(Once I get my map done, I think I collect all the script commands I have learned and stick them in the wiki for other people to locate and learn easily.)

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

The "player1" entityname worked for the entity looking very well. Thanks-a-many!

 

 

Try this:

 

$player1.setAngles('0 45 0');

 

Nope. Doesn't work.

I found this: http://www.doom3worl...&st=0&sk=t&sd=a

 

Looks like it is not possible. Shame, it would have been a nice touch, and not critical. I'll live. ;)

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

It can be done with a info_player_teleport. I have this working and it turns the player. Give it the angle spawnarg and target info_player_start_1.[edit or whatever name you have for player start of course.] That might seem odd but it does work. If you know the exact position then just put the teleport there but if it is important to only turn the player and the player might be in different positions then you need to change the origin to that of the player using script, immediately before triggering the teleport, something like:

 

	$TeleportName.setOrigin($player1.getOrigin();
$TeleportName.activate($player1);

 

(the first two lines above should be all one line of course.)

 

Again, I'm not certain of the player entity name but I think that's right.

Link to comment
Share on other sites

Changing the players view direction is possible in C++, so I guess it would be easy to add a scripting event for this.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

It can be done with a info_player_teleport.

 

Splendid! That did exactly the trick I wanted.

I placed an info_player_teleport and put that "teleportname.activate($player1);"

Works nicely.

 

Thanks a lot! :)

 

Changing the players view direction is possible in C++, so I guess it would be easy to add a scripting event for this.

 

I dunno if it is worthwhile to put time in that... The most common thing the mapper wants to reset player view is after a cutscene and Fids trick does exactly that.. But on the otherhand, no one can really know what clever things future mappers will figure out. :P

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Splendid! That did exactly the trick I wanted.

I placed an info_player_teleport and put that "teleportname.activate($player1);"

Works nicely.

 

Thanks a lot! :)

 

There is still a stim_response that sets the angles, which might work, too. Also, while your method works, it makes another entity nec., which is a bit of a waste.

 

After looking at the code:

 

/*
================
idPlayer::SetViewAngles
================
*/
void idPlayer::SetViewAngles( const idAngles &angles ) {
       UpdateDeltaViewAngles( angles );
       viewAngles = angles;
}

 

This is what we need to turn into a script event.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

  • 2 weeks later...

I'm encountering a mysterious problem here.

 

In knightons manor there is the mission start anim where the player sneaks in the compound.

 

I made the same thing in my WIP. The worldspawn is targetting the script call target which puts the anim in motion. The anim is build by copy-pasteing and modifying the fully working knighton anim script.

 

The anim works perfectly.

 

But somehow some of my AI's are dead when I get the controls from the anim. If I disable the anim totally (no targetting from worldspawn) my AI's are all live and healthy.

 

Is worldspawn targetting deprecated somehow? What is going on? Brief tests show that always the same AI's die. The AI's are totally in different areas, and they have nothing in common: different classnames, even different attachments.

 

EDIT1:

I gave the dying AI's the spawnarg cinematic 1. Now they do not die. But some other non-cinematic AI's died. I saw in the console something like "damage dealt: 109758233." That's a lot of damage....I don't think it's a good idea to make something this erratic, who knows what other things get broken during the cutscene. I'll disable it and take the cinematic property out.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 2 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 3 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...