This member has provided no bio about themself...

RSS My Blogs

Hi, here I'm going to show you to how make a little script, that would spawn any kind of unit from SF2 world editor in your map.

First, create a Coop map in SF2 Editor and choose a Teamsetup in a World section.

Tutorial01SpawnScript

Setup a Coop Team system:

Tutorial02SpawnScript]

World Editor automatically created five different teams: tm_Animal, tm_Creep, tm_Human, tm_Neutral, tm_Enemy. You have also a possibility to create more teams if you want. As you can see, tm_Enemy is highlighted in the picture, because I'm planning to show a script, which would spawn an enemy figure in the map, but you have a complete freedom and can make a script, which could spawn a unit of any team, which are listed above.

After these first steps, we are ready to decorate the map and look for some places, where the unit may be spawned.

Tutorial03SpawnScript03

After planning, which unit will be spawned and where the unit will appear, we need to gather some info about him, which will be used in a script code. As you can see, we will need his Type ID and coordinates.

After gathering the data from a World Editor, delete the unit, which is planned for a spawn event. Now we are finally ready to write a code in a script file. But before doing it, we must create a "script" and "dialog" folders in the "map_name" folder!

Tutorial04SpawnScript

Keep in mind, that even if you're not planning creating dialogs in your map, you still must create the "dialog" folder!

A "dialog" folder must consist of these two files (.lua):

Tutorial05SpawnScript

The code, which is written in these two files, is depicted down below:

Tutorial06SpawnScript

Now we are ready to create a Script in the "script" folder (for example: _map_name.lua)

I'm going to show an example, where the unit is going to be spawned without any conditions (it will be spawned at a very beginning of the game).

Tutorial07SpawnScript

The example of the code shows that you must assign a tagname for the spawned unit, level, ID, coordinates and a team.

A more detailed example:

Tutorial08SpawnScript

Then place a "PortalEndPoint" in your map to spawn your heroes and save the map to test it in your game.

Tutorial09SpawnScript

Run the game and click on a "Freegame" mode, then find your map (might be at the very end of the map list) and load it.

Tutorial10SpawnScript

Ta-da! The script should work and a skeleten must be spawned near the rock. :)


Comments
Guest
Guest

Hey bro is the video about Script Spawn redy

Reply Good karma Bad karma+1 vote
Shaikaner Creator
Shaikaner

Here's a little tutorial for a script:
Moddb.com

Reply Good karma+1 vote
Shaikaner Creator
Shaikaner

Hi, I will make a little tutorial here later and post it in my blog section, ok? :)

Reply Good karma+1 vote
Shadowwarrior_256
Shadowwarrior_256

Hows life my friend

Reply Good karma Bad karma+2 votes
Shaikaner Creator
Shaikaner

Hi, great! What about you?

Reply Good karma+1 vote
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.

Level
Avatar
Avatar
Last Online
Country
Lithuania šŸ‡±šŸ‡¹
Gender
Male
Friends
Become friends
Member watch
Follow
Statistics
Rank
14,004 of 663,994
Visitors
2,537 (1 today)
Time Online
1 week
Activity Points
236
Watchers
5 members
Comments
20
Tags
2
Site visits
5,344
Contact
Contact
Send Message
Friends
Dā€“503
Dā€“503 Online
Shadowwarrior_256
Shadowwarrior_256 Online