World Editor help functions

hi, im doing a RPG, and i need help with some function, maybe someone has an idea.
First i need a function, that items cant picked up by someone else, after they got picked up once.
Then “save” shall be greyed out.
No more Exprince for monster 10+ lvl.
If they pick a hero it shouldnt spwan in front of the tavern, but somewhere else.
And something more complicated, after a mob died, i can respwan another one with a function, but after that died too, i want respwan antoher one.
thanks

From least to more complicated :
“No more Exprince for monster 10+ lvl” -

  • You can cap experience that can be acquired from hunting mobs under Advanced -> Gameplay Constants -> Hero XP Gained - Creep Reduction Table. Just set the 10th entry to 0

“And something more complicated, after a mob died, i can respwan another one with a function, but after that died too, i want respwan antoher one.”

  • Run a simple trigger with event -> Unit dies. Condition -> Unit belongs to player neutral hostile. Action -> Create a new unit.
    You what unit and where it spawns depends on what you want to do, you will use triggering unit or dying unit for this one. Might also want to apply some kind of timer cooldown so they do not respawn instantly, or if they do make sure not to spawn them at the postion of triggering unit

“If they pick a hero it shouldnt spwan in front of the tavern, but somewhere else.”

  • The easiest way to handle this one would be to check when a unit is created for the player, attach a unit variable (last created unit) to it (so that you can trigger other scrips on it later), and move the unit (instantly) to the point you want the player to spawn at, move camera to the current location of the variable unit so the player does not have to search for them

“First i need a function, that items cant picked up by someone else, after they got picked up once.”

  • This one would be the most work :
    Specific unit event (or Player owned unit if player can never own another unit that can pick up an item) - Unit aquires an item
    Attach an item variable to matching item
    Attach a player variable to owner of Hero manipulating item

  • Create a new script :
    Player owned unit picks up an item (item variable you set up before)
    Then you will need to check dependency whether owner of triggering unit (or hero manipulating item) equals to player variable you set up, if not
    Issue Drop Item order to Hero manipulating item to drop Item variable you created earlier at position of Hero manipulating item

And it would be nice to drop player a little message saying “This item does not belong to you” or something of the sort.

You should probably also let players disown items, in case they want to give them to someone else, or just replace old item variables after x items have been picked up, you could go either with a number 6 or 8 / 10 to give player some room to maneuver items without worrying about other players picking it up.
Would not be a bad idea to give players a stash where they can keep their items too

This request of yours is not beginner friendly (and I wrote all of it from my memory so some of the points may not even use the exact phrases found in the editor) - I encourage experimenting with the editor but you may want to start with something less complicated and then start dabbling with more advanced triggers when you already have the idea of the basics

1 Like

Thanks, good help.
Also did some beginner friendly, i got a RPG and need functions now.

i got the tavern thing very easy and fast.
With the 10+ lvl i ment, if someone is lvl 40 and enemy is like 50 it should give no exp.

The other one doesnt work with function if i do a function a unit is killed, and respwan another, i cant do a function if this new spwaned is killed again, to get a different one again.
And the item one is realy hard.