.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   FritzBot (http://forums.bots-united.com/forumdisplay.php?f=53)
-   -   Transmitter question (http://forums.bots-united.com/showthread.php?t=6741)

enigma1 13-04-2008 15:46

Transmitter question
 
Hello, I have a question about the transmitter script with the antenna rotation after reading the map scripts.

So basically we have 2 helper entities for the antenna. Helper entities 99 and 101. So these 2 entities are linked with actions 4 and 5 and pass the info to the aiscript via the construct commands in the main script.. Ok so actions 4 and 5 then enable and disable action 7, which is an aim to action.

How action 7 is linked to the bots? Is it via the roam actions nearby? (actions 0-3) Is this processed by the fritzbot module automatically? I cannot understand how the bots will perform the aimto action 7 as there is no direct linking to the antenna entity.

Thanks
CK-Chaos

TomTom 13-04-2008 22:17

Re: Transmitter question
 
The action #7 is being used as a boolean accumulator inside the aiscript. aiscripts do not have accums (storage variables) like map scripts do. But there is enough functionality to set/reset an action and to test-if-reset (note the logic). In the wiki these helper actions generally use the invalid action (but I guess an aim action works too) expressly so that bots do not directly interact with it. Note that no camp links to action 7. That then leaves it to be solely used by the aiscript.

Using a "fake" action as an accumulator is discussed in the wiki in Long_Conditional_Tests_In_Fritzbot_ET#Fake_Actions _as_Binary_Accumulators and one is used in FritzBot_Buttons_And_Levers (action 6).

The bindlestiff states in the map script comments that the fake action etc is to avoid exceeding the 64 keyword limit in one of the action tests.



The way the bots actually interact with the antenna rotate is by stepping on/into the invisible new floor trigger (trigger_multiple) that were added to the map script in the game_manager {spawn{. The associated (target'ed) target_script_trigger connects that to a script block that triggers(turns) the antenna. In the antenna's script block are added the construct the helper_ents. These helper_ents are added invisible func_constructibles. Then in the nav fake construct actions (e.g. action 4) are added someplace out of the way and connected by their entnums to the proper /faketois. These fake constructs are minor constructs that are kept inactive so the bots don't try to build them. Each fake construct has an action block in the aiscript that is processed when ever the script "constructs" the func_constructible. Note that we don't use if_construct_built_... in this script block. We don't have a good way to script the func_constructible's destruct in the map script. So each fake func_constructible acts as just a one-way single event communication with the aiscript. To turn something on as well as off (repeatedly) you need 2 fake func_constructible (func_constructs).

enigma1 13-04-2008 22:42

Re: Transmitter question
 
Hi Tom. thanks for the help. Now I am going to study that page but on the last point you mentioned I need 2 constructibles to turn something on/off?. How about the kill <construct> can this be used same way as with the tank? If I understand this should work (theoretically for the same construct) if it is built or not using the if_construct_built_ check.

I am going to try this actually on a map to see what's going on.

TomTom 13-04-2008 23:05

Re: Transmitter question
 
I think I tested killing a construct once and if memory serves me well it was a one time only removing the entity. If that is the case any later attempt to use (construct) the entity disconnects ET back to the main menu with a script error. But try it anyway, it is good practice to crash test things (except your own car;)).

enigma1 16-04-2008 00:04

Re: Transmitter question
 
Hi Tom,

Here is what I see. I created a helper entity pretty standard as the wiki explains. Then I setup an action to be minor construct linked to the TOI (helper_ent_obj). Ok now I add the construct command where the .script signals the .aiscript for the construction and this works no problem. When I kill the entity (and I use kill not remove) I do not see the construct's death method being invoked. I do not have a crash or anything.

I also tried the trigger command to see if it will make a difference the only thing I see is that the method is invoked in this case in the .script but the .aiscript doesn't see it. I tried several things setting up the construct to be constructible_weaponclass 3 as documented but no joy. Of course if I remove it causes a script error as we would expect.

I can post the nodes/scripts if you could help.

Thanks
CK-Chaos

enigma1 16-04-2008 15:10

Re: Transmitter question
 
Seems like the death event can be called only through player actions and not via the .script. That may explain the problem. I was able to trigger it with some damage done during gameplay. I do not see a problem reactivating it in that way.


All times are GMT +2. The time now is 23:58.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.