Jump to content


Photo

Map Scripting


  • Please log in to reply
49 replies to this topic

#41 fistersn

fistersn
  • Members
  • 20 posts
  • Location:Norway

Posted 14 March 2008 - 09:04 PM

I have tried to implented this script for a time now.

*** IF ***
	 Player '<This Player>' has Greater Than  0  unit or structure of type 'ElvenPorter'
*** THEN ***
  Find 'ElvenPorter' Owned by Player '<This Player>' nearest team Team 'PlyrCivilian/teamPlyrCivilian' and reference as UnitRef 'PorterForDeletion'
   Unit 'PorterForDeletion' is removed from the world.
  Show debug string and pause: String: 'AI_DEL_PORTERS'
*** ELSE ***
  Disable Script 'Destroy Porters - Elves'.

How exactely are I supose to do it?

#42 Puzzler33

Puzzler33
  • Members
  • 226 posts

Posted 29 November 2009 - 12:16 PM

This is a really simple way to do it:

*** IF ***
TRUE
*** THEN ***
(Object list) 'Porter': Add 'Elven Porter'
(Object list) 'Porter': Add 'Men Porter'
(Object list) 'Porter': Add 'Dwarven Porter'
(Object list) 'Porter': Add 'Wild Porter'
(Object list) 'Porter': Add 'Mordor Porter'
(Object list) 'Porter': Add 'Angmar Porter'
(Object list) 'Porter': Add 'Isengard Porter'

Then this as another script which is below this first script (so it is read afterward) or part of the first script - just make sure the porters are on the list before referencing them.

*** IF ***
TRUE
*** THEN ***
Find unnamed unit 'Porter' on team 'Team/Player_1' owned by player 'Player_1' and set reference UnitRef'Porter1'
Unit 'Porter1' is removed from the map
Find unnamed unit 'Porter' on team 'Team/Player_2' owned by player 'Player_2' and set reference UnitRef'Porter2'
Unit 'Porter2' is removed from the map

You will find the object lists in Scripting>Object List>Add unit to object list (or something similar)
You will find the referencing script in Scripting>Reference>Find nearest unit .... [461] (or something similar - it is the last in the reference folder)
You will find the delete script in Unit_Other>Damage or remove>Remove unit from map (again perhaps something similar)

I say 'perhaps something similar' because I haven't gone and checked it but I'm sure this is adequate enough direction.

This will work for RotWK worldbuilders, perhaps BFMEII, perhaps not.
Posted Image

#43 Masterbadeend

Masterbadeend

    Yellow_Pete

  • Project Team
  • 797 posts
  • Location:The Netherlands
  • Projects:RCMOD
  •  Mapper @ the RCMOD

Posted 29 November 2009 - 12:19 PM

Only the Angmar builders won't work for BFME 2. It's almost the same game you remember :p .

Posted Image
Posted Image
Thanks to MirkwoordArcher for this great signature and the lovely duck.
Posted Image


#44 Puzzler33

Puzzler33
  • Members
  • 226 posts

Posted 29 November 2009 - 12:27 PM

The script is also assuming you have 2 players and that you have not placed/spawned any unnamed porters closer to the player at the start of the map.
The script is not subroutine, is active and is deactivating. It is based on the RotWK worldbuilder so making it work for BfME II or I will require a little common sense.
:p
Posted Image

#45 Masterbadeend

Masterbadeend

    Yellow_Pete

  • Project Team
  • 797 posts
  • Location:The Netherlands
  • Projects:RCMOD
  •  Mapper @ the RCMOD

Posted 29 November 2009 - 12:42 PM

BTW: can you explain to me what subroutine means :p :) ?

Posted Image
Posted Image
Thanks to MirkwoordArcher for this great signature and the lovely duck.
Posted Image


#46 Puzzler33

Puzzler33
  • Members
  • 226 posts

Posted 29 November 2009 - 03:14 PM

Take a look near the end of this.
I haven't yet properly figured out subroutine or sequential scripts but when I do/when someone tells me, I just hope that it will cut down the number of scripts one has to create when trying to do something.

For now though, I'm not sure how important they are.

Any information, anyone?
Posted Image

#47 Crusard

Crusard

    Local n00b

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

Posted 11 December 2009 - 05:45 PM

Nobody really needs subroutines, they make debugging MUCH harder!
Just keep walking and look away when you see them :p

Posted Image


#48 Puzzler33

Puzzler33
  • Members
  • 226 posts

Posted 12 December 2009 - 03:25 PM

Yay!
...What about sequentials?
Posted Image

#49 Crusard

Crusard

    Local n00b

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

Posted 13 December 2009 - 09:22 PM

Equally useless :p
But that's just my scripting style.

Posted Image


#50 ThranduilElvenking

ThranduilElvenking
  • Members
  • 5 posts
  • Location:Kutaisi, Georgia
  • Projects:BFME: The Ringbearer
  •  One Ring To Rule Them All

Posted 29 July 2024 - 05:32 PM

How to do (Imported) script?


Edited by ThranduilElvenking, 31 July 2024 - 02:37 PM.

Splash.png





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users