Jump to content
The Dark Mod Forums

shadowhide's mapping thread


Shadowhide

Recommended Posts

You should be able to play the "draw sword" animation as part of a conversation the same way as any other animation.

Link to comment
Share on other sites

hey guys,i have a mover which is moves by the spline trajectory.There are another few f_s's that are bin to a base mover (I'm talking about the train and wagons),but they are not follow spline trajectory,they are moving just behind their base

 

here is screenshot from a test map :

 

shot00010lj.jpg

 

first wagon is moving by the spline trajectory

 

so there is any way to make bindings move like the base mover ?

 

I'm going to make each wagon a separate mover which will follow the spline

 

current script is pretty simple :

 

#define TRAIN_SPEED 300

#define CAGE_SPEED 150

#define TRAIN_FINAL_SPEED 800

#define TRAIN_ANCHOR train_anchor

#define TRAIN_BLINK 0.1

#define TRAIN_BLINK2 0.1

 

void train()

{

sys.cacheSoundShader ("TRAIN_SOUND");

$player1.startSoundShader ("TRAIN_SOUND", SND_CHANNEL_ANY);

$train_emitter.activate($player1);

sys.wait(2);

$train_anchor.time (50);

$train_anchor.accelTime( 3 );

$train_anchor.decelTime( 3 );

$train_anchor.startSpline ( $spline1 );

$train_anchor.removeInitialSplineAngles();

}

 

void main()

{

sys.print("hi");

$train_anchor.time(50);

$train_anchor.decelTime(1);

$train_anchor.accelTime(1);

}

 

,but its going to turn into the something like that in the end :

 

#define TRAIN_SPEED 300

#define CAGE_SPEED 150

#define TRAIN_FINAL_SPEED 800

#define TRAIN_ANCHOR train_anchor

#define TRAIN_BLINK 0.1

#define TRAIN_BLINK2 0.1

 

void train()

{

sys.cacheSoundShader ("TRAIN_SOUND");

$player1.startSoundShader ("TRAIN_SOUND", SND_CHANNEL_ANY);

$train_emitter.activate($player1);

sys.wait(2);

$train_anchor.time (50);

$train_anchor.accelTime( 3 );

$train_anchor.decelTime( 3 );

$train_anchor.startSpline ( $spline1 );

$train_anchor.removeInitialSplineAngles();

 

$trainwagon1.anchor.time (50);

$trainwagon1.accelTime( 3 );

$trainwagon1.decelTime( 3 );

$trainwagon1.startSpline ( $spline1 );

$trainwagon1.removeInitialSplineAngles();

 

$trainwagon2.anchor.time (50);

$trainwagon2.accelTime( 3 );

$trainwagon2.decelTime( 3 );

$trainwagon2.startSpline ( $spline1 );

$trainwagon2.removeInitialSplineAngles();

 

$trainwagon3.anchor.time (50);

$trainwagon3.accelTime( 3 );

$trainwagon3.decelTime( 3 );

$trainwagon3.startSpline ( $spline1 );

$trainwagon3.removeInitialSplineAngles();

 

$trainwagon4.anchor.time (50);

$trainwagon4.accelTime( 3 );

$trainwagon4.decelTime( 3 );

$trainwagon4.startSpline ( $spline1 );

$trainwagon4.removeInitialSplineAngles();

 

$trainwagon5.anchor.time (50);

$trainwagon5.accelTime( 3 );

$trainwagon5.decelTime( 3 );

$trainwagon5.startSpline ( $spline1 );

$trainwagon5.removeInitialSplineAngles();

}

 

void main()

{

sys.print("hi");

$train_anchor.time(50);

$train_anchor.decelTime(1);

$train_anchor.accelTime(1);

$trainwagon1.time(50);

$trainwagon1.decelTime(1);

$trainwagon1.accelTime(1);

 

$trainwagon2.time(50);

$trainwagon2.decelTime(1);

$trainwagon2.accelTime(1);

 

$trainwagon3.time(50);

$trainwagon3.decelTime(1);

$trainwagon3.accelTime(1);

 

$trainwagon4.time(50);

$trainwagon4.decelTime(1);

$trainwagon4.accelTime(1);

 

$trainwagon5.time(50);

$trainwagon5.decelTime(1);

$trainwagon5.accelTime(1);

}

 

/////////ect

 

:wacko:

Edited by Shadowhide

Proceed with caution!

Link to comment
Share on other sites

At least *try* the sky_portal trick. Put the sky_portal camera inside the terrain you've built (you might even make the scale much smaller, like 1/10 the size), then put the camera on the spline, then put your train in its own box that is completely surrounded by brushes with a sky_portal texture. The walls will animate as if moving terrain; even the floor will animate with the tracks moving by. You might not like it either, but you should at least try it.

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

Somebody mentioned the solution to that before. If you make the scale very small, like 1/20, then make the room very large (like a square kilometer, then in game space it's like 20 km^2, but the actual track path would be, uh, C=PI*D, a ~60 km long track, even more if you have the track weaving in the inner space), with that kind of scale you can have the track go in a massive loop at such a big scale that the loop isn't noticeable. The player might notice the track tending left or right at any time, but it doesn't feel like it's going in a circle. I mean 60 km is a *long* route; but being able to mini-size it means you don't actually have to make it 60 km's long, only like 3.

 

The other solution is to use a gradual downward flat spiral, at the end of which it spirals back up to its starting point. But I think with a big enough scale you can just do it on a single flat terrain and have it meet itself.

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

  • 3 months later...
  • 1 year later...

ok,simple ingame shop (

)

 

for example we want to buy broadhead arrow for 50 gold (NOTE:there is something wrong and total loot amount can not be decreased,only 1 type of loot - jewerly,gold or goods,so we will be buying it for gold only)

 

Step 1 : create a func_static with a broadhead arrow model,give it "frobable 1" property

Step 2 : select it,then click on Entity (menu) and select a Stim/responce

Step 3 : give it a new responce of "Frob" type,add a "Run script" effect and choose a script name.Let it be " getbroadhead " (without the quotes)

Step 4 : creat a script file in your "maps" folder,then paste a code ... :

 

void getbroadhead()
{
   do
   {
			   if ($player1.getLootAmount(2) >= 50) {  ///the function says for itself.We checking if player has a 50 loot in your inventory."(2)" is a type of loot (gold in our case).
			   $player1.changeLootAmount(2, -50);  ///this function says for itself too,we removing 50 gold from inventory
			   sys.print ("it works"); ///print if it works
			   sys.cacheSoundShader ("frob_loot"); ///cache a neat sound
			   $player1.startSoundShader ("frob_loot", SND_CHANNEL_ANY); ///play a neat sound
			   entity broadhead1 = sys.spawn("atdm:ammo_broadhead"); ///we spawn a broadhead arrow entity with name "broadhead1"			  
			   $player1.addInvItem(broadhead1); ///we add a "brodhead1" entity to players inventory		
			   return;
		 }
		 else {				
			   sys.wait(1);
		 }
	   } while(false);
}

 

ok,thats it

NOTE:if you have a loot selected in your inventory when you buy something - displayed loot count wont change,though the REAL loot number will change as it should be.True loot amount will be shown when you scroll your inventory.

 

btw,i cant update my status

  • Like 2

Proceed with caution!

Link to comment
Share on other sites

NOTE:if you have a loot selected in your inventory when you buy something - displayed loot count wont change

 

Is there some function to reload / recache / recheck the players inventory maybe to prevent this?

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

Is there some function to reload / recache / recheck the players inventory maybe to prevent this?

dunno,i haven't find one

i think its a bug of TDM itself,because displayed loot count changes when player picks loot

but as i said,everything will be fine if player scroll inventory

Edited by Shadowhide

Proceed with caution!

Link to comment
Share on other sites

You can bypass this by selecting the next inventory item and then directly afterwards select the previous. Just add the lines

$player1.getNextInvItem();
$player1.getPrevInvItem();

to the code.

 

Regarding the loot type you pay with, you could just substract it partly over the types.

float cost=50;
float paid;
if ($player1.getLootAmount(LOOT_TOTAL>=50) {
 for (int i=1;i<4;i++) {
paid=min($player1.getLootAmount(i),cost);
cost-=paid;
$player1.changeLootAmount(i,-paid);
 }
}

This assumes that the loot types are numbered from 1 to 3. Maybe it's 0 to 2, dunno. Btw, why is there a do-while-loop?

 

Anyways, the changed script would look like this

void getbroadhead() {
 if (player1.getLootAmount(LOOT_TOTAL)>=50) {
float cost=50; float paid;
for (int i=1;i<4;i++) {
  paid=min($player1.getLootAmount(i),cost);
  cost-=paid;
  $player1.changeLootAmount(i,-paid);
}
$player1.getNextInvItem();
$player1.getPrevInvItem();
sys.cacheSoundShader ("frob_loot");
entity broadhead1 = sys.spawn("atdm:ammo_broadhead");
$player1.addInvItem(broadhead1);
 }
}

The function min returns the minimum of two values. Don't know if there is a implementation for it already, but it should look like this

float min(float a,float  {
 if (a< return a;
 return B;
}

F****ng forum always saves the b as capital letter, so don't worry. :angry:

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

So there's a routine that checks if you gain loot, but none that does if you lose :)

 

EDIT: Ninjaed ^_^

 

what does -= do? (Google can't handle the search)

Edited by SeriousToni

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

EDIT: You can even reduce the loot amount to a negative value.

EDIT2: The total loot amount is calculated as the sum of all the other loot types, that's why you can't change it.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Hey, this is quite a nice thing you've got going there, I can definitely see people wanting to have a shop like this in their maps, maybe replacing the GUI one with a portion of the map that is neutral to the player, where he goes to before the actual mission area, like in T3.

 

Cool to see Shadowhide working on TDM again. BTW, I forgot to mention I used one of your interactive npcs (from the conversation tutorial map) as a template for my own map, will be sure to credit you when I release the updated version (thanks for that ;) ).

Link to comment
Share on other sites

Anyways, the changed script would look like this:

thanks,its much better now,i would never end up with code like that on my own without proper learning of C++

BTW, I forgot to mention I used one of your interactive npcs (from the conversation tutorial map) as a template for my own map, will be sure to credit you when I release the updated version (thanks for that ;) ).

glad it was useful !

Proceed with caution!

Link to comment
Share on other sites

what to do if i have no ideas for mapping and getting tired after creating a 1 simple room (which is going to a trashcan anyway) ?

 

Have a break from mapping and do something new, nice and interesting. Visit someplace new. After a while mapping is fun again.

 

Alternatively, try to look at beautiful old buildings that might be near you. Use google image search or google street view to remotely see interesting locations for inspiration.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

is there any is tool to preview a D3/TDM GUI ?

testGUI [your gui name] in the console

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Have a break from mapping and do something new, nice and interesting. Visit someplace new. After a while mapping is fun again.

 

Alternatively, try to look at beautiful old buildings that might be near you. Use google image search or google street view to remotely see interesting locations for inspiration.

 

i havent mapped since september or whenever my mission was released

 

unfortunately,even looking at the photos or art does not inpire me... remaking is not a good idea either,because its impossible for me to get close to the image/photo level of detail

Edited by Shadowhide

Proceed with caution!

Link to comment
Share on other sites

What used to inspire me wasnt the building itself, but actually creating the environments and all their "texture"; I would suggest you, keeping in mind your idea for the mission/adventure, draw the spaces as floorplans, exactly like an old D&D or Hero Quest map, and think about all the little details that will fill that space, and how it will contribute to the story and/or the atmosphere of that space.

 

I had a picture... Here, it shows more or less what Im talking about, this was the coolest part of mission making, thinking about the spaces and connectiong them in an interesting chain:

 

post-8474-0-02246500-1361060369_thumb.jpg

 

There used to be loads of notes about what would go inside those areas (erased them for clarity).

Edited by RPGista
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
       
      · 5 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...