Thread: Items
View Single Post
  #2    
Old January 7th, 2010, 12:39 PM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 21
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
I've tried to make one item that executes scripts. I called a script from ASM in a item, if the type is set to others - the script doesn't work but when it was set to 'Use-Of-Select' type. The bag exited and the script worked but it kept running. So, I guess the bag's environment isn't compatible with the scripts - this is what I first thought too until I saw Juan's explanation of script execution. I've never initialised the script structure. So, I'll try again and post some discoveries.

Ah, I found a way to show a message box from examining the coin case.
Code:
	push {r4-r5, lr}

	mov r0, #0x0 @ Textbox left position*
	mov r1, #0x0 @ Textbox top position*
	ldr r2, =0x0890000B @ Text data**
	ldr r5, .DisplayTextFunc
	bl .BranchLink

	pop {r4-r5}
	pop {r0}
	bx r0

.BranchLink:
	bx r5
* I'm not sure about this as I haven't really messed with it. It could be the other way round.
** The text data must end with '\c\h09'. The wait for keypress code or else it'll display the text and close down.
__________________

Last edited by ZodiacDaGreat; January 7th, 2010 at 05:36 PM.
Reply With Quote