|
Post by Farmergnome on Jul 19, 2012 0:05:23 GMT -5
|
|
|
Post by dustydrake on Jul 19, 2012 4:45:19 GMT -5
Is there a way to make a textbox in the editor, such as the ones on the Vietcong levels?
|
|
|
Post by Farmergnome on Jul 19, 2012 5:00:30 GMT -5
Sure is, you will need to create a MODscript object and place it into the world with the following properties:
IMAGE: your PNG image that you want the character/sign/etc to look like. Located in Graphics/Custom/Npcs/ , you dont need to add the .png into the box, so if my image was called prisoner.png, I would just type prisoner into the box, a picture should appear of the npc if all worked.
LUASCRIPT: Your lua scriipt file located in Data/Scripts/ , we will create one shortly so just name it whatever you like for now, for example "testingscript"
INVISIBLE: yes/no based on if you would like the character/sign/etc to be visible or not.
ACTIVATION: press up/touch will alter how the script is activated.
DESTROY AFTER RUN: This will delete the object after running (I hope - this is untested currently)
Okay, so after all that is done, lets get to making this lua script. You will need to open notepad (or some other basic text editor) and type the following in:
function runscript() say("This is a test script!"); say("Your Lua script is running!"); msgEnd(); end
Save this as testingscript.lua in notepad and close it.
So when you activate your MODscript in-game, it should say "This is a test script!" followed by "Your Lua script is running!" before ending the text box message.
If you want to get cleaver there is a few more cool things you can add to your lua scripts:
TITLES:
header("GOD");
This one will change the header text (the characters name usually) to whatever you like.
SCRIPT WAITING:
wait(10);
This will wait 10 m/s before executing the next line of the script.
TELEPORT:
teleport("mymap",53,16);
This will teleport you to mymap.lvl at x=53,y16, if you leave the X and Y positions at 0 it will position you at the start point instead.
FACE DIRECTION:
facedir(3);
This will make the player face either left (3) or right (1) and create a go arrow above the player.
Hope that helps, if you need to know a specific function just say so!
|
|
|
Post by Farmergnome on Jul 22, 2012 8:51:53 GMT -5
I should mention also, as far as editing shortcuts:
f3-refreshes/restarts map f5-all weapons, all ammo
If you would like me to add any more just say so!
|
|