FaolanBlade

Villager
Member
Joined
Jun 3, 2018
Messages
8
Reaction score
1
First Language
english
Primarily Uses
RMMV
Hello,

These 2 script calls appear to be causing errors, I assume syntax is the issue, any help would be appreciated.

1.
Objective: Set Actor (event ID - 10) Hp to event x coordinate
$gameActors.actor((this.character(0)-10)).setHp(this.character(0).x)

2.
Objective: Set Actor 25's Tp to price of item using Actor 25's Hp as the item ID
$gameActors.actor(25).setTp($dataItems(($gameActors.actor(25).Hp)).price)

Thanks
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,141
Reaction score
6,289
First Language
English
Primarily Uses
RMMZ
Hello,

These 2 script calls appear to be causing errors, I assume syntax is the issue, any help would be appreciated.

1.
Objective: Set Actor (event ID - 10) Hp to event x coordinate
$gameActors.actor((this.character(0)-10)).setHp(this.character(0).x)

2.
Objective: Set Actor 25's Tp to price of item using Actor 25's Hp as the item ID
$gameActors.actor(25).setTp($dataItems(($gameActors.actor(25).Hp)).price)

Thanks
1. The interpreter's character() function returns an event. You're trying to subtract 10 from an event. An event is not a number you can do maths with. :)

2. The hp property doesn't have a capital H, and $dataItems is an array, not a function.
 

FaolanBlade

Villager
Member
Joined
Jun 3, 2018
Messages
8
Reaction score
1
First Language
english
Primarily Uses
RMMV
The interpreter's character() function returns an event. You're trying to subtract 10 from an event. An event is not a number you can do maths with. :)
Perfect, am new to programming so lots of trying things out
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,141
Reaction score
6,289
First Language
English
Primarily Uses
RMMZ
Where did you get the idea that character worked like that, out of curiosity?
 

Latest Threads

Latest Posts

Latest Profile Posts

Ooops ended up trying out making my own A2 tile page instead of testing doors everywhere. Went well so far I think.
I guess I'm done making a blue squirrel's life difficult for posting new threads on different forums.
That's just for today so don't get used to this, squirrel-ish friend! :p
Got new hard drive, now trying to install the softwares I lost to the dead drive, and more than half of them won't install because they're already installed on the dead drive, and uninstallers won't run because they can't find where their programs are installed. So I take it having a drive die on you screws you in more ways than just data loss. >:\
PC got fixed finally. Back online again. Turns out I have no business trying to self repair pcs because it was getting to like 176F / 80C. Shop installed a totally new cooling system and now it runs fine and is super quiet.
When you're making major progress, but have to stop to go to work.

Forum statistics

Threads
131,486
Messages
1,220,213
Members
173,225
Latest member
ZecaVn
Top