Scripting Bug: Player units can't spawn into gaia units

Up until recently, artifact class units (class 1) had the ability to spawn a gaia dead unit from a player unit.

Example 1: Create relic from monument by enabling relic carts (artifact class), setting the hp to 0. The cart dies upon creation, leaving a relic as the dead unit.

#const RELIC_CART 1304
	
effect_amount ENABLE_OBJECT RELIC_CART ATTR_ENABLE 0
effect_amount SET_ATTRIBUTE RELIC_CART ATTR_TRAIN_LOCATION 826
effect_amount SET_ATTRIBUTE RELIC_CART ATTR_TRAIN_BUTTON 1
effect_amount SET_ATTRIBUTE RELIC_CART ATTR_HITPOINTS 0

Example 2: Spawn a bush underneath a TC when it is completed. Take the trophy under the TC and set the hp to 0 and dead unit to a convertible torch (artifact class). The convertible torch dies and spawns a bush as the dead unit.

#const TROPHY 1649
#const TORCH_C 854
effect_amount SET_ATTRIBUTE TROPHY ATTR_HITPOINTS 0
effect_amount SET_ATTRIBUTE TROPHY ATTR_DEAD_ID 854
effect_amount SET_ATTRIBUTE TORCH_C ATTR_HITPOINTS 0
effect_amount SET_ATTRIBUTE TORCH_C ATTR_DEAD_ID 302

Neither of these work in the current build.

not sure about the class 1, but the bush spawn should work because thats what gurjara is. it spawns a gaia bush unit

That’s a DAT side way of doing it though, not an RMS, which is what is broken here by the looks of it.

I think even the scenario/rms side does the samething back end with the engine. Dat in genie is simply just bunch of data that game reads so in essence they all do the samething telling game what to do, thus if task/class is missing its likely all of them will not work.

Yes, but @TheMadCADer3831 is using dead units and trying to have a player unit die into a gaia unit. That’s not how AGE does the berry bushes, which is through spawning units. So I don’t think they are actually done the same way.

i got this thread mixed up with the other one with missing attack class to do bonus damage and thought its that thread

1 Like

I tried getting around this limitation by using xs, but xs doesn’t work either. Even though the command below is exactly the same as the corresponding command specified in AGE, nothing happens.

void main()
{
    xsEffectAmount(cSpawnUnit, 83, 619, 2); //successfully spawns 2 villagers from the TC
    xsEffectAmount(cSpawnUnit, 59, 619, 2); //tries to spawn 2 forage bushes from the TC, but nothing happens
}

check how gurjaras civ bonus is done

The screenshot in my post above is the Gurjara bonus. I’m demonstrating that it doesn’t not work via scripting when using the same command.

not just the effect alone there might be other things involved, and those maybe need to be replicated as well

since genie is really just holding a bunch of data and the game is actually executing it, if it works for gurjaras it should work for the rest unless its hard coded.

you can test hard coded or not by switching the effect/tech ID with same end effect, if it still spawn then its not hardcoded

I noticed this a while back will screwing around with the editor. (Not scripting. Just triggers.) While in the editor, I had to force the player to become gaia and THEN become any gaia object. (There has to be a transition from Player to Gaia. I used replace object at the time and it works just fine.)

Edit: Note that it HAS to be specific player (gaia) objects for it to replace correctly. Check the editor to see what is valid by using a player object that is ALSO used by gaia. Example: Flags works.

This is because berry bushes don’t exist in the dataset for civs other than gaia. If they exist, your code works. I know that doesn’t help you in RMS - but it’s why you see different results with xs above.