Jump to content




[MC 1.7.10] [CC 1.65] Immibis's Peripherals


432 replies to this topic

#301 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 04 July 2013 - 08:05 PM

No, but you can use the vanilla-CC wired modem for that.

#302 justync7

  • Members
  • 210 posts
  • LocationCLGD

Posted 06 July 2013 - 07:55 AM

You should add a player_kill or player_death event, so you can detect kills, and deaths by environment because player_respawn is unreliable and impossible to keep score of kills, and you should also add triggering particle effects at a certain xyz, thanks!

#303 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 11 July 2013 - 05:24 AM

56.0.0:
  • Updated to Minecraft 1.6.2.


#304 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 11 July 2013 - 05:36 AM

56.0.0:
  • Updated to Minecraft 1.6.2.


#305 Xakorik

  • Members
  • 4 posts

Posted 11 July 2013 - 07:45 PM

View PostAshton, on 03 July 2013 - 07:18 PM, said:

Not sure wheather to post this here or in general/ask since it's mostly code, but...

I'm building a SMP-adventure-map with multiple "dungeons" and am thinking a good way to keep track of these (and the locations they open) is using the mag-cards/RFID cards. My plan is to fill the data-block of the card with 0s and when a specific dungeon is completed and new area unlocked change it's corresponding 0 to a 1.

i.e.:
000000000000000

Dungeon 3 is unlocked:
001000000000000

Dungon 3 and 5 are unlocked:
001010000000000

How could I easily setup the reader/writers to change ONLY the bit that's related wo their dungeon (so that all other progress is not erased)? My only thought is to use complex strings of IF statements (i.e. "if data = 000000000000000 or  000000000000001 or 000000000000010 or 000000000000011 or 000000000000010.... (etc) then data == data + 100000000000000" which would take a LOT of time to code into all 16 (or however many) locations...

I believe you should simply add the dungeon value by converting the string to a number first then converting back afterwords.

#306 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 11 July 2013 - 10:11 PM

56.0.1:
  • Fixed crash on startup on servers.


#307 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 11 July 2013 - 10:13 PM

already updated? that was fast

#308 Ashton

  • Members
  • 44 posts

Posted 12 July 2013 - 01:58 AM

Is it possible to make RFIDs re-writable? I just realized the whole system I was trying to build was worthless with one-time-write RFIDs...

#309 electrodude512

  • Members
  • 167 posts
  • LocationEastern USA

Posted 12 July 2013 - 08:56 AM

View PostAshton, on 03 July 2013 - 07:18 PM, said:

Not sure wheather to post this here or in general/ask since it's mostly code, but...

I'm building a SMP-adventure-map with multiple "dungeons" and am thinking a good way to keep track of these (and the locations they open) is using the mag-cards/RFID cards. My plan is to fill the data-block of the card with 0s and when a specific dungeon is completed and new area unlocked change it's corresponding 0 to a 1.

i.e.:
000000000000000

Dungeon 3 is unlocked:
001000000000000

Dungon 3 and 5 are unlocked:
001010000000000

How could I easily setup the reader/writers to change ONLY the bit that's related wo their dungeon (so that all other progress is not erased)? My only thought is to use complex strings of IF statements (i.e. "if data = 000000000000000 or 000000000000001 or 000000000000010 or 000000000000011 or 000000000000010.... (etc) then data == data + 100000000000000" which would take a LOT of time to code into all 16 (or however many) locations...

function getDungeon(n)			--return status of dungeon #n
    local str=readcard()
	return str:sub(n,n)
end

function setDungeon(n,value)	--sets dungeon #n's state to value
    local str=readcard()
	str=str:sub(1,n-1)..tostring(value)..str:sub(n+1,#str)
	writecard(str)
end

readcard() should read the string of numbers off of the card and writecard() should write it.

#310 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 12 July 2013 - 10:19 AM

View PostAshton, on 12 July 2013 - 01:58 AM, said:

Is it possible to make RFIDs re-writable? I just realized the whole system I was trying to build was worthless with one-time-write RFIDs...
sorry, nope
only mag cards are re-writable

#311 Ashton

  • Members
  • 44 posts

Posted 12 July 2013 - 10:34 AM

View PostPixelToast, on 12 July 2013 - 10:19 AM, said:

View PostAshton, on 12 July 2013 - 01:58 AM, said:

Is it possible to make RFIDs re-writable? I just realized the whole system I was trying to build was worthless with one-time-write RFIDs...
sorry, nope
only mag cards are re-writable

Excuse me while I bash my head against the wall... and swear at the trolls who suggested in my other post to use RFIDs...

*sigh* at least the basic code is still useable, I just have to go back to having players swipe-swipe-swipe in and out of dungeons...

#312 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 12 July 2013 - 10:54 AM

why would you need to rewrite the data?
just give each player their own RFID and write other stuff to a database

#313 Ashton

  • Members
  • 44 posts

Posted 12 July 2013 - 02:08 PM

View PostPixelToast, on 12 July 2013 - 10:54 AM, said:

why would you need to rewrite the data?
just give each player their own RFID and write other stuff to a database

Each individual card keeps track of the player's progress, As they clear dungeons and/or gain key items/quests/etc the card's data changes.

In theory, yes, I could do that, but I'd have to use the webserver peripheral to connect to a MySQL DB, and even then I have no clue what the query strings are in LUA... (in short, a DB is beyond my lua skills right now, sadly...) :(

#314 MxHn

  • Members
  • 29 posts
  • LocationDuluth, MN, USA

Posted 14 July 2013 - 07:38 AM

First off, good work Immibis! This add-on is really amazing. I am not sure how hard this is going to be to code, but I think it world be great if you could add the ability for the Adventrue Map Interface to load other entities(namely mobs). It woulds make mob spawn systems easier (having a central spawn location and teleporting the mobs around the map,etc.). Thanks for the great add on!

#315 MxHn

  • Members
  • 29 posts
  • LocationDuluth, MN, USA

Posted 14 July 2013 - 07:39 AM

View PostAshton, on 12 July 2013 - 02:08 PM, said:

View PostPixelToast, on 12 July 2013 - 10:54 AM, said:

why would you need to rewrite the data?
just give each player their own RFID and write other stuff to a database

Each individual card keeps track of the player's progress, As they clear dungeons and/or gain key items/quests/etc the card's data changes.

In theory, yes, I could do that, but I'd have to use the webserver peripheral to connect to a MySQL DB, and even then I have no clue what the query strings are in LUA... (in short, a DB is beyond my lua skills right now, sadly...) :(
table?

#316 Ashton

  • Members
  • 44 posts

Posted 14 July 2013 - 12:16 PM

View PostMxHn, on 14 July 2013 - 07:39 AM, said:

View PostAshton, on 12 July 2013 - 02:08 PM, said:

View PostPixelToast, on 12 July 2013 - 10:54 AM, said:

why would you need to rewrite the data?
just give each player their own RFID and write other stuff to a database

Each individual card keeps track of the player's progress, As they clear dungeons and/or gain key items/quests/etc the card's data changes.

In theory, yes, I could do that, but I'd have to use the webserver peripheral to connect to a MySQL DB, and even then I have no clue what the query strings are in LUA... (in short, a DB is beyond my lua skills right now, sadly...) :(
table?

Gotta make chairs first ;)

but seriously... I'm trying to read over some LUA programming tutorials in my (rather short) spare time, This is amazingly difficult for me because the syntax of Lua is *similar* but still quite different to the languages I use, so I keep slipping up and bugging my programs because I'm following conventions for other languages >.<

#317 MxHn

  • Members
  • 29 posts
  • LocationDuluth, MN, USA

Posted 14 July 2013 - 10:54 PM

View PostAshton, on 14 July 2013 - 12:16 PM, said:

View PostMxHn, on 14 July 2013 - 07:39 AM, said:

View PostAshton, on 12 July 2013 - 02:08 PM, said:

View PostPixelToast, on 12 July 2013 - 10:54 AM, said:

why would you need to rewrite the data?
just give each player their own RFID and write other stuff to a database

Each individual card keeps track of the player's progress, As they clear dungeons and/or gain key items/quests/etc the card's data changes.

In theory, yes, I could do that, but I'd have to use the webserver peripheral to connect to a MySQL DB, and even then I have no clue what the query strings are in LUA... (in short, a DB is beyond my lua skills right now, sadly...) :(
table?

Gotta make chairs first ;)

but seriously... I'm trying to read over some LUA programming tutorials in my (rather short) spare time, This is amazingly difficult for me because the syntax of Lua is *similar* but still quite different to the languages I use, so I keep slipping up and bugging my programs because I'm following conventions for other languages >.<
Yeah, I keep slipping the capitalization in about 99% of my programs so I get *nil* calls :( . Tables are quite simple actualy. You can form the by making variables with braces(curly brackets?) like x={value1,value2,...}(keys start at 1) or like this x[string key or #] = value(for multi dememtions you need to do ex_table["key1"]={key(no"" here)={key=etc...}}(see this http://www.computerc...nfo/wiki/Tables). Sorta like c arrays except you can have string keys. As I understand, a database is just somthing that can contain data so you can DIY something with tables(very simple)? So multiple tables can be used to keep track(one for players, one for dungeons completed(ex. dungeon[player] = 000010000 and set up the 00's to be rewritten using string.gsub()) , etc) and the card can just act like a player ID(unique to each player). Time stamp can be implemented by using os.clock(in theory).

edit: I derped! there is a better way to do the database table. Just do a multidemention table like this: example_table["playername"]={dungeonnumber=false}

#318 electrodude512

  • Members
  • 167 posts
  • LocationEastern USA

Posted 18 July 2013 - 03:45 PM

View PostAshton, on 12 July 2013 - 02:08 PM, said:

View PostPixelToast, on 12 July 2013 - 10:54 AM, said:

why would you need to rewrite the data?
just give each player their own RFID and write other stuff to a database

Each individual card keeps track of the player's progress, As they clear dungeons and/or gain key items/quests/etc the card's data changes.

In theory, yes, I could do that, but I'd have to use the webserver peripheral to connect to a MySQL DB, and even then I have no clue what the query strings are in LUA... (in short, a DB is beyond my lua skills right now, sadly...) :(

Put the database server on a computercraft computer and write your own database program (which you obviously will understand).

Big problem with storing progress on their cards: they can just write all 1's to their card with their own reader or a hijacked one and gain access to anywhere.

#319 MxHn

  • Members
  • 29 posts
  • LocationDuluth, MN, USA

Posted 19 July 2013 - 07:36 AM

@elecorodude512:
good point with the card hijacking!

#320 Seeker14491

  • Members
  • 16 posts

Posted 27 July 2013 - 01:41 AM

I've been having a lot of fun with the Adventure Map Peripheral, so thanks immibis, but I keep getting a specific explosion-related crash. I'm on Minecraft 1.5.2, and have no other mods other than Forge and ComputerCraft. These past few days I've been using the Adventure Map Peripheral to make a "Bomb Survival" map, where "bombs" rain down from the sky and explode shortly after landing on the ground. The "bombs" are just obsidian blocks which I "move" by repeatedly deleting/creating the block, and I have it explode by deleting the block and using the explode() method. Sometimes it works fine, but sometimes it crashes.Previously, I had tried to do the same thing, but with actual TNT blocks, and the same "ConcurrentModificationException" crash kept occuring. It seems more explosions happening at once increases the chance of crashing. Leaving the area while the explosions are taking place then coming back also triggers the crash sometimes.
Here is a log from a crash: http://pastebin.com/raw.php?i=NF8GWDEW
You can see a screenshot of raining bombs and massive destruction here: https://www.dropbox....25_14.53.01.png

Edit: I've updated to Minecraft 1.6.2, and I'm still having the same issue.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users