• Register

Hello, I'm Paranoic and I'm obsessed with everything that is related to SpellForce universe! Here you can check my mods (custom campaign) for SpellForce 2 game, I'm planning to create a custom campaign for SF3 in a distant future...

[Socials]:
|ModDB|->|Paranoid_Shaikan|
|NexusMods|->|Paranoic1024|
|Youtube|->|Rockless|
|SoundCloud|->|Paranoic|

  • View media
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. :)


Post comment Comments
Guest
Guest - - 689,207 comments

I try to remake the coop node for SF Dots is there i can put some of my file to see what i try to made

Reply Good karma Bad karma0 votes
Paranoid_Shaikan Creator
Paranoid_Shaikan - - 35 comments

Put your work for "DotP" here:
Indiedb.com

Reply Good karma+2 votes
Guest
Guest - - 689,207 comments

Bro it dosent work this script you.post

Reply Good karma Bad karma+1 vote
Paranoid_Shaikan Creator
Paranoid_Shaikan - - 35 comments

make sure you correctly named the lua file ("_mapname.lua") and your map folder must have two folders: script and dialog. Read the tutorial carefully for one more time, it should work.

Reply Good karma+2 votes
Guest
Guest - - 689,207 comments

Hey bro is the video about Script Spawn redy

Reply Good karma Bad karma+1 vote
Paranoid_Shaikan Creator
Paranoid_Shaikan - - 35 comments

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

Reply Good karma+1 vote
Paranoid_Shaikan Creator
Paranoid_Shaikan - - 35 comments

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 - - 70 comments

Hows life my friend

Reply Good karma Bad karma+2 votes
Paranoid_Shaikan Creator
Paranoid_Shaikan - - 35 comments

Hi, great! What about you?

Reply Good karma+2 votes
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account:

X