Calculator Community > TI-Nspire

Chalex's MC2D Mod

<< < (2/3) > >>

chalex:

--- Quote from: Ryan on May 31, 2021, 09:13:37 am ---Hey! I was wondering if you would like some help? I’ve attempted something like this in the past, but I couldn’t figure out how to open the code up, but considering someone else is doing it I wanted to help. I’ve been programming for about 3 years now so this shouldn’t be that hard to work with. If you would like some help, you can just reply to me here, but it would probably be easier to email me at [email protected] as I will be able to respond quicker there. Also, attacking endermen crash your game, check on line 2018 for a null value ;).

--- End quote ---

Editing the code is easy providing you have the student software, you just need to click Insert>Script Editor>Edit Script. I don't know anything about coding myself honestly, I coded for 5 years in Scratch and now that I'm older I'm translating my knowledge into written code (which meant stopping the use of hardcoding, endless if statements and endless loops - but I at least understand the fundamentals). This is really the first time I've touched real programming and for that reason, I feel I'd frustrate both of us if we both worked on it. You are however free to try and patch something better from my code, but I also don't want to feel guilty of throwing garbage to you to fix :P.

And the error on line 2018, that has something to do with teleportation.


--- Code: ---function AbstractMob:teleport(x, y, distanceX, distanceY, rangeX, rangeY)
    local searchX=0
    local searchY=-100
    local searchNum=math.random(0,1)
    local attempts=0
    while (world[searchX][searchY].solid and world[searchX][searchY+1].solid) and attempts<=9999 do --LINE 2018
        searchNumX=math.random(0,1)
        searchNumY=math.random(0,1)
        if searchNumX==0 then searchX=math.random(x-distanceX-rangeX, x-distanceX)
        else searchX=math.random(x+distanceX, x+distanceX+rangeX)
        end
        if searchNumY==0 then searchY=math.random(y-distanceY-rangeY, y-distanceY)
        else searchY=math.random(y+distanceY, y+distanceY+rangeY)
        end
        attempts=attempts+1
    end
    if attempts<=9999 then
        return searchX, searchY+1
    else
        return x,y,2
    end
end
--- End code ---
The code checks random areas for an area to teleport to within a certain range and if its in a hole for example the attempts var exceeds 9999 then it doesn't move.
I don't think I can reproduce that error as well, perhaps you remember the circumstances that it occured in? I never got an error like that in my testing.

--- Quote from: Eeems on May 31, 2021, 10:37:34 am ---I've split this into it's own topic.

--- End quote ---
Thank you

Nobi:

--- Quote from: chalex on May 29, 2021, 03:08:09 pm ---New update!
I am releasing the v3 version Chalex's MC2D Mod!

Textures look bad due to being taken with an emulator!! They look crisp on hardware!
The photo doesn't do a good job at demonstrating this, I recommend trying it out!
A showcase of all the new features!



Fixes:
 - Crashes that I forgot about


New!:
 - Endermen! They teleport about 7 blocks away when attacked, and move very fast. They drop 0-1 ender pearls.
 - Ender pearls! They are quite buggy because of (my) bad code. They are not game breaking, and the most you can do with them is clip through a 1 block floor. For this reason the bedrock layer is now 2 blocks tall. Improving them is currently not my priority.
 - Scrolling in the creative menu! I was initially worried about the limit of blocks I would be able to add because of the limited space, so now that is not a worry any more!
 - Beds explode in the nether with FIRE! Yes, a very fiery explosion occurs when you try to sleep in the nether... not recommended in a survival world.

Bugs >:(:
 - Sometimes the roof of strongholds spit an error. I have no clue why.

Priorities:
 - Blazes and nether fortresses (or at least the spawner room)

Future:
 - The end!
 - Valuable blocks (block of iron, gold etc)
 - Nether Portals to teleport to the "Nether" layer!

--- End quote ---

Very well done. I was actually trying to make a mod pack that added villages and what not but i realized I dont know how to lua script. I've been waiting for the mod maker ever since. Keep it up  :thumbsup:

chalex:

--- Quote from: Nobi on June 17, 2021, 10:10:49 am ---Very well done. I was actually trying to make a mod pack that added villages and what not but i realized I dont know how to lua script. I've been waiting for the mod maker ever since. Keep it up  :thumbsup:

--- End quote ---
Thanks, it's really nice seeing the feedback I've been receiving! You should give it a shot; if I can do this, certainly anyone can with a bit of spare time (and Stack Overflow...)

lolpro11:
Hi! I'm a dev. A few months ago I made a new version of this minecraft. Here's it is: https://hypixel.net/threads/minecraft-on-a-calculator-v3.4064840/
also, may I merge Jen's work, your work, and my work? Thanks.

Nobi:

--- Quote from: lolpro11 on June 27, 2021, 03:08:48 pm ---Hi! I'm a dev. A few months ago I made a new version of this minecraft. Here's it is: https://hypixel.net/threads/minecraft-on-a-calculator-v3.4064840/
also, may I merge Jen's work, your work, and my work? Thanks.

--- End quote ---

Wow! Very nice work. I was modding the game but apparently I lost the script. Im working on the loading screen currently again. Also, I'm waiting for SkyBlock. :thumbsup:

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version