How do I init custom variables for link?

This is the place for discussion and support for LunaLua and related modifications and libraries.
Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on topic/appropriate?
-Are you posting in the right forum/following the forum rules?
Shadowblitz16
Fighter Fly
Fighter Fly
Posts: 60
Joined: Tue Aug 09, 2016 1:41 pm

How do I init custom variables for link?

Postby Shadowblitz16 » Sun Jun 25, 2017 3:06 pm

hello I am currently wanting to make a modification of SMBX link to make him more like his Z2 counterpart but I'm not sure how to start.

first of all I need to know how to exactly set this script up. do I create a character api or just modify him globally?
I also need to know how to run code when the character switches to link and not at the start of the script.

this is my current code

Code: Select all

function onStart()
	if (player == CHARACTER_LINK)
		Defines.jumpheight          = 6
		Defines.jumpheight_bounce   = 2	
		Defines.player_runspeed     = 5
		Defines.player_link_fairyVineEnabled = false
		
		player:mem(0x14, FIELD_WORD, 0.1)		
	end
end

PixelPest
Link
Link
Posts: 7116
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: How do I init custom variables for link?

Postby PixelPest » Sun Jun 25, 2017 3:35 pm

First of all, onStart() is only called at the beginning of the level, so instead you need to use onTick(). Secondly, player is an object (from the Player class) which represents player 1, not really a value; you need to test for player.character. In terms of that mem call, I don't think it's doing what you think it is. 0x14 is a timer, so it counts down to a value and then triggers something else. What you should do is try debugging it to see what the max. value is, via Text.print(), and then from there you can check if player:mem(0x14, FIELD_WORD) is equal to that max. value and if so set it to a lower value since I assume you're trying to make the cooldown shorter

Shadowblitz16
Fighter Fly
Fighter Fly
Posts: 60
Joined: Tue Aug 09, 2016 1:41 pm

Re: How do I init custom variables for link?

Postby Shadowblitz16 » Sun Jun 25, 2017 4:13 pm

PixelPest it seems like that is not actually is sword cooldown like what the lunalua wiki says..
it seems that is just his animation timer.

do you know how I can force link to stab again?


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 3 guests