Gaming Community
Forum
 
Go Back   D3scene > Hot Games > Warcraft 3 forum > Warcraft 3 Custom Maps > Editing
Register Blogs Live view Downloads Marketplace FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

How to: Create a Creep Revival System

This is a discussion on How to: Create a Creep Revival System within the Editing forum part of the Warcraft 3 Custom Maps category; Introduction This tutorial will explain in great detail, how to create a creep revival system. To understand this tutorial properly, ...


Welcome on D3scene.com! Make sure to register - it's free and very quick! You have to register before you can post and participate in our discussions with 70000 other registered members. Downloads, user profiles and some forums can only be seen by registered members. After you create your free account you will be able to customize many options, you will have the full access to new hacks, latest cheats and last but not least will see no advertisements at all. We would love to see you around in our community!
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 06-04-2008, 08:09 PM
MaRcDk's Avatar
Business Owner




 
Join Date: May 2007
Location: Denmark
Posts: 2,013
Thanks: 37
Thanked 36 Times in 14 Posts
Reputation: 2031
Rep Power: 14
MaRcDk is a rep whoreMaRcDk is a rep whoreMaRcDk is a rep whoreMaRcDk is a rep whoreMaRcDk is a rep whoreMaRcDk is a rep whoreMaRcDk is a rep whoreMaRcDk is a rep whoreMaRcDk is a rep whoreMaRcDk is a rep whoreMaRcDk is a rep whore
How to: Create a Creep Revival System

Introduction

This tutorial will explain in great detail, how to create a creep revival system. To understand this tutorial properly, you will need some decent knowledge of how to use the World Editor - mainly triggers, and variables.

We will be covering how to revive creeps 1 by 1, some time after their death, at their original starting location.

So if you're having any trouble at all creating a revival system, or if you just want to know how its done, read closely, and open the World Editor; this tutorial will be the perfect guide for you.

The "Revive creeps 1 by 1" trigger has minor leaks.



Let's get started

We will be needing the following variables:

Creep_X - A real type variable, with an array size of 1.
Creep_Y - A real type variable, with an array size of 1.
Integer - An integer type variable.




The best way to initialize our creep's starting locations, is to use a trigger with a Map initialization event, and store their data using the help of our variables that we created earlier. We need to store every creeps starting locations so we know where to revive them when need be. We will be using each creeps X and Y values to accomplish this.

"Creep_X" will store all of our creep's X values and "Creep_Y" will store all of our creep's Y values. X and Y work like locations (Points), except they act more or less like offsets (co-ordinates), which work just fine in a revival system like we are going to produce.

"Integer" does something very important which I will explain soon enough.

So open up the trigger editor, and create a new trigger titled "Creep Revival System Initialization", or whatever, and add in the following:

Code:
Creep Revival System Initialization
    Events
        Map initialization
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
            Loop - Actions
                Set Integer = (Integer + 1)
                Unit - Set the custom value of (Picked unit) to Integer
So what have we done so far? We've picked every unit in the playable map area (the area that is inside the black border around your map), owned by Neutral Hostile (the player that usually owns creeps) and set that player's creep's custom values to that of the integer's value, so specific reference can be made in-future.

Why are we using "Integer" to set our creep's custom values?

Well, you see the "Loop Actions" located directly below our Unit Group function?

That loop will "loop" through every creep/unit Neutral Hostile owns, until it loops through the last one.

Thus, "Integer" will keep adding 1 to its current value through every loop and thus when we set the picked creep's custom values, it'll end up looking like the following set of data, which is just what we need:

1, 2, 3, 4, 5, 6... and it goes on, right up until the last creep's value, which is actually the total amount of creeps that were pre-placed in your map.

Our creep's custom values are also important for referring to specific variable array values.

So now we need to set those X any Y variables, to store each creep's starting locations, using a Custom Script code:

Code:
Creep Revival System Initialization
    Events
        Map initialization
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
            Loop - Actions
                Set Integer = (Integer + 1)
                Unit - Set the custom value of (Picked unit) to Integer
                Custom script:   set udg_Creep_X[udg_Integer] = GetUnitX(GetEnumUnit())
                Custom script:   set udg_Creep_Y[udg_Integer] = GetUnitY(GetEnumUnit())
You see those [ ] marks, with "udg_Integer" between them? They are crucial to each creep's X and Y values.

But how do they work? Well, since they have an array value, those variables have the ability to "duplicate" themselves, enabling us to refer back to each "duplicated" value individually. And, since we are using "Integer" as our array index, we'll end up getting Creep_X[1], Creep_X[2], Creep_Y[1], Creep_Y[2], (etc, etc..), with each value referring to each picked unit as they are picked through the loop in the unit group function.

Note that "GetEnumUnit()", refers to each unit that is picked inside the loop; its just the custom script version for picked unit.

---

Now that we've successfully initialized our creeps, we want to create a trigger that actually revives them.

So what's the best event to use in this case? "Unit - A unit Dies".

This event let's the trigger fire as soon as a unit dies, but, we want to be specific do we not? We need to add in a condition that checks who the dying unit belonged to, and if the dying unit was a "summoned" or not.

Why? Because otherwise the "dying unit" could've belonged to Player Red, who just lost a Footman in battle, or Player Blue, who just sacrificed an Acolyte for a Shade.

And why don't we want the dying unit to be a "summoned"? Simply because a summoned unit isn't a unit that was originally pre-placed on your map, and isn't what we want to revive, is it?

So create a new trigger titled "Revive Creeps 1 by 1", or whatever, and add in the following:

Code:
Revive Creeps 1 by 1
    Events
        Unit - A unit Dies
    Conditions
        ((Owner of (Triggering unit)) Equal to Neutral Hostile) and (((Triggering unit) is Summoned) Not equal to True)
    Actions
And now we probably would want to add in a wait to our actions, so the dying creep's revival time is delayed, for obvious reasons.

So what do we do now? Yes, we want to revive, or, re-create the dying creep (notice that I use "triggering unit" - DO NOT use "Dying unit" -> it will be overwritten by any other instances of the trigger).

Add the following action in to your trigger, below the wait action:

Code:
Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at ((Center of (Entire map)) offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))])) facing (Random angle) degrees
You might be wondering "how do I get to the point where I have one massive line of text across my screen"

You will need to note that the unit is created at an offset:



It's best to break the whole unit creation action down, if you're unsure:

Unit-type of (Triggering unit) - We want to re-create the type of unit that has died.

Neutral Hostile - We want to re-create the type of unit that has died, for Neutral Hostile, the "creep owner".

at ((Center of (Entire map)) offset by.. - We want to re-create the type of unit that has died, for Neutral Hostile, the "creep owner", at the Center of the Entire map, offset by our creeps original X and Y location, that we first initialized in the initialization trigger. Remember that our Creep's X and Y value is the key to the "offset".

(Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))])) - Our dying creep will be recreated at the coordinates "Creep_X", and "Creep_Y", which are offset from the Centre of the Entire map. We use the Entire map as a centre, simply because it includes areas outside the playable map area - areas that units cannot reach, and since we are using X and Y coordinates, using playable map area would not give us the exact offset point of the creep's original location. Notice that for array index value, we are using the custom value of the triggering unit - this is because the unit's custom value tells the variable what array value needs to be used.

So, is there anything more left to do?

Yes, there is - we need to set the custom value of the "last created unit" to the custom value of the "triggering unit" (the dead creep).

Why? So if that last created unit dies, the "Creep_X" and "Creep_Y" variables know which array values to refer to again.

So add in the following line:

Code:
Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
You should have all of the following:

Code:
Revive Creeps 1 by 1
    Events
        Unit - A unit Dies
    Conditions
        ((Owner of (Triggering unit)) Equal to Neutral Hostile) and (((Triggering unit) is Summoned) Not equal to True)
    Actions
        Wait 5.00 game-time seconds
        Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at ((Center of (Entire map)) offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))])) facing (Random angle) degrees
        Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))

A quick summary:

> A creep dies, the creep's name is Bobble.

> Bobble has a custom value of 4.

> When Bobble died, a trigger fired.

> The trigger told itself that Bobble wasn't a summoned unit, and that Bobble belonged to Neutral Hostile (Bobble is a creep).

> In no time at all, or, after a few seconds, Bobble was "revived", at the coordinates, "Creep_X[4]", "Creep_Y[4]", which had told the trigger where Bobble's original starting point was.

> The new Bobble also had its custom value set to 4, so that when it dies again, the trigger knows what Creep X & Y array indexes to use.

All credit goes to: Tinki3

----------------------------------------------------------------------------------------------------------------




Hope you all liked it, Please leave a comment, its greatly apreicated Thanks!
Reply With Quote
D3scene
Welcome to D3scene - probably the best location for all Gamers.

To participate in our friendly environment you have to register. After completing registration you will have full access to all threads and features. We care about members and try to make your stay as pleasant as possible. We are unique with the following feature for members - you will not see a single Advertisement!


The best: registration is completely free. It will not cost you a single penny or harm you in any way. You will lose nothing except 1 minute of your time. So why not register? We would be happy to see you around!
  #2  
Old 06-04-2008, 08:10 PM
hendricius's Avatar
Administrator

 
Join Date: Feb 2007
Location: Hamburg, Germany
Posts: 5,691
Blog Entries: 22
Thanks: 70
Thanked 63 Times in 24 Posts
Reputation: 1453
Rep Power: 12
hendricius has much to be proud ofhendricius has much to be proud ofhendricius has much to be proud ofhendricius has much to be proud ofhendricius has much to be proud ofhendricius has much to be proud ofhendricius has much to be proud ofhendricius has much to be proud ofhendricius has much to be proud ofhendricius has much to be proud of
Another awesome guide . Thank you very much marc .
Reply With Quote
  #3  
Old 06-04-2008, 08:16 PM
DoGgY's Avatar
Techno addict

 
Join Date: Jun 2007
Location: Canada, Québec
Posts: 1,563
Blog Entries: 2
Thanks: 5
Thanked 1 Time in 1 Post
Reputation: 916
Rep Power: 7
DoGgY is a splendid one to beholdDoGgY is a splendid one to beholdDoGgY is a splendid one to beholdDoGgY is a splendid one to beholdDoGgY is a splendid one to beholdDoGgY is a splendid one to beholdDoGgY is a splendid one to beholdDoGgY is a splendid one to behold
mhh should I you ? or no ? the question is SHOULD I !!!

well because hend forced me to I will ONLY BECAUSE HE DID !


grood gruide. grood jrob
Reply With Quote
  #4  
Old 06-04-2008, 08:17 PM
MaRcDk's Avatar
Business Owner




 
Join Date: May 2007
Location: Denmark
Posts: 2,013
Thanks: 37
Thanked 36 Times in 14 Posts
Reputation: 2031
Rep Power: 14
MaRcDk is a rep whoreMaRcDk is a rep whoreMaRcDk is a rep whoreMaRcDk is a rep whoreMaRcDk is a rep whoreMaRcDk is a rep whoreMaRcDk is a rep whoreMaRcDk is a rep whoreMaRcDk is a rep whoreMaRcDk is a rep whoreMaRcDk is a rep whore
Quote:
Originally Posted by hendricius View Post
Another awesome guide . Thank you very much marc .
First of all, thanks for commenting all my contributions, Its apreciated very much, just so you know
Oh, and np, im just glad i could help those map makers out there ;b
Reply With Quote
  #5  
Old 05-27-2009, 12:34 PM
Wannabe Member

 
Join Date: May 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Reputation: 0
Rep Power: 1
thanh159 is an unknown quantity at this point
i cant creat the creep >.<"
Reply With Quote
D3scene
Welcome to D3scene - probably the best location for all Gamers.

To participate in our friendly environment you have to register. After completing registration you will have full access to all threads and features. We care about members and try to make your stay as pleasant as possible. We are unique with the following feature for members - you will not see a single Advertisement!


The best: registration is completely free. It will not cost you a single penny or harm you in any way. You will lose nothing except 1 minute of your time. So why not register? We would be happy to see you around!
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make your own WoW server (TBC!) Xirus WoW Private Server Info & Help 582 10-17-2009 07:43 PM
removing restore points DiscoInferno General Chat 1 07-17-2007 04:42 PM
i need help <.< im1337 WoW Private Server Info & Help 0 06-25-2007 03:52 AM
Install and config problems with Magnos. Help me, someone? Pls? araphon1 WoW Private Server Info & Help 7 06-23-2007 06:04 PM


All times are GMT +1. The time now is 02:54 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0 ©2009, Crawlability, Inc.
vBulletin style developed by Transverse Styles