HOMM5: Moving boats via script

Maps and the art of mapmaking.

Moderator: Moderators

Milos Gajic
Leprechaun
Leprechaun
Posts: 47
Joined: 18 Feb 2015
Location: Serbia

HOMM5: Moving boats via script

Postby Milos Gajic » Jul 6 2015, 11:27

Is there a way to move boats via script?

I tried SetObjectPosition("NameOfTheBoat", x, y, floor); but the game crashes!!!

Why doesn't this work when for example enemy heroes or stacks of creatures can be moved this way?

User avatar
markkur
Demon
Demon
Posts: 335
Joined: 14 Oct 2011

Re: HOMM5: Moving boats via script

Postby markkur » Jul 16 2015, 20:16

Milos Gajic wrote:Is there a way to move boats via script?

I tried SetObjectPosition("NameOfTheBoat", x, y, floor); but the game crashes!!!

Why doesn't this work when for example enemy heroes or stacks of creatures can be moved this way?


idk, thought I'd make sure you are setting to the correct floor? And did you try the movement on the same level first?

The "name of boat" throws me. What do you read when it is placed on the map?

Anyway, as I said idk but I thought of a work-around, if wanted. Since you can "remove a land block" the boat could be waiting...past the block.

Milos Gajic
Leprechaun
Leprechaun
Posts: 47
Joined: 18 Feb 2015
Location: Serbia

Re: HOMM5: Moving boats via script

Postby Milos Gajic » Jul 17 2015, 7:51

markkur wrote:idk, thought I'd make sure you are setting to the correct floor? And did you try the movement on the same level first?

The "name of boat" throws me. What do you read when it is placed on the map?

Anyway, as I said idk but I thought of a work-around, if wanted. Since you can "remove a land block" the boat could be waiting...past the block.


The correct floor doesnt matter, I witnessed game moving an object to the underground into the cave wall (into unreachable area not lowered at all)... Be that as it may, the floor was correctly set.

The "name of the ___" is just the name you give to any object that you wish to manipulate via script, the actual name in my script was "ship1" or "boat1" or something similar. That's also not the problem.

I already made it differently, but a bit different from what you said. Since my ship was to be secret, hiden, and then obtained through a very specific action it was not very wise to make it visible to the player, so I just set several removable rocks on top of it and when the right conditions are met RemoveObject script triggers and the ship is visible and ready to be boarded :D

BUT, that was not the way I wanted it to be done so I asked here if anyone knew could boats be moved some other way, but I guess there's no other way... :(

User avatar
markkur
Demon
Demon
Posts: 335
Joined: 14 Oct 2011

Re: HOMM5: Moving boats via script

Postby markkur » Jul 17 2015, 11:07

Milos Gajic wrote: BUT, that was not the way I wanted it to be done so I asked here if anyone knew could boats be moved some other way, but I guess there's no other way... :(


Yeah I know, but since I'm the only one "trying" to say things to keep your problem-solving moving...I'm the bottom of the barrel. :D

The last thing I'll say is syntax. make absolutely sure your boat script above has no extra spaces etc. when compared to one that works. And dude, I know that it is only a reminder but I've read scripters get very upset because as experienced as they were, they overlooked it for a time.

Cheers


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 5 guests