H4: Event Teleport?

Maps and the art of mapmaking.

Moderator: Moderators

Steven Aus
Scout
Scout
Posts: 191
Joined: 08 Feb 2006
Location: Australia

H4: Event Teleport?

Postby Steven Aus » Sep 13 2016, 22:44

Is it possible to teleport a hero based on what happens in a placed event? I thought I'd seen it in some maps, but I think I may have been mistaken. I looked up various combinations of text regarding h4, heroes4, homm4 and teleport, event teleport etc., but I didn't come up with anything apart from the combat spell "Teleport", or teleport related to Town Gate.

Say I give a choice in an event where you choose 1 option out of all of them, and I want to teleport the hero to a different pocket area for each of them. Do I have to set up multiple One-Way Monoliths where you only get access to one, or is there another way to do it?

Looking forward to your replies!

Steven Aus
Scout
Scout
Posts: 191
Joined: 08 Feb 2006
Location: Australia

Re: H4: Event Teleport?

Postby Steven Aus » Sep 13 2016, 23:08

I guess the easiest way (that relies on player choice, rather than a teleport from an event condition) would be to have a single One-Way Monolith Entrance and multiple One-Way Monolith Exits.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 488
Joined: 21 Jul 2014

Re: H4: Event Teleport?

Postby iLiVeInAbOx05 » Sep 14 2016, 1:40

You can simulate teleporting using scripting. I haven't done it myself, so I don't have any examples to give you.

Personally I would just go with a one way teleporter for the different possible areas. It's simple and since it's just for a setup area, it doesn't seem like you need any complex scripting. Just block the teleporters, and when the player makes the choice, open the teleporter of your choice by deleting the object blocking it.

If you're dead set on making it appear the hero teleports on an event, I believe Karmakeld has actually done the scripting to simulate a hero changing location, so he can possibly chime in to help you out :)

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 923
Joined: 12 Nov 2011

Re: H4: Event Teleport?

Postby Karmakeld » Sep 14 2016, 7:59

I thought I heard someone calling out my name ;)
Well I know someone did it in a well renowned map once (can't remember the author or map name atm), but on to the way to do it (I asume it's just a stand alone map - I'm doing it with a carried-over hero, which is a different story). On the hero you wish to teleport, you set up a script on the hero's Army properties (not the hero's properties), to trigger change owner to neutral, when the placed event is triggered. The same is done on the hero you wish to be teleported to (change to player color). If you want e.g. 4 options, you trigger the change on hero 1, hero 2, hero 3 or hero 4. So in the placed event you ask your question and trigger the action linked to the choice. If choice 1, you trigger hero 1 etc. You could use variables, but it might just be easier for you to use the 'ask question' script. If yes, trigger linked change and remove script. If no, ask the next question. If you want the questions to start over, you should use a triggered script for this, rather than place the questions in the placed script. So if player says no to the last option, you trigger the script once more.
It's worth noticing this is a lot easier the lower level the hero is, as it makes it easier for you to duplicate the hero (simulate the teleportation). So if beyond level 1, you'll need to also check for level and skills and add that to the extra heroes. So a level 1 hero is the easiest to use and the higher the level, the more complex it gets. But the basic scripting isn't complicated. So good luck with it.
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground

Steven Aus
Scout
Scout
Posts: 191
Joined: 08 Feb 2006
Location: Australia

Re: H4: Event Teleport?

Postby Steven Aus » Sep 15 2016, 20:56

I won't be doing any more map-making. I liked doing a bit of map-making in the old days of H2 and H3, but not any more.

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 923
Joined: 12 Nov 2011

Re: H4: Event Teleport?

Postby Karmakeld » Sep 16 2016, 18:59

?? Wow. What suddenly changed your mind?
I'm silent in seven languages - and I got all my familys fear.

Everytime you throw dirt, you loose a little ground

User avatar
jeff
Moderator
Moderator
Posts: 3671
Joined: 06 Jan 2006

Re: H4: Event Teleport?

Postby jeff » Sep 17 2016, 15:44

It's been awhile, but you can do a triggered event that changes the owner to neutral then based on your conditionals trigger a second change of owner event on the stack you want to now be the player's. This should be done early in the map before key artifacts and equipment are important. It would be nearly impossible to keep a player from reloading, transferring all important artifacts and splitting the stack and replay the event. Another reason for doing this early; the change owner is placed on the army not the hero; if any creatures are added to the army and the stack splits; it is likely the stack that does not include the hero will be the one that changes owner. The hero's army rarely, if ever, retains that script if the army splits.
Mala Ipsa Nova :bugsquash:

Steven Aus
Scout
Scout
Posts: 191
Joined: 08 Feb 2006
Location: Australia

Re: H4: Event Teleport?

Postby Steven Aus » Sep 19 2016, 10:03

Well, it could be I'm low on testosterone, something that's been identified recently (creative drive is known to be related to sexual drive). I had just started map-making, but I didn't feel I could continue, which may be related to a low testosterone and creative drive.

Anyway, sorry for the sudden shift, I might get back to it if I get more in balance. :)
Last edited by Steven Aus on Sep 19 2016, 14:55, edited 1 time in total.

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 923
Joined: 12 Nov 2011

Re: H4: Event Teleport?

Postby Karmakeld » Sep 19 2016, 19:05

How about taking a viagra pill about one hour before you intend on doing some mapmaking ;)
I'm silent in seven languages - and I got all my familys fear.

Everytime you throw dirt, you loose a little ground

User avatar
Pol
Admin
Admin
Posts: 7750
Joined: 29 Nov 2005
Location: IN SOMNIS VERITAS
Contact:

Re: H4: Event Teleport?

Postby Pol » Sep 19 2016, 20:01

Steven Aus wrote:Well, it could be I'm low on testosterone, something that's been identified recently (creative drive is known to be related to sexual drive). I had just started map-making, but I didn't feel I could continue, which may be related to a low testosterone and creative drive.

Anyway, sorry for the sudden shift, I might get back to it if I get more in balance. :)


Put your mind to something else, take a pause! :D
"We made it!"
The Archives | Collection of H3&WoG files | Older albeit still useful | CH Downloads
PC Specs: A10-7850K, FM2A88X+K, 16GB-1600, SSD-MLC-G3, 1TB-HDD-G3, MAYA44, SP10 500W Be Quiet

User avatar
jeff
Moderator
Moderator
Posts: 3671
Joined: 06 Jan 2006

Re: H4: Event Teleport?

Postby jeff » Sep 19 2016, 20:03

Viagra has no affect on testosterone levels. Now let's keep the thread on topic please without the man issues.
Mala Ipsa Nova :bugsquash:

Steven Aus
Scout
Scout
Posts: 191
Joined: 08 Feb 2006
Location: Australia

Re: H4: Event Teleport?

Postby Steven Aus » Sep 19 2016, 22:15

Well, I was just answering the question about why I suddenly said I don't want to do map-making any more. :) ;) Although I agree that if I'd provided a reason again I probably wouldn't have been as specific. ;)
Last edited by Steven Aus on Sep 19 2016, 22:32, edited 1 time in total.

User avatar
jeff
Moderator
Moderator
Posts: 3671
Joined: 06 Jan 2006

Re: H4: Event Teleport?

Postby jeff » Sep 19 2016, 23:14

:D
Mala Ipsa Nova :bugsquash:

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 923
Joined: 12 Nov 2011

Re: H4: Event Teleport?

Postby Karmakeld » Sep 20 2016, 20:20

To add to Jeff's first on topic post, I forgot about the splitting issue. You can however set up a script that checks if the hero/army has split (I can post it if you like). If you use Equilibris editor, you can use the variable Max_Armies and limit it to 1 or the number of starting troops and thus prevent the player from splitting. Ofcourse combining armies will leave room for a new troop/split. You can also increase/re-set the max army value to 8 again, once the teleport has taken place.
I'm silent in seven languages - and I got all my familys fear.

Everytime you throw dirt, you loose a little ground

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 923
Joined: 12 Nov 2011

Re: H4: Event Teleport?

Postby Karmakeld » Aug 30 2017, 11:04

Steven Aus wrote:Say I give a choice in an event where you choose 1 option out of all of them, and I want to teleport the hero to a different pocket area for each of them. Do I have to set up multiple One-Way Monoliths where you only get access to one, or is there another way to do it?

Looking forward to your replies!


In light of recent modding activety on heroescommunity.com I hope it's okay I revive this tread with a new alternative answer.
I found you could do something similar to setting up muliple one way portals, but keep them 'less visible'/obvious if that would be the intention.
What I mean is that you can mod the teleporter to look like another object. It could be any adventure object like a dwelling or quest hut or a landscape object like a tree or a stone, depending on whatever story/condition you'd wish to link to it (can't help but thinking of the transition key in Harry Potter looking like a pair of boots - that would be possible). Depending on the choice you could simply bomb the remaing portals, leaving just the choosen one. Compared to 6 portals with quest gates/guards this could take up less place.
Equilibris even made an invisble block which could also be used in relation to block the area untill choice has been made.
If this has any interest I could share some of my objects/help mod the desired objects.
I'm silent in seven languages - and I got all my familys fear.

Everytime you throw dirt, you loose a little ground


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 4 guests