|
| |||||||
| Wiremod General Chat All general wiremod discussion/chat. |
![]() |
| | LinkBack (2) | Thread Tools | Display Modes |
| | #141 (permalink) | |
| Newbie ![]() Join Date: Aug 2007
Posts: 20
![]() | Quote:
Hey, I already sent those to cpf :P Look at my edited post. Also, added system gates. System Time, System Clock, and System Date. All added to the main distro I think. | |
| | |
| Sponsored Links | |
| | #142 (permalink) |
| Newbie ![]() Join Date: Aug 2007
Posts: 20
![]() | I am working on a Latch RAM memory device, but am having a problem When I create the Latch, I get spammed errors about "LUA screwing up, probably a syntax error" (that is what it says). Here is my code, let me know if I completly messed something up: Code: i=0;
clock=0;
in=0;
out=0;
function init()
Ent:setpic("Addons/Default/images/8store.png");
Ent:setOutputs("Out")
Ent:setInputs("Index,Clock,In")
Ent:hookThink()
end
function onThink()
if clock == 1 then
out = in;
Ent:triggerOutput("Out",out);
end
Ent:setToolTip("Memory Store\nIndex:"..i.."\nClock:"..clock.."\nIn:"..in.."\nOut:"..out);
end
function triggerInput(input, value)
if input=="Index" then
i=value;
elseif input=="Clock" then
clock=value;
elseif input=="In" then
in=value;
end
end
|
| | |
| | #143 (permalink) |
| Advanced Member ![]() | You put in a ;
__________________ WireSim.com Why does everybody say CPF? it's cpf :P Hey, look! It's a tutorial on using LuaInterface! |
| | |
| | #145 (permalink) |
| <3 ![]() ![]() Join Date: Feb 2008 Location: London, ON (Canada, eh?)
Posts: 765
![]() ![]() | Code: up=0
down=0
reset=0
out=0
function init()
Ent:setpic("Addons/Default/images/counter.png")
Ent:setOutputs("Out")
Ent:setInputs("Up,Down,Reset")
Ent:setInputY("12,29,45")
end
function triggerInput(input, value)
if input=="Up" then
up=value
elseif input=="Down" then
down=value
elseif input=="Reset" then
reset=value
end
if (not(up=="0")) then
out=out+1
end
if (not(down=="0")) then
out=out-1
end
if (not(reset=="0")) then
out=0
end
Ent:triggerOutput("Out",out)
Ent:setToolTip("Up: "..up.."\n".."Down: "..down.."\n".."Reset: "..reset.."\n".."Output: "..out)
end
EDIT: Just came up with a nice feature (if possible with C#.net, which I think it is) when you have nothing else to do :P : Ent:PlaySound(string directory)........................................ This should make the entity play a sound. Ent:StopHookSound()............................... ......................This should make the entity stop a sound in a hook. Ent:StopSound()................................... ........................Stop sounds in a whole entity. Ent:StopAllSound()................................ ........................Stops all sounds currently playing in WireSim.
__________________ Signature: WIREMOD WILL NOT WORK ON A PIRATED GMOD! ![]() ![]() MY COLOUR IS BLUE. Post your expressions here: www.wiredexpressions.tk It's my favourite country song. And I hate it. IEF015's got his own website :3 Last edited by IEF015; 07-27-2008 at 10:11 AM.. |
| | |
| | #146 (permalink) |
| Advanced Member ![]() | OK, I'll add those to my huuuge ginormous list of features-to-add (first come first served). blob202 made some cool system gates that can start bat files, and get enviroment variables... Also, there's a change in the next update (which isn't quite out yet) where instead of the naming for the Lua files being name(catergory).lua, it's just name.lua, and the catagory is determined by what folder the file is placed in. ex: The button chip is named Button.lua, but is put in addons/default/lua/IO/.
__________________ WireSim.com Why does everybody say CPF? it's cpf :P Hey, look! It's a tutorial on using LuaInterface! Last edited by cpf; 07-27-2008 at 10:45 AM.. |
| | |
| | #147 (permalink) |
| <3 ![]() ![]() Join Date: Feb 2008 Location: London, ON (Canada, eh?)
Posts: 765
![]() ![]() | Alright, I have put my last (for now) pack together for Main Dist. ![]() Features everything in Pack3,4 and 5. Including Images. And one more lua file... because I was bored... Random Gate. (tooltips, Clk, Min, Max) Also, I have put together in the Pack/lua/Math type folder structure. All images are set to the Default folder, so make sure the including images are in the default folder images. ![]() And cpf, when you uploaded my first pack, you didn't upload the images that came with it, so some of the logic and comparison chips don't load up correctly. ![]() I think I did a big share with this game. ![]() Also cpf, I love this game. (Just because it's simple, very portable, and easy-to-code) ![]() Here, lemme break up a cookie for you...
__________________ Signature: WIREMOD WILL NOT WORK ON A PIRATED GMOD! ![]() ![]() MY COLOUR IS BLUE. Post your expressions here: www.wiredexpressions.tk It's my favourite country song. And I hate it. IEF015's got his own website :3 |
| | |
| | #148 (permalink) |
| Advanced Member ![]() | OK, that, and sounds ( ) will be in the next update. Hopefully timers, and a scheduleThink() function, too
__________________ WireSim.com Why does everybody say CPF? it's cpf :P Hey, look! It's a tutorial on using LuaInterface! |
| | |
| | #149 (permalink) |
| Advanced Member ![]() | OK, just sent out another update with sounds ( ), and timers ( too, check wiresim.com for docs)Oh, and, you may of noticed that there's a new thing in the rightclick menu for chips. What you put in that textbox becomes the chip's label. It's automatically put in the chip's tooltip, and it's saved into savefiles. Sorry, but afaik that makes the adv button obsolete
__________________ WireSim.com Why does everybody say CPF? it's cpf :P Hey, look! It's a tutorial on using LuaInterface! Last edited by cpf; 07-27-2008 at 07:13 PM.. |
| | |
| | #150 (permalink) | |
| <3 ![]() ![]() Join Date: Feb 2008 Location: London, ON (Canada, eh?)
Posts: 765
![]() ![]() | Quote:
*starts making new chips* ![]() And, the adv. buttonn isn't... COMPLETELY obsolete. It can still show you what the On/Off values are.
__________________ Signature: WIREMOD WILL NOT WORK ON A PIRATED GMOD! ![]() ![]() MY COLOUR IS BLUE. Post your expressions here: www.wiredexpressions.tk It's my favourite country song. And I hate it. IEF015's got his own website :3 | |
| | |
| Sponsored Links | |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.wiremod.com/forum/wiremod-general-chat/5263-wiresim-scriptable-wiremod-simulator.html | ||||
| Posted By | For | Type | Date | |
| cpfx.ca - My Work | This thread | Refback | 07-06-2008 02:11 PM | |
| Garry's Mod 2007: We can build it. We have the Orange Box technology - The Something Awful Forums | This thread | Refback | 06-12-2008 06:22 AM | |
|