Jump to content


Photo

Need Script Help


  • Please log in to reply
6 replies to this topic

#1 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 10 February 2009 - 02:00 PM

SEE LAST POST

Hi .This is my first time on Worldbuilder Forum !
I have been making Maps for a while but not to good with Scripting !
I just need a simple one :

Basically i have an island in the middle of a lake
when a player goes to get some treasure in the centre
the WATCHER appears .The player can get the treasure and battle the watcher

I need the Treasure to repawn AFTER the watcher has left

I need the script to reset itself i.e the player leaves the island with the money
after the watcher is gone or flees from the watcher .THEN the money repawns
and when the player goes back the WATCHER reappears !

I got it to spawn a watcher but not reset itself !

I hpoe this is explained propery .
It is basically a TRAP that has TREASURE for bait

There must be only one Watcher at a time .
The TREASURE must spawn after the watcher is gone !

MY STUFF SOFAR ----

EDIT -I GOT IT TO WORK !! :p

SCRIPT 1 - active
*** IF ***
Player 'Player_1' has units in area 'WATCHER'.
*** OR ***
Player 'Player_2' has units in area 'WATCHER'.
*** THEN ***
Run Subroutine 'TEST'.


TEST - subroutine active
*** IF ***
Player 'Player_1' has units in area 'WATCHER'.
*** OR ***
Player 'Player_2' has units in area 'WATCHER'.
*** THEN ***
Spawn object 'WatcherEgg' in Team 'PlyrCreeps/teamPlyrCreeps' at position ((4306.00,2392.00,45.00)), rotated 0.00 degrees .

SCRIPT3 active
*** IF ***
Player 'PlyrCreeps' has units in area 'WATCHER2'.
*** THEN ***
Disable Script 'TEST'.
*** ELSE ***
Enable Script 'TEST'.

I guess i answered my own question :p

Edited by JUS_SAURON, 22 February 2009 - 10:14 PM.


#2 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 11 February 2009 - 01:02 AM

Glad to know you got it to work well :)

To make the treasure spawn, the best way to go would be to use a custom map.ini to change the watcher so he drops gold only when KILLED.
You would pretty much have to make a similar behaviour as the lairs (as you know, they drop gold when you destroy them).

If you like, and already know the basics of map.ini, I could write the code for you, it should be pretty really short.

Posted Image


#3 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 14 February 2009 - 01:41 AM

Thanks - I spawned it at postion x-y when Watcher (creep does not exit)

#4 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 22 February 2009 - 10:24 PM

hi I edited the secondary topic

I created an area in the map where I would like only Heroes to pass

I tried


SHELOB.JPG

*** IF ***
Player '<All Players>' has Greater Than or Equal To 1 unit or structure with Kind is 'HERO' in the area 'PRE_SHELOB'
*** THEN ***
Make area area 'SHELOB' impassable for human player: FALSE
*** ELSE ***
Make area area 'SHELOB' impassable for human player: TRUE

BUT :It works wrt heroes but when they are accompanied by their troops the troops
can pass as the hero nullyfies the impassablilty BAN allowing ALL TO PASS

I want ONLY HEROES IN THAT AREA .

Thanks in advance !

PS map is already on 3rd age

Edited by JUS_SAURON, 22 February 2009 - 10:25 PM.


#5 Crusard

Crusard

    Local n00b

  • Project Team
  • 483 posts
  • Location:Buenos Aires, Argentina
  • Projects:Crusard's Tower Defense
  •  Poor feedback kills mapper.

Posted 23 February 2009 - 02:22 AM

Can't be done.

The only workaround would be to set a reference to any non-hero units that move into the area, assign them to a team, and make a repeating Move command for the referenced units.

Posted Image


#6 Fingulfin

Fingulfin

    I Like Pi3. Do you?

  • Hosted
  • 1,752 posts
  • Location:California, USA
  • Projects:Staying Alive.
  •  This place looks familiar. I can't remember why.

Posted 23 February 2009 - 11:50 AM

1: Make a teleport dummy object+ability.
2: In the teleport filter, make it teleport everything except heroes.
3: If player 1 has units in area, activate the teleporter.
4: Everything but heroes will be removed from the area.

Check this for reference/clarification:
Attached File  Gate_logic.zip   5.33KB   25 downloads
Posted Image
--------------------------------------
"You look like a ghost of your former self..."

#7 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 23 February 2009 - 02:26 PM

Thanks :
I will try other options eg
Only Shelob / Frodo / Gollum allowed in shelob area

Frodo is called RohanFrodo so I can select him from Civilain Unit
BUT my Shelob is called WildShelob_A and my gollum is called GOLLUM_HERO
in my mod .How to select these two without renaming in the mod ??

SOFAR it will work for frodo

Howabout adding :

*** IF ***
Player '<All Players>' has Equal To 1 unit or structure of type 'RohanFrodo' in the area 'PRE_SHELOB'
*** OR ***
Player '<All Players>' has Equal To 1 unit or structure of type 'WildShelob' in the area 'PRE_SHELOB'
*** OR ***
Player '<All Players>' has Equal To 1 unit or structure with Kind is 'NEUTRALGOLLUM' in the area 'PRE_SHELOB'
*** OR ***
Player '<All Players>' has Equal To 1 unit or structure with Kind is 'I_WANT_TO_EAT_YOU' in the area 'PRE_SHELOB'
*** THEN ***
Make area area 'SHELOB' impassable for human player: FALSE
*** ELSE ***
Make area area 'SHELOB' impassable for human player: TRUE


I would like to know what these KINDOF's do
I_WANT_TO_EAT_YOU
NEUTRALGOLLUM

if i add these to Frodo/Shelob/Gollum file it will be easier

I was thinking of giving only these three heroes this KIND OF in the map.ini file
I_WANT_TO_EAT_YOU
I dont know what it does but no other object has it .

it seems to be working but not sure exactly what I_WANT_TO_EAT_YOU does !!


EDIT : NEW PROBLEM :

this work wrt human players so i am going a different route .
as i dont want to DOUBLE POST please see BFME2 Forum

under topic adding power in map.ini / works in Object file

Edited by JUS_SAURON, 23 February 2009 - 07:16 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users