Jump to content
The Dark Mod Forums

scriptlibrary


Johannes Burock

Recommended Posts

because i have to do scripting in some weeks i want to ask if we, or those who skripted allready can create a library of scripts (or does such a thing excist allready?) .

 

I mean this way:

 

topic

discription

code

 

f.e.:

 

ghostlight, moving lights

 

a moving light allong a nurbscurve

 

 

{

{$"name of the mover".startSpline($"name of the path or nurbscurve"); ##give the mover the path to fly along

sys.wait(49);

}

 

void main()

{

$mover_irrwisch1.time(49); ##speeddefinition/time for the whole path in sec

$mover_irrwisch1.decelTime(1);

$mover_irrwisch1.accelTime(1);

 

while(1)

{

movewisp1();

}

}

 

 

 

i mean also this for many people very complicate topic could make it much easyer for new mappers...copy into the script and change some parameters for the map...

if there is such a thing, sorry for thatrolleyes.gif

Edited by Johannes Burock
Link to comment
Share on other sites

Sounds cool. I was thinking of doing it but I never really had time.

 

Here's what I know:

 

Basic cutscene scripting:

Check grayman's excellent cutscene tutorial in the wiki. Tells how to activate cameras and move things using script commands and nurbs curves.

 

Misc commands:

 

sys.trigger( $entity);

Allows the mapper to trigger things from a script.

 

sys.wait(time);

Wait this time. time in seconds.

 

sys.println("print something");

Prints something in the console. Good for debugging your scripts.

 

$entityname.unbind();

Unbinds entity entityname. It detaches from whatever it is bound to and drops to the floor. Used for example in Transaction, Grenefeld's eye glasses. Or Lich Queens scroll. Looks cool. Note that the object must be a moveable with a CM. Otherwise it will probably just float in the air after detaching. You can make anything moveable like this: make a brush with texture collision. Make it a moveable entity. Create the model the object is supposed to look like. Bind the model into the moveable collision texture brush. Done.

 

$ai-name.moveToEntity($entity-name);

Makes AI named "ai-name" to walk to entity "entity-name" If your AI is on patrol, he will stop whatever he was doing, walk to the entity and then resume patrol. This was used in Transaction to control the prisoner; as she walks out of the cell. Entity-name can be any entity, I usually use path_corner nodes.

 

$ai-name.turnToEntity($entity-name);

Makes AI named ai-name turn towards entity called entity-name

 

$player1.setWorldOrigin('824 752 56');

Command to teleport the player somewhere so that he maintains his bearings. The make the player change direction to a certain angle, use the player teleport entity.

 

That's what I have in my toolbox. Hopefully someone finds these useful.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

In tdm_base01.pk4\script\ you can find doom_events.script and tdm_events.script, that's pretty much what you're looking for.

 

 

thats a good one, but also there a newbe have to search VERY long and have to experiment long time. My idea is to do this VERY simpel:

 

see the topic of the script, read some lines of discription and copy the nearly finished script into theyr own, change some things, finished

Link to comment
Share on other sites

thats a good one, but also there a newbe have to search VERY long and have to experiment long time. My idea is to do this VERY simpel:

 

see the topic of the script, read some lines of discription and copy the nearly finished script into theyr own, change some things, finished

 

Yes, it's more something like what Sotha described.

Link to comment
Share on other sites

there's also

 

sys.waitFor($entityname); wait for something to stop doing something usually use it with waiting for a func_rotate to stop rotating

 

$entityname.On(); turn on named light

$entityname.Off(); turn off named light

 

$entityname.rotateOnce(y z x); used with func_rotate, rotate to angle set in x y z

 

float variblename = numericvalue; used outside void functions

 

variblename = numericvalue; used inside void functions

 

$entityname.Open(); open door

$entityname.Close(); close door

 

$entityname.Unlock(); unlock door

 

$entityname.setFrobable( 0 ); disable frob on a frobable item

$entityname.setFrobable( 1 ); enable frob on a frobable item

 

$player1.addInvItem($entityname); add item to players inventory

$player1.replaceInvItem($entityname1, $entityname2); replace $entityname1 in players inventory with $entityname2, removes $entityname1 from game.

 

$entityname.activate($player1); use button via script

 

 

if ( variblevalue == numericvalue )

{

<do something>

}

else

{

<do something else>

}

 

$entityname.setModel("path to model"); change an items model to a new model.

 

namedfunction(); gosub, go to function defined in function before function its called in.

Link to comment
Share on other sites

  • 1 month later...

...$<name of object to change>.setModel("<path to new model/name of model + .ext>");

 

you dont need the 3 dots before the dollar sign I just put them there cos the forum wouldn't let me type a dollar sign at the front of a word, posted it as {context}:name

Edited by stumpy
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

    • 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.
      · 5 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
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...