Quake3World.com Forums
     Programming Discussion
        Trigger_teleport toggle on/off or Movable?


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: Trigger_teleport toggle on/off or Movable?

Grunt
Grunt
Joined: 06 Dec 2009
Posts: 69
PostPosted: 12-07-2014 07:18 AM           Profile Send private message  E-mail  Edit post Reply with quote


Hi,
I am wonder, is it possible to make Trigger_teleport toggle on/off or Movable?
My point is to either make it able to be triggerable by other entity ex: func_delay so it could be on or off on the map, or at least trigger it to move away same as func_door function does.

is it possible to write such new functionality in my own mod source or not?

I've been looking forward to it, but couldnt make it to happen,
I have problems with code that check for last target entity key

for ex: an func_delay entity triggered by button holds an key of: toggle_tele 0 which would tell the targeted trigger_teleport to switch to disabled status
other func_delay triggered by other button would hold key toggle_tele 1 which would set same trigger_teleport entity to be enabled again and teleport any player to its desired location.

if that would not be possible, then my last hope is to set Move function so whole trigger_teleport would move out of its original location on demand.

if anyone knows something about this idea, please answer :)



_________________
Image
http://www.q3-sg.tk


Top
                 

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 12-07-2014 08:50 AM           Profile Send private message  E-mail  Edit post Reply with quote


What you're looking for does not exist in vanilla quake 3 :) you'll have to code it yourself in a mod or for your standalone game ...

As for moving the trigger_teleport, I think it would be way more simple to simply add an on/off switch that activates when triggered (use the 'targetname' of the trigger_teleport, and add the switch / spawnflag "start off" like on func_doors).



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 44138
PostPosted: 12-07-2014 12:52 PM           Profile   Send private message  E-mail  Edit post Reply with quote


I haven't tested this myself, but you could test to see if enabling/disabling a teleporter trigger works in my EntityPlus mod. You can use the new target_unlink entity for that. A manual is available on the EntityPlus website. The source code of the mod can be found there as well, in case you want to copy the functionality. Feel free to do so. That's all assuming it works of course :)




Top
                 

Grunt
Grunt
Joined: 06 Dec 2009
Posts: 69
PostPosted: 12-07-2014 03:05 PM           Profile Send private message  E-mail  Edit post Reply with quote


D-Meat, that is what I am trying to do so, write my own mod, it has to work with vanilla q3 and not as a standalone executable like Urt, to make such on/off is way more simple in saying that then actually doing it to work, I am still on very basic level of c++ coding for quake3arena source.
Also such new functionality needs to be set as an addon for that entity and not interferee with original functionality of it, then it could be easilly added into every other mod without messing up with basic functions

Eraser, I'vee been looking a little at your source codes, but I didnt noticed new entity for unlink, I will check it out then and see what I can achieve with it.

interesting and detailed manual pdf Er, I've read it all ;)

thx for answers



_________________
Image
http://www.q3-sg.tk


Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 44138
PostPosted: 12-08-2014 12:27 AM           Profile   Send private message  E-mail  Edit post Reply with quote


Quake3 is not C++ though, it's just plain vanilla old C :)

Also, check line 675 of g_target.c
The G_ToggleTargetsLinked function can be found in g_utils.c, line 400. You might want to remove the whole if (ent->target2) { } block there, because target2 is an EntityPlus specific thing. Same thing for the if statements that refer to targetname2.

Note that the use of target_unlink is a bit more generic than toggling a trigger on and off, but in practice, it's good for what you want.




Top
                 

Grunt
Grunt
Joined: 06 Dec 2009
Posts: 69
PostPosted: 12-08-2014 09:09 AM           Profile Send private message  E-mail  Edit post Reply with quote


Ok I've tested your MOD functions
All is working very well
basically, your MOD have everything that I need for my Stargate map
too bad you goes the way where multiplayer is not supported anymore, thats why with your permission I would like to copy your functions to my own MOD which basically will be an vanilla q3 with additional features that will only work in advanced way if special key's would be set on the map itself.

I love target_modify, with this I can simulate the active Iris/shield, when the shield is activated on the other side, the teleport on your side will be changed and lead to a death place instead of usual location

Also target_unlink works lovely, it does what I wanted, it toggle trigger_teleport on/off

I like also target_gravity entity, I could use it on space maps for example, while playing on a spaceship you could go out to the space where gravity would change to 0 and enter the other passage to the ship where gravity would change back to normal

btw, will those changes work with normal AAS for bots, I mean, will bots play as usual and be attracted by trigger_teleport to go to the other side while it will be unlinked, or what will happen if trigger_teleport will have changed destination by the target_modify ? :)

I could always put the original entities such teleports to lead to its original locations and blocked by solid/invisible func_door on the floor, so that the AAS would create its paths for the bots, or I would simply make the external AAS file with secondary map version specially for bots.

Anyway Eraser, great work on your MOD, you spared me a lot of time and efforts of making exactly same modifications I wanted :P

is there any link from where I can download whole MOD source files in a ZIP ?
also which program did you used to write/compile the MOD ?
I am using "Microsoft Visual C++ 2008 Express Edition".

I could create some nicely logic map for your MOD where player would need to fight the bots, collect artefacts and find its path to finally activate the Stargates to go to the other levels :P
If I found some time I would think about it, those could be nice singleplayer maps =)



_________________
Image
http://www.q3-sg.tk


Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 44138
PostPosted: 12-08-2014 12:28 PM           Profile   Send private message  E-mail  Edit post Reply with quote


camel wrote:
Ok I've tested your MOD functions
All is working very well
basically, your MOD have everything that I need for my Stargate map
too bad you goes the way where multiplayer is not supported anymore, thats why with your permission I would like to copy your functions to my own MOD which basically will be an vanilla q3 with additional features that will only work in advanced way if special key's would be set on the map itself.


Yeah go ahead. The code's open source for a reason :)

camel wrote:
btw, will those changes work with normal AAS for bots, I mean, will bots play as usual and be attracted by trigger_teleport to go to the other side while it will be unlinked, or what will happen if trigger_teleport will have changed destination by the target_modify ? :)


I don't think the bots will know how to deal with it. The AAS compiler assumes the trigger is there and will create an AAS file that tells the bots there is a trigger there. If you unlink the trigger, there's a good chance the bots will assume the trigger still works. You might have to change the bot AI code to be able to deal with disabled triggers.

camel wrote:
is there any link from where I can download whole MOD source files in a ZIP ?


I replied to your private message. There's a link in there.

camel wrote:
also which program did you used to write/compile the MOD ?
I am using "Microsoft Visual C++ 2008 Express Edition".


You can use that to build DLL files. I wrote a tutorial that explains some things about building a mod. To build qvm files you'll need the qvm compiler. It's in the source repository of the EntityPlus site but I didn't include those in the ZIP file. If you want the whole, complete package, let me know, I'll upload a more complete zip file.

camel wrote:
I could create some nicely logic map for your MOD where player would need to fight the bots, collect artefacts and find its path to finally activate the Stargates to go to the other levels :P
If I found some time I would think about it, those could be nice singleplayer maps =)


I think it would be great if you'd find the time and enthusiasm to create a StarGate themed EntityPlus map. One of the reasons I'm not really working on the mod anymore is because no one made maps for it.




Top
                 

Grunt
Grunt
Joined: 06 Dec 2009
Posts: 69
PostPosted: 12-08-2014 03:53 PM           Profile Send private message  E-mail  Edit post Reply with quote


Your MOD fulfill all the criteria my stargate map needs, teleport on/off, doors being muted/toggle stay on their position and I even manage to finish up toggle on/off looped sound :)

Now I need to extract all these functions that I need and copy/paste them to vanilla q3 mod as I want my maps to be playable on multiplayer ctf gametype, not only the singplayer to be honest and maybe if I create also simple tutorial how to ADD all these new functions to any mod, who knows maybe it will be available in newest Excessiveplus mod when the developer would want to add all of this, some of the part of Entityplus could be a part of Excessiveplus someday hehe :P



_________________
Image
http://www.q3-sg.tk


Top
                 
Quake3World.com | Forum Index | Programming Discussion


Post new topic Reply to topic


cron
Quake3World.com
© ZeniMax. Zenimax, QUAKE III ARENA, Id Software and associated trademarks are trademarks of the ZeniMax group of companies. All rights reserved.
This is an unofficial fan website without any affiliation with or endorsement by ZeniMax.
All views and opinions expressed are those of the author.