Jump to content


Photo

Replace Object via script


  • Please log in to reply
8 replies to this topic

#1 Echo

Echo

    T3A:Online

  • T3A Staff
  • 1,069 posts
  • Location:Germany
  • Projects:Lot3A
  •  ~~
  • Division:BFME
  • Job:T3A Moderator
  • Donated

Posted 07 October 2014 - 05:44 PM

Hey,

 

does anyhone know if it is possible to actually replace an object through worldbuilder if the *IF* conditions are true? I know there is a way to remove objects from maps and spawn a new one on a certain waypoint, but I'm curious if it is possible to skip this and replace an object directly.

 

Does anyone know?


26285.png


#2 -SilverBane-

-SilverBane-

    Inactive Noob

  • Project Team
  • 474 posts
  • Location:Bucharest
  • Projects:Life
  •  Mapper & Coder

Posted 08 October 2014 - 07:23 AM

Well I haven't met any script wich would do a thing like this but you can use: Spawn at an object type, then another action of the script: Delete X object....i find it quite easy...


2qm3dd5.jpg


#3 Echo

Echo

    T3A:Online

  • T3A Staff
  • 1,069 posts
  • Location:Germany
  • Projects:Lot3A
  •  ~~
  • Division:BFME
  • Job:T3A Moderator
  • Donated

Posted 09 October 2014 - 05:35 PM

Well I haven't met any script wich would do a thing like this but you can use: Spawn at an object type, then another action of the script: Delete X object....i find it quite easy...

 

I know that, but in this case it isn't helpful unfortunately :(


26285.png


#4 hoogan

hoogan
  • Members
  • 47 posts
  • Location:Center of the third largest continent on Earth

Posted 02 November 2014 - 10:40 PM

Could you be more specific as to Why this is not helpful?

If it was clear what you wanted to do, perhaps there is a way.

Such as...

1. Is it a bridge or other walkable object - causing pathing issues?

2. Is it because the object to be replaced is a unit.. ie: moving and not at a fixed location?

3. Is it because the new item does not "fit" in the same location?

4. Is it because the new object appears away from the old object at the assemby point for new units exiting a building?

These are all solvable.

More information would allow more help.



#5 Echo

Echo

    T3A:Online

  • T3A Staff
  • 1,069 posts
  • Location:Germany
  • Projects:Lot3A
  •  ~~
  • Division:BFME
  • Job:T3A Moderator
  • Donated

Posted 03 November 2014 - 07:34 PM

I want to replace a certain object in a base if a certain model condition is present.


26285.png


#6 hoogan

hoogan
  • Members
  • 47 posts
  • Location:Center of the third largest continent on Earth

Posted 04 November 2014 - 02:33 AM

Oooo.... This can complicate the issue.

Questions:

1. Will this be for a single map or for multiple maps?

1.A.   If a single map, will the base always be at that location, or can it be at a different location depending on player positions?

 

2. Will the replacement of the object take place before the base is built up or after?

2.A.  If after, will the new object be influenced by any upgrades of the original object?

 

3. Is orientation important? ie: facing a certain direction such as "Front Towards Enemy".

 

After running through these questions and the problems they create, My initial thought would be to use INI code to create an OCL of the new object with all needed upgrades and effects and drop it in place - oriented same as the original object with the model condition as the trigger. No need for scripts for that, just code it into the original object. Presence of the model condition triggers the OCL. Works for that object in any base in any location. Then use the presence of that model condition to trigger "kill" the original object. The visuals of that could be a little jerky and "sudden", but you could mask that by throwing up some dust and smoke too.

 

Supplement: I use this method to create "burned" floor draws and permanent debris when buildings are destroyed. Set them to be "Cleared By Build" so they don't prevent rebuilding. After all, war is messy.


Edited by hoogan, 04 November 2014 - 02:51 AM.


#7 Echo

Echo

    T3A:Online

  • T3A Staff
  • 1,069 posts
  • Location:Germany
  • Projects:Lot3A
  •  ~~
  • Division:BFME
  • Job:T3A Moderator
  • Donated

Posted 04 November 2014 - 02:50 AM

1. Will be for multiple maps (all armies will have one base affected), but the base will always stay at that position and doesn't depend on player position. One base for every faction, maybe two bases.

 

2. It should be replaced before it is built / certainly not after it has finished building up. After that, the object will not be affected by any special upgrades.

 

3. Orientation should be the same as the original object.

 

OCL would be the last solution... as you said, the effects would not really look great. :p


Edited by Echo, 04 November 2014 - 02:50 AM.

26285.png


#8 hoogan

hoogan
  • Members
  • 47 posts
  • Location:Center of the third largest continent on Earth

Posted 04 November 2014 - 03:11 AM

Given the parameters you mentioned, it sounds like the decision is made either at the start of the game, or within the first few seconds.

I suggest you create a separate "new" base with its "new" object for each faction. Then use a single worldbuilder script to decide which base is to be the starting base for each faction based on the model condition of whatever object is deciding. The starting fortresses and porters might need to already be there, but that script would run once at the beginning of the game possibly deleting them and substituting the "new" bases. From then on, only the selected base would be built... wherever it is supposed to be.

You could avoid any jerky or sudden flickers of the starting fortresses and porters caused by the replacement of the starting base by having the camera looking somewhere else at the beginning of the game.. or maybe a very dark screen with some text describing how horrible the coming battle was going to be, then fading in the light.



#9 Echo

Echo

    T3A:Online

  • T3A Staff
  • 1,069 posts
  • Location:Germany
  • Projects:Lot3A
  •  ~~
  • Division:BFME
  • Job:T3A Moderator
  • Donated

Posted 04 November 2014 - 02:51 PM

Sorry for not mentioning that, but I'm modding for BFME 1. :p

 

No porters, no fortresses, but castles, camps, outposts and farms instead :p


26285.png





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users